mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-10-30 18:36:22 +01:00 
			
		
		
		
	Convert frontend code to typescript (#31559)
None of the frontend js/ts files was touched besides these two commands
(edit: no longer true, I touched one file in
61105d0618
because of a deprecation that was not showing before the rename).
`tsc` currently reports 778 errors, so I have disabled it in CI as
planned.
Everything appears to work fine.
			
			
This commit is contained in:
		
							
								
								
									
										17
									
								
								web_src/js/webcomponents/polyfills.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										17
									
								
								web_src/js/webcomponents/polyfills.ts
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,17 @@ | ||||
| try { | ||||
|   // some browsers like PaleMoon don't have full support for Intl.NumberFormat, so do the minimum polyfill to support "relative-time-element" | ||||
|   // https://repo.palemoon.org/MoonchildProductions/UXP/issues/2289 | ||||
|   new Intl.NumberFormat('en', {style: 'unit', unit: 'minute'}).format(1); | ||||
| } catch { | ||||
|   const intlNumberFormat = Intl.NumberFormat; | ||||
|   Intl.NumberFormat = function(locales, options) { | ||||
|     if (options.style === 'unit') { | ||||
|       return { | ||||
|         format(value) { | ||||
|           return ` ${value} ${options.unit}`; | ||||
|         }, | ||||
|       }; | ||||
|     } | ||||
|     return intlNumberFormat(locales, options); | ||||
|   }; | ||||
| } | ||||
		Reference in New Issue
	
	Block a user