Commit graph

25900 commits

Author SHA1 Message Date
Paul Gschwendtner
eac5280bec build: support template make variables in nodejs_binary/test (#48521)
We modified the macros of `nodejs_binary/test` to have a rule
in between that requests the `.mjs` output. This works fine but
breaks make variable substitution for `templated_args` because
Bazel requires referenced labels to be part of the explicit `data`.

The rule in between breaks this, so we add a new argument that
can be used for such "template"/"args" data dependencies.

This can be removed when everything is ESM and we don't need
the rule in between.

PR Close #48521
2022-12-19 19:50:41 +00:00
Paul Gschwendtner
d3d22a9009 build: refactor ng_package to work with ESM (#48521)
Removes `shelljs` which is a known ESM-problematic dependency.
We don't need it anyway.

PR Close #48521
2022-12-19 19:50:41 +00:00
Paul Gschwendtner
c6d48c5366 build: prioritize ESM output in nodejs_test similar to binary-variant (#48521)
The `nodejs_binary` rule already prioritizes the `.mjs` output as
of the recent commits. The `nodejs_test` rule should do the same,
and also set `use_esm = True`

PR Close #48521
2022-12-19 19:50:41 +00:00
Paul Gschwendtner
553d42c86f build: patch rules_nodejs to prioritize ESM files for nodejs_binary/test (#48521)
The Bazel NodeJS rules will always use the `.js` files as entry-points.
Since we only rely on the `.mjs` output going-forward, we need to teach
`nodejs_binary` and `nodejs_test` to use the `.mjs` extensions if
intended.

Our `defaults.bzl` macros will set `use_esm = True`, but other targets
from e.g. external repositories should keep the original behavior.

PR Close #48521
2022-12-19 19:50:41 +00:00
Paul Gschwendtner
5c51c48f98 refactor: remove __ESM_IMPORT_META_URL__ workaround now that we can use ESM (#48521)
The `__ESM_IMPORT_META_URL__` trick was used because we used both ESM
and CommonJS in this repo. It was an interop needed because
`import.meta.url` syntax couldn't be used as it woud have caused syntax
errors.

We still need to keep the CommonJS/ESM interop in the compiler-cli
because g3 relies on the compiler and uses CommonJS. This affects very
few places, just in the compiler- so this is acceptable.

PR Close #48521
2022-12-19 19:50:41 +00:00
Paul Gschwendtner
0e1cbecc2c build: refactor generate-locales-tool to ESM (#48521)
The `generate-locales-tool` now needs to run as ESM because we changed
the `ts_library` rule. This commit accounts for the ESM syntax but
removing CJS code parts like `require.main === module`.

Also imports using `require` need to be changed to their ESM
equivalents.

PR Close #48521
2022-12-19 19:50:40 +00:00
Paul Gschwendtner
9e91bbd329 build: refactor ngc-wrapped to support ESM (#48521)
Since this repo will now be strict ESM, and Angular Compiler packages
on NPM are also ESM-only, we can rework `ngc-wrapped` to remove
the CJS/ESM interop and we make it strict ESM too.

PR Close #48521
2022-12-19 19:50:40 +00:00
Paul Gschwendtner
9cd89569f5 build: create NodeJS ESM loader for supporting Bazel setup (#48521)
Replaces the existing ESM loader for dealing with external module
imports. This loader was introduced by Aspect for AIO `.mjs` scripts.

The loader will be used as foundation for a more extensive loader
that also properly handles first-party packages.

Additionally another loader is added, all packed as a single
loader because our current NodeJS version only supports a single
loader per node invocation. So we implement chaining ourselves.

The new loader will attempt rewriting `.js` extensions to `.mjs`,
also it will add `.mjs` if not already done. This is necessary
in the transition phase because we don't/cannot use explicit `.mts`
extensions and also we don't specify extensions in imports yet.

Long-term we would likely use `.mts` and explicit import extensions,
but it's not yet clear how we would sync this into g3 too.

PR Close #48521
2022-12-19 19:50:40 +00:00
Paul Gschwendtner
fe6dcd1f5c build: rename esm-loader.mjs to a more specific filename (#48521)
This is in prearation for having a proper diff when this loader
is adjusted to support more situations than just simple external
node modules. See next commit.

Also the file is formatted to make the diff less verbose later.
The file was never formatted correctly and we don't lint `.mjs` files.

PR Close #48521
2022-12-19 19:50:40 +00:00
Paul Gschwendtner
ba5fe263b5 build: switch ng_module and ts_library devmode to ES2020 ESM (#48521)
Currently the devmode output for `ng_module` and `ts_library` is
using ES5 CommonJS UMD. To bring it in sync with prodmode and
to start with our long-term migration to full ESM- the devmode
is updated to to ES2020 ES modules too.

This will require more tricks to make devmod work with the bazel
setup and also tests may need to be refactored given them relying
on ES5 CJS features, like for `spyOn` jasmine patching etc.

PR Close #48521
2022-12-19 19:50:40 +00:00
Joey Perrott
e59406f5e7 build: enable new merge ready status action (#48494)
Enable new action in preperation for sunset of github robot

PR Close #48494
2022-12-15 15:21:14 +00:00
Andrew Kushnir
63debcc763 ci: mark //aio:e2e tests as flaky (#48498)
AIO e2e tests became more flaky recently. More investigation is needed to identify why,
but we mark the `//aio:e2e` as flaky for now to rerun those tests on CI if they fail.

PR Close #48498
2022-12-15 15:17:29 +00:00
Jessica Janiuk
eb52d9eabd release: cut the v15.1.0-next.3 release 2022-12-14 11:58:18 -08:00
Jessica Janiuk
6ade57cfdd fixup! docs: release notes for the v15.0.4 release 2022-12-14 11:18:04 -08:00
Jessica Janiuk
5303e0b8df docs: release notes for the v15.0.4 release 2022-12-14 11:18:04 -08:00
Andrew Scott
fe50813664 feat(common): Add BrowserPlatformLocation to the public API (#48488)
`PlatformLocation` is already part of the public API so developers can
create their own. This means that developers would already be able to
access the existing `BrowserPlatformLocation` at runtime by injecting
it. The motivation for adding `BrowserPlatformLocation` to the public
API is because of those facts, but driven more by the fact that we are
looking to include `MockPlatformLocation` by default in TestBed.
Developers would need a way to revert back to the current behavior for
some tests that rely directly on browser interaction.

PR Close #48488
2022-12-14 09:54:28 -08:00
Alan Agius
4ab3ed3109 docs: update CLI sources ref (#48486)
This is needed to update AIO documentation as currently the CLI docs are out of date.

PR Close #48486
2022-12-14 08:44:12 -08:00
Jens
b10e6185de docs: update date from 2022 to 2023 (#48485)
PR Close #48485
2022-12-14 08:43:31 -08:00
Jens
ca02f70c25 docs: add planned release schedule till v16 (#48485)
Add release dates for v15.1,v15.2 and v16
PR Close #48485
2022-12-14 08:43:31 -08:00
Andrew Scott
81203c6ec1 refactor(router): Add opt-in provider for upcoming router change (#47988)
This commit adds a swappable provider for an upcoming change to the
implementation of `Router#createUrlTree`. This will be a breaking change
and is planned to be included in V16.

PR Close #47988
2022-12-13 16:57:46 -08:00
Andrew Scott
cf7e4e47fc docs: Add doc page for 'textAttributeNotBinding' extended diagnostic (#48307)
Adds documentation page for `textAttributeNotBinding` extended diagnostic.

fixes #48291

PR Close #48307
2022-12-13 16:56:06 -08:00
Bob Watson
f6ac94c81c docs: edit suggestion to meet style guide (#47979)
PR Close #47979
2022-12-13 14:47:32 -08:00
lsst25
005e2ba57a docs: add a link to hierarchical-dependency-injection (#47979)
It is not clear that when we provide a service to some eagerly loaded module of an application, then that service is available for components of all eagerly loaded modules of that application. It would be better to give a link for more information at least.
PR Close #47979
2022-12-13 14:47:32 -08:00
Andrew Scott
ff84c73603 docs(core): Document invalid multi token (#48267)
Add error page for invalid multi token runtime error

PR Close #48267
2022-12-13 14:05:59 -08:00
Matthieu Riegler
279e7d4465 refactor: cleanup polyfills by importing zone.js directly in angular.json (#48380)
Since v15, polyfills can be passed directly into angular.json. Let's use this opportunity to reduce the number of unecessary files.

PR Close #48380
2022-12-13 13:37:08 -08:00
Angular Robot
d7038475ed build: update eslint dependencies to v5.46.1 (#48464)
See associated pull request for more information.

PR Close #48464
2022-12-13 13:25:00 -08:00
Lukas Matta
2e65a2bd84 fix(devtools): Replace material imports and styles (#48420)
In the #48216 Material deps were updated to v15,
but the components and modules in DevTools were not
updated to MDC nor replaced with the legacy definitions.

PR Close #48420
2022-12-13 13:22:25 -08:00
piyush132000
b05113c621 docs: updated docs removed unnecessary imports and empty methods (#48429)
Removed empty methods and unnecessary imports in files

PR Close #48429
2022-12-13 13:14:35 -08:00
BrowserPerson
2cd76e053f docs: add maria korneeva to GDE resources (#48468)
PR Close #48468
2022-12-13 13:14:06 -08:00
Angular Robot
7dda19b3f4 docs: update events (#48474)
Generated `events.json` with the latest events retrieved from the Firebase DB.

PR Close #48474
2022-12-13 13:13:16 -08:00
Andrew Scott
f58ad86e51 feat(router): Add feature provider for enabling hash navigation (#48301)
The argument against this feature:

Firstly, this isn't a navigation strategy that's very commonly desired.
Secondly, the hash strategy is a location configuration in `@angular/common`
and you can use it outside of the Router or with any custom router implementations.
So while the net effect of using the router is that it updates the URL which is
controlled by the strategy, this feature provider doesn't necessarily need to
exist in the Router. The location strategy is an application-wide configuration
and affects anything that imports `Location`.  Of course, the Router does this
in a few places but plenty of other things might as well.

The argument for this feature:

* Discoverability. While `LocationStrategy` is technically in `@angular/common`, the most
  common use-case _is_ when using it with the Router.
* Precedence in the `RouterModule.forRoot([], {useHash: true})`
* Precedence in other routing libraries (`createWebHashHistory` in VueJS
  and `HashRouter` in React, for example)
* The implementation of `withHashLocation` is much more clear than
  `useHash` was. You can look at the function and see that all it's
  doing is adding the `HashLocationStrategy` to the providers list.

resolves #48295 / #47986

PR Close #48301
2022-12-13 08:28:38 -08:00
why520crazy
abd11a6ae9 docs: add docgeni to tooling of resources list (#48061)
PR Close #48061
2022-12-12 16:26:26 -08:00
Jessica Janiuk
e0d62cb734 Revert "fix(common): Update Location to get a normalized URL valid in case a represented URL starts with the substring equals APP_BASE_HREF" (#48461)
This reverts commit ae0efb6a09.

PR Close #48461
2022-12-12 16:18:46 -08:00
dario-piotrowicz
c86484507f fix(animations): fix incorrect handling of camel-case css properties (#48436)
fix the issue of camel-case properties not being handled correctly in
state transition causing them not to be applied to the element

resolves #48246

PR Close #48436
2022-12-12 15:17:44 -08:00
Angular Robot
0b75afe9bb docs: update events (#48170)
Generated `events.json` with the latest events retrieved from the Firebase DB.

PR Close #48170
2022-12-12 15:03:04 -08:00
Yannick Baron
b39cfdd993 docs: add yannick baron to list of aio GDEs (#48390)
PR Close #48390
2022-12-12 15:01:59 -08:00
Aristeidis Bampakos
5bc502fa2c docs: modify directive composition API guide (#48439)
Add a minor change to indicate the difference from applying a directive in the template.

PR Close #48439
2022-12-12 14:58:17 -08:00
Aristeidis Bampakos
6dd7575d74 docs: fix typo in search keywords guide (#48442)
PR Close #48442
2022-12-12 14:19:58 -08:00
Aristeidis Bampakos
cc5b044cbf docs: fix typos in reviewing content guide (#48441)
PR Close #48441
2022-12-12 14:05:36 -08:00
Aristeidis Bampakos
bf91f8e8b9 docs: fix style in contributors overview guide (#48440)
PR Close #48440
2022-12-12 14:05:00 -08:00
Bob Watson
febfa15c2f docs: make "app" a suggested replacement for "application" (#48456)
This commit accommodates the recent terminology preference change
from "application" to "app" when describing what an Angular
project produces. For now, using "application" is not a blocker, but
writers should be aware of the change in terminology.

PR Close #48456
2022-12-12 13:49:06 -08:00
Bob Watson
53ab2cf867 docs: remove spell checker from vale testing until vale bug is resolved (#48456)
With vale 2.21, the spell checker style stopped working.

This commit removes the spell checker from the list of styles to allow Vale to
be used, minus the spell checker, until the bug is resolved or a workaround
can be applied.

PR Close #48456
2022-12-12 13:49:06 -08:00
Bob Watson
a6d953e145 docs: move tour of heroes tutorial to a subdirectory (#48162)
This commit prepares the documentation directories for future tutorials organized by directory.

Also, it moves the Angular Libraries topic from the Tutorials section to Developer Guides in TOC

PR Close #48162
2022-12-12 12:07:46 -08:00
Andrew Scott
e362214924 fix(common): Fix TestBed.overrideProvider type to include multi (#48424)
TestBed.overrideProvider should include `multi` support in its type. The
underlying implementation already supports it, as documented by the
tests which are currently casting the override to `any` to get around
the bad type.

PR Close #48424
2022-12-12 09:40:22 -08:00
piyush132000
10b1c2d1a6 docs: updated docs removed unnecessary imports and empty methods (#48428)
Removed empty methods and unnecessary imports in files

PR Close #48428
2022-12-12 09:39:22 -08:00
Konstantin Kharitonov
d87285c363 fix(common): Update Location to get a normalized URL valid in case a represented URL starts with the substring equals APP_BASE_HREF (#48394)
```ts
@NgModule({
  imports: [RouterModule.forRoot([{path: '/enigma', component: EnigmaComponent}])],
  providers: [{provide: APP_BASE_HREF, useValue: '/en'}]
})
export class AppModule {}
```

Navigating to `/enigma` will redirect to `/en/igma` not to `/en/enigma` as it expects

Fixes: #45744

PR Close #48394
2022-12-12 09:37:35 -08:00
Andrew Scott
caa1ad000e docs(router): Update ROUTES docs to not point to provideRoutes (#48417)
provideRoutes is deprecated in favor of the ROUTES token directly
for complex situations where it's necessary.

fixes #48411

PR Close #48417
2022-12-12 09:36:38 -08:00
Bob Watson
b5bb4c17d0 docs: update of landing page and backup pages (#47047)
Updates the angular.io landing page with new messaging
and new images. The Quick-start app has been updated
to demonstrate a minimalist Angular app and the value
proposition content has been updated.

PR Close #47047
2022-12-09 16:04:34 -08:00
Virginia Dooley
4d2bac51c2 docs: Document extracted from the original Introduction document, which is to be retired. (#47913)
docs: add to pullapprove

PR Close #47913
2022-12-09 15:06:50 -08:00
Virginia Dooley
528cc457c6 docs: Document extracted from the original Introduction document, which is to be retired. Linting suggested corrections made. Restructuring or rewording sentences to be shorter and clearer. (#47909)
docs: add to pullapprove

PR Close #47909
2022-12-09 14:59:58 -08:00