Skip to content
Snippets Groups Projects
This project is mirrored from https://github.com/angular/angular.git. Pull mirroring updated .
  1. Jul 09, 2020
    • Alex Rickabaugh's avatar
      release: cut the v10.0.3 release · f24972b1
      Alex Rickabaugh authored
      10.0.3
      f24972b1
    • Paul Gschwendtner's avatar
      build: filter out duplicate cherry-picked commits in changelog (#37956) · d2886b3b
      Paul Gschwendtner authored
      Often changelogs are generated from the patch branch and then
      cherry-picked into the `CHANGELOG.md` file in `master` for
      better access and readability. This is problematic though as
      `conventional-changelog` (the tool we use for generating the
      changelog), will duplicate commits when a future changelog
      is generated from `master` then (i.e. for a new minor release).
      
      This happens because conventional-changelog always generates the
      changelog from the latest tag in a given branch to `HEAD`. The
      tag in the patch branch does not correspond to any SHA in `master`
      so the intersection of commits is not automatically omitted.
      
      We work around this naively (until we have a better tool provided
      by dev-infra), by deduping commits that are already part of the
      changelog. This has proven to work as expected in the components
      repo.
      
      PR Close #37956
      d2886b3b
  2. Jul 08, 2020
    • George Kalpakas's avatar
      docs: minor fixes to docs related to updating to v10 (#37897) · f296fea1
      George Kalpakas authored
      This commit includes a couple of minor fixes to docs related to updating
      to v10:
      - Fix markdown link in "Updating to Angular version 10" guide.
      - Correctly display numbered list in
        "Solution-style `tsconfig.json` migration" guide.
      
      PR Close #37897
      f296fea1
    • Paul Gschwendtner's avatar
      feat(dev-infra): merge script should link to original commit when... · 2605fc46
      Paul Gschwendtner authored
      feat(dev-infra): merge script should link to original commit when cherry-picking with API strategy (#37889)
      
      The merge script uses `git cherry-pick` for both the API merge strategy
      and the autosquash strategy. It uses cherry-pick to push commits to
      different target branches (e.g. into the `10.0.x` branch).
      
      Those commits never point to the commits that landed in the primary
      Github branch though. For the autosquash strategy the pull request number
      is always included, so there is a way to go back to the source. On the other
      hand though, for commits cherry-picked in the API merge strategy, the
      pull request number might not always be included (due to Github's
      implementation of the rebase merge method).
      
      e.g.
      https://github.com/angular/components/commit/27f52711c0618a9ae4eab4c888c8ab3245638e77
      
      For those cases we'd want to link the cherry-picked commits to the
      original commits so that the corresponding PR is easier to track
      down. This is not needed for the autosquash strategy (as outlined
      before), but it would have been good for consistency. Unfortunately
      though this would rather complicate the strategy as the autosquash
      strategy cherry-picks directly from the PR head, so the SHAs that
      are used in the primary branch are not known.
      
      PR Close #37889
      2605fc46
  3. Jul 07, 2020
    • George Kalpakas's avatar
      fix(docs-infra): prevent search-bar from overlapping nav-items (#37938) · 9d54b3a1
      George Kalpakas authored
      As part of angular.io's responsive layout, the menu shown in the top-bar
      is collapsed into the sidenav on narrow screens at the point where the
      search-bar (on the right side of the top-bar) would overlap with the
      menu's nav-items.
      
      Previously, the value used as break-point would work on marketing pages,
      where the hamburger button is not shown on wide screens. However, on
      docs pages (where the hamburger button is always shown, pushing the menu
      further to the right), the search-bar would still overlap the menu
      nav-items on some resolutions.
      
      This commit fixes it by raising the screen width threshold at a value
      that ensures there is no overlap even on pages where the hamburger
      button is visible alongside the top-bar menu.
      
      Fixes #37937
      
      PR Close #37938
      9d54b3a1
    • George Kalpakas's avatar
      refactor(docs-infra): decouple showing the top-menu in top-bar from showing the sidenav (#37938) · d09a6283
      George Kalpakas authored
      As part of angular.io's responsive layout, the following rules are
      applied:
      - On wide screens, a menu is shown in the top-bar and the sidenav is
        shown side-by-side with the docs content.
      - On narrow screens, the top-menu is moved from the top-bar to the
        sidenav and the sidenav is closed by default and floats over the
        content when manually opened.
      
      Previously, the break-points at which the top-menu was shown in the
      top-bar and the sidenav was shown side-by-side with the content were the
      same (using a single variable).
      
      This commit decouples the two break-points to make it possible to use
      different values in the future.
      
      PR Close #37938
      d09a6283
    • George Kalpakas's avatar
      refactor(docs-infra): use Sass variable for top-bar hamburger button show/hide threshold (#37938) · 1c168c3a
      George Kalpakas authored
      Use a Sass variable for the screen width break-point at which the
      top-bar hamburger button is hidden/shown. This allows more easily
      updating the break-point.
      
      PR Close #37938
      1c168c3a
    • George Kalpakas's avatar
      build(docs-infra): improve applying post-install patches (#37896) · 0f74479c
      George Kalpakas authored
      In `aio/`, we have a mechanism to apply patches in a `postinstall` hook.
      See `aio/tools/cli-patches/README.md` for more info.
      
      Previously, we had to update `aio/tools/cli-patches/patch.js` to list
      each `.patch` file separately. While working on #37688, I found it
      helpful for the script to automatically pick up `.patch` files.
      
      This commit updates the script to automatically pick up and apply
      `.patch` files from the `aio/tools/cli-patches/` directory. If one wants
      to keep a `.patch` file but not apply it, they can change the file's
      extension or move it to a sub-directory (without having to update the
      script).
      
      PR Close #37896
      0f74479c
    • Andrew Kushnir's avatar
      fix(core): handle spaces after `select` and `plural` ICU keywords (#37866) · 790bb949
      Andrew Kushnir authored
      Currently when the `plural` or `select` keywords in an ICU contain trailing spaces (e.g. `{count, select , ...}`), these spaces are also included into the key names in ICU vars (e.g. "VAR_SELECT "). These trailing spaces are not desirable, since they will later be converted into `_` symbols while normalizing placeholder names, thus causing mismatches at runtime (i.e. placeholder will not be replaced with the correct value). This commit updates the code to trim these spaces while generating an object with placeholders, to make sure the runtime logic can replace these placeholders with the right values.
      
      PR Close #37866
      790bb949
    • Andrew Kushnir's avatar
      fix(dev-infra): fix typo in ng-dev config (#37862) · 2adcad6d
      Andrew Kushnir authored
      The logic to exclude certain types of commits (specifically 'docs' ones) was implemented in https://github.com/angular/angular/commit/c5b125b7db50914840849a8d86cbb3304d2f4e68. The ng-dev config was updated in the followup commit https://github.com/angular/angular/commit/acf3cff9eedbcfbc4476e0597d0a3c7a883bd05f, but there was a typo that prevented the new logic from being activated. This commit updates the name of the config option in the ng-dev config to the right one (minBodyLengthTypeExcludes).
      
      PR Close #37862
      2adcad6d
    • Omar Hasan's avatar
      docs: mention for depreciation for `Testbed.get()` (#37815) · 242ef1ac
      Omar Hasan authored
      As mention in https://angular.io/guide/deprecations for this API, it may be important mention for this to make developers migrate or avoid using it
      
      PR Close #37815
      242ef1ac
  4. Jul 01, 2020
  5. Jun 30, 2020
    • Alex Rickabaugh's avatar
      perf(compiler-cli): fix memory leak in retained incremental state (#37835) · 57a518a3
      Alex Rickabaugh authored
      Incremental compilation allows for the output state of one compilation to be
      reused as input to the next compilation. This involves retaining references
      to instances from prior compilations, which must be done carefully to avoid
      memory leaks.
      
      This commit fixes such a leak with a complicated retention chain:
      
      * `TrackedIncrementalBuildStrategy` unnecessarily hangs on to the previous
        `IncrementalDriver` (state of the previous compilation) once the current
        compilation completes.
      
        In general this is unnecessary, but should be safe as long as the chain
        only goes back one level - if the `IncrementalDriver` doesn't retain any
        previous `TrackedIncrementalBuildStrategy` instances. However, this does
        happen:
      
      * `NgCompiler` indirectly causes retention of previous `NgCompiler`
        instances (and thus previous `TrackedIncrementalBuildStrategy` instances)
        through accidental capture of the `this` context in a closure created in
        its constructor. This closure is wrapped in a `ts.ModuleResolutionCache`
        used to create a `ModuleResolver` class, which is passed to the program's
        `TraitCompiler` on construction.
      
      * The `IncrementalDriver` retains a reference to the `TraitCompiler` of the
        previous compilation, completing the reference chain.
      
      The final retention chain thus looks like:
      
      * `TrackedIncrementalBuildStrategy` of current program
      * `.previous`: `IncrementalDriver` of previous program
      * `.lastGood.traitCompiler`: `TraitCompiler`
      * `.handlers[..].moduleResolver.moduleResolutionCache`: cache
      * (via `getCanonicalFileName` closure): `NgCompiler`
      * `.incrementalStrategy`: `TrackedIncrementalBuildStrategy` of previous
        program.
      
      The closure link is the "real" leak here. `NgCompiler` is creating a closure
      for `getCanonicalFileName`, delegating to its
      `this.adapter.getCanonicalFileName`, for the purposes of creating a
      `ts.ModuleResolutionCache`. The fact that the closure references
      `NgCompiler` thus eventually causes previous `NgCompiler` iterations to be
      retained. This is also potentially problematic due to the shared nature of
      `ts.ModuleResolutionCache`, which is potentially retained across multiple
      compilations intentionally.
      
      This commit fixes the first two links in the retention chain: the build
      strategy is patched to not retain a `previous` pointer, and the `NgCompiler`
      is patched to not create a closure in the first place, but instead pass a
      bound function. This ensures that the `NgCompiler` does not retain previous
      instances of itself in the first place, even if the build strategy does
      end up retaining the previous incremental state unnecessarily.
      
      The third link (`IncrementalDriver` unnecessarily retaining the whole
      `TraitCompiler`) is not addressed in this commit as it's a more
      architectural problem that will require some refactoring. However, the leak
      potential of this retention is eliminated thanks to fixing the first two
      issues.
      
      PR Close #37835
      57a518a3
    • Pete Bacon Darwin's avatar
      build(docs-infra): update to latest dgeni-packages (#37793) · 29b83189
      Pete Bacon Darwin authored
      This update of dgeni-packages to 0.28.4 fixes the
      rendering of type initializers for classes and interfaces.
      
      Closes #37694
      
      PR Close #37793
      29b83189
    • Jaskaran Singh's avatar
      docs: correct the spelling mistake in observables error handling code (#36437) · 1d3df788
      Jaskaran Singh authored
      This commit fixes a spelling error in the word error in the
      observables.md guide. It is currently
      spelled errror  and the mistake is not intentional.
      
      PR Close #36437
      1d3df788
    • Santosh Yadav's avatar
      docs: change definition of providedIn any (#35292) · fd06ffa2
      Santosh Yadav authored
      change in the definition of providedIn:any any instance creates a singleton instance
      for each lazy loaded module and one instance for eager loaded module
      
      PR Close #35292
      fd06ffa2
    • Judy Bogart's avatar
      docs: correct left nav to remove duplicated page links (#37833) · 36a1622d
      Judy Bogart authored
      The major sections Angular Libraries, Schematics, and CLI Builders appear twice, in their old location under Techniques, and in the new correct location under Extending Angular.
      
      PR Close #37833
      36a1622d
    • JiaLiPassion's avatar
      fix(core): fake_async_fallback should have the same logic with fake-async (#37680) · 7a91b23c
      JiaLiPassion authored
      PR https://github.com/angular/angular/pull/37523 failed when trying to use `rxjs delay` operator
      inside `fakeAsync`, and the reasons are:
      
      1. we need to import `rxjs-fake-async` patch to make the integration work.
      2. since in `angular` repo, the bazel target `/tools/testing:node` not using `zone-testing` bundle,
      instead it load `zone-spec` packages seperately, so it causes one issue which is the `zone.js/testing/fake-async`
      package is not loaded, we do have a fallback logic under `packages/core/testing` calles `fake_async_fallback`,
      but the logic is out of date with `fake-async` under `zone.js` package.
      
      So this PR, I updated the content of `fake_async_fallback` to make it consistent with
      `fake-async`. And I will make another PR to try to remove the `fallback` logic.
      
      PR Close #37680
      7a91b23c
    • JoostK's avatar
      fix(ngcc): prevent including JavaScript sources outside of the package (#37596) · 4b90b6a2
      JoostK authored
      When ngcc creates an entry-point program, the `allowJs` option is enabled
      in order to operate on the JavaScript source files of the entry-point.
      A side-effect of this approach is that external modules that don't ship
      declaration files will also have their JavaScript source files loaded
      into the program, as the `allowJs` flag allows for them to be imported.
      This may pose an issue in certain edge cases, where ngcc would inadvertently
      operate on these external modules. This can introduce all sorts of undesirable
      behavior and incompatibilities, e.g. the reflection host that is selected for
      the entry-point's format could be incompatible with that of the external
      module's JavaScript bundles.
      
      To avoid these kinds of issues, module resolution that would resolve to
      a JavaScript file located outside of the package will instead be rejected,
      as if the file would not exist. This would have been the behavior when
      `allowJs` is set to false, which is the case in typical Angular compilations.
      
      Fixes #37508
      
      PR Close #37596
      4b90b6a2
    • JoostK's avatar
      refactor(ngcc): let `isWithinPackage` operate on paths instead of source files (#37596) · b13daa4c
      JoostK authored
      Changes `isWithinPackage` to take an `AbsoluteFsPath` instead of `ts.SourceFile`,
      to allow for an upcoming change to use it when no `ts.SourceFile` is available,
      but just a path.
      
      PR Close #37596
      b13daa4c
    • nobobo1234's avatar
      docs: Changing typo Stacblitz into Stackblitz in the Tour of Hereos tutorial docs page (#37794) · 0c6f0268
      nobobo1234 authored
      Changing the typo of Stacblitz into Stackblitz in the tour of hereos tutorial docs page since that is the actual name of the service
      
      PR Close #37794
      0c6f0268
    • Maksymilian Sielicki's avatar
      docs: remove first person from 2 sentences (#37768) · a2520bd2
      Maksymilian Sielicki authored
      This commit removes two instances of the first person in the
      Dependency injection providers documentation.
      
      PR Close #37768
      a2520bd2
    • Amadou Sall's avatar
      docs: add Amadou Sall to GDE page (#36509) · b928a209
      Amadou Sall authored
      This commit adds Amadou Sall to the Angular GDE page along with a
      biography, his role at Air France, and a photograph.
      
      PR Close #36509
      b928a209
    • George Kalpakas's avatar
      fix(elements): fire custom element output events during component initialization (#37570) · 89e16ed6
      George Kalpakas authored
      Previously, event listeners for component output events attached on an
      Angular custom element before inserting it into the DOM (i.e. before
      instantiating the underlying component) didn't fire for events emitted
      during initialization lifecycle hooks, such as `ngAfterContentInit`,
      `ngAfterViewInit`, `ngOnChanges` (initial call) and `ngOnInit`.
      The reason was that `NgElementImpl` [subscribed to events][1] _after_
      calling [ngElementStrategy#connect()][2], which is where the
      [initial change detection][3] takes place (running the initialization
      lifecycle hooks).
      
      This commit fixes this by:
      1. Ensuring `ComponentNgElementStrategy#events` is defined and available
         for subscribing to, even before instantiating the component.
      2. Changing `NgElementImpl` to subscribe to `NgElementStrategy#events`
         (if available) before calling `NgElementStrategy#connect()` (which
         initializes the component instance) if available.
      3. Falling back to the old behavior (subscribing to `events` after
         calling `connect()` for strategies that do not initialize `events`
         before their `connect()` is run).
      
      NOTE:
      By falling back to the old behavior when `NgElementStrategy#events` is
      not initialized before calling `NgElementStrategy#connect()`, we avoid
      breaking existing custom `NgElementStrategy` implementations (with
      @remackgeek's [ElementZoneStrategy][4] being a commonly used example).
      
      Jira issue: [FW-2010](https://angular-team.atlassian.net/browse/FW-2010)
      
      [1]: https://github.com/angular/angular/blob/c0143cb2abdd172de1b95fd1d2c4cfc738640e28/packages/elements/src/create-custom-element.ts#L167-L170
      [2]: https://github.com/angular/angular/blob/c0143cb2abdd172de1b95fd1d2c4cfc738640e28/packages/elements/src/create-custom-element.ts#L164
      [3]: https://github.com/angular/angular/blob/c0143cb2abdd172de1b95fd1d2c4cfc738640e28/packages/elements/src/component-factory-strategy.ts#L158
      [4]: https://github.com/remackgeek/elements-zone-strategy/blob/f1b6699495a8c0909dbbfbdca12770ecca843e15/projects/elements-zone-strategy/src/lib/element-zone-strategy.ts
      
      Fixes #36141
      
      PR Close #37570
      89e16ed6
    • Pete Bacon Darwin's avatar
      fix(ngcc): ensure lockfile is removed when analyzeFn fails (#37739) · 1a1f99af
      Pete Bacon Darwin authored
      Previously an error thrown in the `analyzeFn` would cause
      the ngcc process to exit immediately without removing the
      lockfile, and potentially before the unlocker process had been
      successfully spawned resulting in the lockfile being orphaned
      and left behind.
      
      Now we catch these errors and remove the lockfile as needed.
      
      PR Close #37739
      1a1f99af
    • Harri Lehtola's avatar
      fix(core): error when invoking callbacks registered via ViewRef.onDestroy (#37543) (#37783) · df2cd37e
      Harri Lehtola authored
      Invoking a callback registered through `ViewRef.onDestroy` throws an error, because we weren't registering it correctly in the internal data structure. These changes also remove the `storeCleanupFn` function, because it was mostly identical to `storeCleanupWithContext` and was only used in one place.
      
      Fixes #36213.
      
      PR Close #37543
      
      PR Close #37783
      df2cd37e
    • Harri Lehtola's avatar
      fix(core): determine required DOMParser feature availability (#36578) (#37783) · 12a71bc6
      Harri Lehtola authored
      Verify that HTML parsing is supported in addition to DOMParser existence.
      This maybe wasn't as important before when DOMParser was used just as a
      fallback on Firefox, but now that DOMParser is the default choice, we need
      to be more accurate.
      
      PR Close #37783
      12a71bc6
    • Harri Lehtola's avatar
      refactor(core): split inert strategies to separate classes (#36578) (#37783) · 7d270c23
      Harri Lehtola authored
      The `inertDocument` member is only needed when using the InertDocument
      strategy. By separating the DOMParser and InertDocument strategies into
      separate classes, we can easily avoid creating the inert document
      unnecessarily when using DOMParser.
      
      PR Close #37783
      7d270c23
    • Harri Lehtola's avatar
      fix(core): do not trigger CSP alert/report in Firefox and Chrome (#36578) (#37783) · b0b72485
      Harri Lehtola authored
      If [innerHTML] is used in a component and a Content-Security-Policy is set
      that does not allow inline styles then Firefox and Chrome show the following
      message:
      
      > Content Security Policy: The page’s settings observed the loading of a
      resource at self (“default-src”). A CSP report is being sent.
      
      This message is caused because Angular is creating an inline style tag to
      test for a browser bug that we use to decide what sanitization strategy to
      use, which causes CSP violation errors if inline CSS is prohibited.
      
      This test is no longer necessary, since the `DOMParser` is now safe to use
      and the `style` based check is redundant.
      
      In this fix, we default to using `DOMParser` if it is available and fall back
      to `createHTMLDocument()` if needed. This is the approach used by DOMPurify
      too.
      
      The related unit tests in `html_sanitizer_spec.ts`, "should not allow
      JavaScript execution when creating inert document" and "should not allow
      JavaScript hidden in badly formed HTML to get through sanitization (Firefox
      bug)", are left untouched to assert that the behavior hasn't changed in
      those scenarios.
      
      Fixes #25214.
      
      PR Close #37783
      b0b72485
  6. Jun 27, 2020