Visitar URL original
feat(@schematics/angular): augment `universal` schematics to import `platform-server` shims by gkalpak · Pull Request #19869 · angular/angular-cli · GitHub
The Wayback Machine - https://web.archive.org/web/20260524141321/https://github.com/angular/angular-cli/pull/19869
Skip to content

feat(@schematics/angular): augment universal schematics to import platform-server shims#19869

Merged
alan-agius4 merged 1 commit into
angular:masterfrom
gkalpak:feat-universal-shims
Feb 18, 2021
Merged

feat(@schematics/angular): augment universal schematics to import platform-server shims#19869
alan-agius4 merged 1 commit into
angular:masterfrom
gkalpak:feat-universal-shims

Conversation

@gkalpak
Copy link
Copy Markdown
Member

@gkalpak gkalpak commented Jan 25, 2021

In angular/angular#40559, a new @angular/platform-server/shims entry-point was introduced, which can be used to shim the server environment with APIs normally provided by the browser (such as DOM globals).

If the project is using a version of Angular (and thus @angular/platform-server) that is known to include this new entry-point, the newly generated main.server.ts file should import it at the top in order to ensure that the shims will be available as soon as possible (before other direct or transitive imports that may rely on them). See also angular/angular#40559 for more details.

NOTE:
This universal schematic is the base for app-shell, @nguniversal/express-engine and @nguniversal/hapi-engine.

@gkalpak gkalpak added type: bug/fix area: @schematics/angular action: review The PR is still awaiting reviews from at least one requested reviewer target: patch This PR is targeted for the next patch release state: blocked on upstream labels Jan 25, 2021
@google-cla google-cla Bot added the cla: yes label Jan 25, 2021
@gkalpak
Copy link
Copy Markdown
Member Author

gkalpak commented Jan 25, 2021

This should probably wait for angular/angular#40559 to be merged and included in a release, but I created it early to discuss/get some guidance on what else I might need to change.

Comment thread packages/schematics/angular/universal/index.ts Outdated
@gkalpak gkalpak force-pushed the feat-universal-shims branch 2 times, most recently from c96ad79 to 4283f5d Compare February 12, 2021 17:55
@alan-agius4 alan-agius4 added target: major This PR is targeted for the next major release and removed target: patch This PR is targeted for the next patch release state: blocked on upstream labels Feb 12, 2021
@gkalpak gkalpak force-pushed the feat-universal-shims branch 2 times, most recently from 0a63e10 to 24787c3 Compare February 17, 2021 17:58
…platform-server` shims

In angular/angular#40559, a new `@angular/platform-server/init`
entry-point was introduced, which can be used to initialize the server
environment by providing shims for APIs normally provided by the browser
(such as DOM globals).

If the project is using a version of Angular (and thus
`@angular/platform-server`) that is known to include this new
entry-point, the newly generated `main.server.ts` file should import it
at the top in order to ensure that the shims will be available as soon
as possible (before other direct or transitive imports that may rely on
them). See also angular/angular#40559 for more details.

NOTE:
This `universal` schematic is the base for `app-shell`,
`@nguniversal/express-engine` and `@nguniversal/hapi-engine`.

Fixes angular/angular#40559
@gkalpak gkalpak force-pushed the feat-universal-shims branch from 24787c3 to 38b42c2 Compare February 17, 2021 21:33
@gkalpak gkalpak marked this pull request as ready for review February 17, 2021 22:13
@gkalpak gkalpak requested a review from alan-agius4 February 17, 2021 22:16
Copy link
Copy Markdown
Collaborator

@alan-agius4 alan-agius4 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks LGTM

@alan-agius4 alan-agius4 added action: merge The PR is ready for merge by the caretaker and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Feb 18, 2021
@alan-agius4 alan-agius4 merged commit 1199205 into angular:master Feb 18, 2021
@gkalpak gkalpak deleted the feat-universal-shims branch February 18, 2021 18:41
@angular-automatic-lock-bot
Copy link
Copy Markdown

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot Bot locked and limited conversation to collaborators Mar 21, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: merge The PR is ready for merge by the caretaker area: @schematics/angular target: major This PR is targeted for the next major release type: bug/fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants