docs(zone.js): Add breaking changes info for zone.js v0.11.1 (#38821)
Before Zone.js `v0.11.1`, Zone.js provides two format of bundles under `dist` folder, `ES5` bundle `zone.js` and `ES2015` bundle `zone-evergreen.js`, these bundles are used for `differential loading` of Angular. By default, the following code ``` import 'zone.js'; ``` loads the `ES5` bundle `zone.js`. From `v0.11.1`, Zone.js follows the [Angular Package Format] (https://docs.google.com/document/d/1CZC2rcpxffTDfRDs6p1cfbmKNLA6x5O-NtkJglDaBVs), so the folder structure of the Zone.js bundles is updated to match `Angular Package Format`. So the same code ``` import 'zone.js'; ``` loads the `ES2015` bundle. This is a breaking change, so if the apps import zone.js in this way, the apps will not work in legacy browsers such as `IE11`. Zone.js still provides the same bundles under `dist` folder to keep backward compatibility after `v0.11.1`. So the following code in `polyfills.ts` generated by `Angular CLI` still works. ``` import 'zone.js/dist/zone'; ``` For details, please refer the [changelog](./CHANGELOG.md) and the [PR](https://github.com/angular/angular/pull/36540). PR Close #38821
This commit is contained in:
		
							parent
							
								
									e62a918542
								
							
						
					
					
						commit
						5614258cc7
					
				| @ -7,6 +7,35 @@ | |||||||
| * **zone.js:** zone.js package.json should not include files/directories field ([#38528](https://github.com/angular/angular/issues/38528)) ([6b662d1](https://github.com/angular/angular/commit/6b662d1)), closes [#38526](https://github.com/angular/angular/issues/38526) [#38516](https://github.com/angular/angular/issues/38516) [#38513](https://github.com/angular/angular/issues/38513) | * **zone.js:** zone.js package.json should not include files/directories field ([#38528](https://github.com/angular/angular/issues/38528)) ([6b662d1](https://github.com/angular/angular/commit/6b662d1)), closes [#38526](https://github.com/angular/angular/issues/38526) [#38516](https://github.com/angular/angular/issues/38516) [#38513](https://github.com/angular/angular/issues/38513) | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  | # BREAKING CHANGES since Zone.js v0.11.1 | ||||||
|  | 
 | ||||||
|  | Prior to `v0.11.1`, Zone.js provided two distribution bundle formats in the `dist` folder. | ||||||
|  | They were (1) `ES5` bundle distributed as `zone.js` and (2) `ES2015` bundle distributed as `zone-evergreen.js`. | ||||||
|  | These bundles are used for Angular's differential-loading mechanism.  | ||||||
|  | 
 | ||||||
|  | Prior to `v0.11.11` the following code | ||||||
|  | 
 | ||||||
|  | ``` | ||||||
|  | import 'zone.js'; | ||||||
|  | ``` | ||||||
|  | would load the `ES5` bundle from `dist/zone.js`. | ||||||
|  | 
 | ||||||
|  | Starting with `v0.11.1`, Zone.js follows the [Angular Package Format](https://docs.google.com/document/d/1CZC2rcpxffTDfRDs6p1cfbmKNLA6x5O-NtkJglDaBVs), so the folder structure of the Zone.js bundles is updated to match `Angular Package Format`. | ||||||
|  | So the same code | ||||||
|  | 
 | ||||||
|  | ``` | ||||||
|  | import 'zone.js'; | ||||||
|  | ``` | ||||||
|  | now loads the `ES2015` bundle instead. | ||||||
|  | 
 | ||||||
|  | This is a breaking change for legacy browsers such as `IE11`. | ||||||
|  | 
 | ||||||
|  | For backwards compatibility `zone.js` continues to distribute the same bundles under `dist`. | ||||||
|  | To restore the old behavior change the `polyfills.ts` generated by `Angular CLI` to import like so: | ||||||
|  | 
 | ||||||
|  | ``` | ||||||
|  | import 'zone.js/dist/zone'; | ||||||
|  | ``` | ||||||
| 
 | 
 | ||||||
| <a name="0.11.0"></a> | <a name="0.11.0"></a> | ||||||
| # [0.11.0](https://github.com/angular/angular/compare/zone.js-0.10.3...zone.js-0.11.0) (2020-08-14) | # [0.11.0](https://github.com/angular/angular/compare/zone.js-0.10.3...zone.js-0.11.0) (2020-08-14) | ||||||
|  | |||||||
| @ -17,6 +17,38 @@ See the new API [here](./lib/zone.ts). | |||||||
| 
 | 
 | ||||||
| Read up on [Zone Primer](https://docs.google.com/document/d/1F5Ug0jcrm031vhSMJEOgp1l-Is-Vf0UCNDY-LsQtAIY). | Read up on [Zone Primer](https://docs.google.com/document/d/1F5Ug0jcrm031vhSMJEOgp1l-Is-Vf0UCNDY-LsQtAIY). | ||||||
| 
 | 
 | ||||||
|  | # BREAKING CHANGES since Zone.js v0.11.1 | ||||||
|  | 
 | ||||||
|  | Prior to `v0.11.1`, Zone.js provided two distribution bundle formats in the `dist` folder. | ||||||
|  | They were (1) `ES5` bundle distributed as `zone.js` and (2) `ES2015` bundle distributed as `zone-evergreen.js`. | ||||||
|  | These bundles are used for Angular's differential-loading mechanism.  | ||||||
|  | 
 | ||||||
|  | Prior to `v0.11.11` the following code | ||||||
|  | 
 | ||||||
|  | ``` | ||||||
|  | import 'zone.js'; | ||||||
|  | ``` | ||||||
|  | would load the `ES5` bundle from `dist/zone.js`. | ||||||
|  | 
 | ||||||
|  | Starting with `v0.11.1`, Zone.js follows the [Angular Package Format](https://docs.google.com/document/d/1CZC2rcpxffTDfRDs6p1cfbmKNLA6x5O-NtkJglDaBVs), so the folder structure of the Zone.js bundles is updated to match `Angular Package Format`. | ||||||
|  | So the same code | ||||||
|  | 
 | ||||||
|  | ``` | ||||||
|  | import 'zone.js'; | ||||||
|  | ``` | ||||||
|  | now loads the `ES2015` bundle instead. | ||||||
|  | 
 | ||||||
|  | This is a breaking change for legacy browsers such as `IE11`. | ||||||
|  | 
 | ||||||
|  | For backwards compatibility `zone.js` continues to distribute the same bundles under `dist`. | ||||||
|  | To restore the old behavior change the `polyfills.ts` generated by `Angular CLI` to import like so: | ||||||
|  | 
 | ||||||
|  | ``` | ||||||
|  | import 'zone.js/dist/zone'; | ||||||
|  | ``` | ||||||
|  | 
 | ||||||
|  | For details, please refer the [changelog](./CHANGELOG.md) and the [PR](https://github.com/angular/angular/pull/36540). | ||||||
|  | 
 | ||||||
| ## What's a Zone? | ## What's a Zone? | ||||||
| 
 | 
 | ||||||
| A Zone is an execution context that persists across async tasks. | A Zone is an execution context that persists across async tasks. | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user