皇上,还记得我吗?我就是1999年那个Linux伊甸园啊-----24小时滚动更新开源资讯,全年无休!

Angular 11.0.0 发布

Bug Fixes

Features

  • core: add automated migration to replace async with waitForAsync (#39212) (5ce71e0)
  • core: add automated migration to replace ViewEncapsulation.Native (#38882) (0e733f3)
  • core: add initialNavigation schematic (#36926) (0ec7043)
  • core: add Trusted Types workaround for Function constructor (#39209) (5913e5c)
  • core: create internal Trusted Types module (#39207) (0875fd2)
  • core: depend on type definitions for Trusted Types (#39207) (c4266fb)
  • core: remove ViewEncapsulation.Native (#38882) (4a1c12c)
  • language-service: [Ivy] getSemanticDiagnostics for external templates (#39065) (63624a2)
  • language-service: Add getTypeDefinitionAtPosition (go to type definition) (#39145) (a84976f)
  • language-service: Add module name to directive quick info (#39121) (4604fe9)
  • router: add new initialNavigation options to replace legacy (#37480) (c4becca)
  • compiler-cli: support getting resource dependencies for a source file (#38048) (5dbf357)
  • forms: add migration for AbstractControl.parent accesses (#39009) (aeec223), closes #32671
  • language-service: Add getDefinitionAndBoundSpan (go to definition) (#39101) (3975dd9)
  • language-service: add quick info for inline templates in ivy (#39060) (904adb7)
  • common: stricter types for DatePipe (#37447) (daf8b7f)
  • common: stricter types for number pipes (#37447) (7b2aac9)
  • compiler: Add keySpan to Variable Node (#38965) (239968d)
  • router: Add relativeLinkResolution migration to update default value (#38698) (15ea811)
  • common: Add ISO week-numbering year formats support to formatDate (#38828) (984ed39)
  • compiler: Parse and recover on incomplete opening HTML tags (#38681) (6ae3b68), closes #38596
  • router: add migration to update calls to navigateByUrl and createUrlTree with invalid parameters (#38825) (7849fdd), closes #38227
  • service-worker: add the option to prefer network for navigation requests (#38565) (a206852), closes #38194
  • compiler-cli: TemplateTypeChecker operation to get Symbol from a template node (#38618) (c4556db)
  • compiler-cli: Add ability to get Symbol of Templates and Elements in component template (#38618) (cf2e8b9)
  • compiler-cli: Add ability to get Symbol of AST expression in component template (#38618) (f56ece4)
  • compiler-cli: add ability to get symbol of reference or variable (#38618) (19598b4)
  • compiler-cli: define interfaces to be used for TemplateTypeChecker (#38618) (9e77bd3)
  • service-worker: add UnrecoverableStateError (#36847) (036a2fa), closes #36539

Performance Improvements

  • compiler-cli: only generate template context declaration when used (#39321) (1ac0500)
  • core: do not recurse into modules that have already been registered (#39514) (5c13c67), closes #39487
  • compiler-cli: only emit directive/pipe references that are used (#38539) (077f516)
  • compiler-cli: optimize computation of type-check scope information (#38539) (297c060)
  • router: use ngDevMode to tree-shake error messages in router (#38674) (db21c4f)

BREAKING CHANGES

  • platform-server: If you use useAbsoluteUrl to setup platform-server, you now need to also specify baseUrl. We are intentionally making this a breaking change in a minor release, because if useAbsoluteUrl is set to true then the behavior of the application could be unpredictable, resulting in issues that are hard to discover but could be affecting production environments.
  • compiler: TypeScript 3.9 is no longer supported, please upgrade to TypeScript 4.0.
  • router: * The initialNavigation property for the options in RouterModule.forRoot no longer supports legacy_disabledlegacy_enabledtrue, or false as valid values. legacy_enabled (the old default) is instead enabledNonBlocking
  • enabled is deprecated as a valid value for the RouterModule.forRoot initialNavigation option. enabledBlocking has been introduced to replace it
  • router: preserveQueryParams has been removed, use queryParamsHandling=”preserve” instead
  • router: If you were accessing the RouterLink values of queryParamsfragment or queryParamsHandling you might need to relax the typing to also accept undefined and null. (#39151)
  • core: * ViewEncapsulation.Native has been removed. Use ViewEncapsulation.ShadowDom instead. Existing usages will be updated automatically by ng update.
  • compiler-cli: Expressions within ICUs are now type-checked again, fixing a regression in Ivy. This may cause compilation failures if errors are found in expressions that appear within an ICU. Please correct these expressions to resolve the type-check errors.
  • forms: Directives in the @angular/forms package used to have any[] as a type of validators and asyncValidators arguments in constructors. Now these arguments are properly typed, so if your code relies on directive constructor types it may require some updates to improve type safety.
  • forms: Type of AbstractFormControl.parent now includes null. null is now included in the types of .parent. If you don’t already have a check for this case, the TypeScript compiler might complain. A v11 migration exists which adds the non-null assertion operator where necessary. In an unlikely case your code was testing the parent against undefined with strict equality, you’ll need to change this to === null instead, since the parent is now explicitly initialized with null instead of being left undefined.
  • packaging: In v10, IE 9, 10, and IE mobile support was deprecated. In v11, Angular framework removes IE 9, 10, and IE mobile support completely. Supporting outdated browsers like these increases bundle size, code complexity, and test load, and also requires time and effort that could be spent on improvements to the framework. For example, fixing issues can be more difficult, as a straightforward fix for modern browsers could break old ones that have quirks due to not receiving updates from vendors.
  • platform-webworker: @angular/platform-webworker and @angular/platform-webworker-dynamic have been removed as they were deprecated in v8
  • common: The slice pipe now returns null for the undefined input value, which is consistent with the behavior of most pipes. If you rely on undefined being the result in that case, you now need to check for it explicitly.
  • common: The typing of the keyvalue pipe has been fixed to report that for input objects that have number keys, the result will contain the string representation of the keys. This was already the case and the code has simply been updated to reflect this. Please update the consumers of the pipe output if they were relying on the incorrect types. Note that this does not affect use cases where the input values are Maps, so if you need to preserve numbers, this is an effective way.
  • common: The signatures of the number pipes now explicitly state which types are accepted. This should only cause issues in corner cases, as any other values would result in runtime exceptions.
  • common: The signature of the date pipe now explicitly states which types are accepted. This should only cause issues in corner cases, as any other values would result in runtime exceptions.
  • common: The async pipe no longer claims to return undefined for an input that was typed as undefined. Note that the code actually returned null on undefined inputs. In the unlikely case you were relying on this, please fix the typing of the consumers of the pipe output.
  • common: The case conversion pipes no longer let falsy values through. They now map both null and undefined to null and raise an exception on invalid input (0falseNaN) just like most “common pipes”. If your code required falsy values to pass through, you need to handle them explicitly.
  • router: While the new parameter types allow a variable of type NavigationExtras to be passed in, they will not allow object literals, as they may only specify known properties. They will also not accept types that do not have properties in common with the ones in the Pick. To fix this error, only specify properties from the NavigationExtras which are actually used in the respective function calls or use a type assertion on the object or variable: as NavigationExtras.
  • router: This commit changes the default value of relativeLinkResolution from 'legacy' to 'default'. If your application previously used the default by not specifying a value in the ExtraOptions and uses relative links when navigating from children of empty path routes, you will need to update your RouterModule to specifically specify 'legacy' for relativeLinkResolution. See https://angular.io/api/router/ExtraOptions#relativeLinkResolution for more details.
  • core: If you call TestBed.overrideProvider after TestBed initialization, provider overrides are not applied. This behavior is consistent with other override methods (such as TestBed.overrideDirective, etc) but they throw an error to indicate that, when the check was missing in the TestBed.overrideProvider function. Now calling TestBed.overrideProvider after TestBed initialization also triggers an error, thus there is a chance that some tests (where TestBed.overrideProvider is called after TestBed initialization) will start to fail and require updates to move TestBed.overrideProvider calls before TestBed initialization is completed.
  • router: This change corrects the argument order when calling RouteReuseStrategy#shouldReuseRoute. Previously, when evaluating child routes, they would be called with the future and current arguments would be swapped. If your RouteReuseStrategy relies specifically on only the future or current snapshot state, you may need to update the shouldReuseRoute implementation’s use of “future” and “current” ActivateRouteSnapshots.
  • common: The locale data API has been marked as returning readonly arrays, rather than mutable arrays, since these arrays are shared across calls to the API. If you were mutating them (e.g. calling sort()push()splice(), etc) then your code will not longer compile. If you need to mutate the array, you should now take a copy (e.g. by calling slice()) and mutate the copy.
  • common: When passing a date-time formatted string to the DatePipe in a format that contains fractions of a millisecond, the milliseconds will now always be rounded down rather than to the nearest millisecond. Most applications will not be affected by this change. If this is not the desired behaviour then consider pre-processing the string to round the millisecond part before passing it to the DatePipe.
  • core: CollectionChangeRecord has been removed, use IterableChangeRecord instead
  • forms: Previously if FormControl, FormGroup and FormArray class instances had async validators defined at initialization time, the status change event was not emitted once async validator completed. After this change the status event is emitted into the statusChanges observable. If your code relies on the old behavior, you can filter/ignore this additional status change event.

Code Refactoring

  • compiler: remove support for TypeScript 3.9 (#39313) (736e064)
  • router: Adjust type of parameter in navigateByUrl and createUrlTree to be more accurate (#38227) (e4f4d18), closes #18798

转自 https://github.com/angular/angular/blob/master/CHANGELOG.md