fix(platform-server): insert transfer state script before other script tags#48868
Closed
alan-agius4 wants to merge 1 commit intoangular:mainfrom
Closed
fix(platform-server): insert transfer state script before other script tags#48868alan-agius4 wants to merge 1 commit intoangular:mainfrom
script before other script tags#48868alan-agius4 wants to merge 1 commit intoangular:mainfrom
Conversation
…ript` tags
Previously, the state `script` was always appended as the last item in the `body` tag. This can result in the state not being available when the Angular application is bootstrap.
A workaround for this was to delay the bootstrapping of the application until by using the `DOMContentLoaded` event listener.
```ts
const bootstrap = () => platformBrowserDynamic().bootstrapModule(AppModule);
document.addEventListener('DOMContentLoaded', bootstrap);
```
With this change the above workaround is no longer necessary as the state `script` tag is now added prior of any other `script` which guarantees that the state is present prior of the Angular application is bootstrapped.
0edf5cd to
de67fc1
Compare
Contributor
Author
AndrewKushnir
approved these changes
Jan 27, 2023
Contributor
AndrewKushnir
left a comment
There was a problem hiding this comment.
@alan-agius4 looks great, thanks for the fix 👍
angular-robot bot
pushed a commit
that referenced
this pull request
Jan 31, 2023
…ript` tags (#48868) Previously, the state `script` was always appended as the last item in the `body` tag. This can result in the state not being available when the Angular application is bootstrap. A workaround for this was to delay the bootstrapping of the application until by using the `DOMContentLoaded` event listener. ```ts const bootstrap = () => platformBrowserDynamic().bootstrapModule(AppModule); document.addEventListener('DOMContentLoaded', bootstrap); ``` With this change the above workaround is no longer necessary as the state `script` tag is now added prior of any other `script` which guarantees that the state is present prior of the Angular application is bootstrapped. PR Close #48868
trekladyone
pushed a commit
to trekladyone/angular
that referenced
this pull request
Feb 1, 2023
…ript` tags (angular#48868) Previously, the state `script` was always appended as the last item in the `body` tag. This can result in the state not being available when the Angular application is bootstrap. A workaround for this was to delay the bootstrapping of the application until by using the `DOMContentLoaded` event listener. ```ts const bootstrap = () => platformBrowserDynamic().bootstrapModule(AppModule); document.addEventListener('DOMContentLoaded', bootstrap); ``` With this change the above workaround is no longer necessary as the state `script` tag is now added prior of any other `script` which guarantees that the state is present prior of the Angular application is bootstrapped. PR Close angular#48868
crapStone
pushed a commit
to Calciumdibromid/CaBr2
that referenced
this pull request
Feb 3, 2023
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [@angular/animations](https://github.com/angular/angular) | dependencies | patch | [`15.1.2` -> `15.1.3`](https://renovatebot.com/diffs/npm/@angular%2fanimations/15.1.2/15.1.3) | | [@angular/common](https://github.com/angular/angular) | dependencies | patch | [`15.1.2` -> `15.1.3`](https://renovatebot.com/diffs/npm/@angular%2fcommon/15.1.2/15.1.3) | | [@angular/compiler](https://github.com/angular/angular) | dependencies | patch | [`15.1.2` -> `15.1.3`](https://renovatebot.com/diffs/npm/@angular%2fcompiler/15.1.2/15.1.3) | | [@angular/compiler-cli](https://github.com/angular/angular/tree/main/packages/compiler-cli) ([source](https://github.com/angular/angular)) | devDependencies | patch | [`15.1.2` -> `15.1.3`](https://renovatebot.com/diffs/npm/@angular%2fcompiler-cli/15.1.2/15.1.3) | | [@angular/core](https://github.com/angular/angular) | dependencies | patch | [`15.1.2` -> `15.1.3`](https://renovatebot.com/diffs/npm/@angular%2fcore/15.1.2/15.1.3) | | [@angular/forms](https://github.com/angular/angular) | dependencies | patch | [`15.1.2` -> `15.1.3`](https://renovatebot.com/diffs/npm/@angular%2fforms/15.1.2/15.1.3) | | [@angular/platform-browser](https://github.com/angular/angular) | dependencies | patch | [`15.1.2` -> `15.1.3`](https://renovatebot.com/diffs/npm/@angular%2fplatform-browser/15.1.2/15.1.3) | | [@angular/platform-browser-dynamic](https://github.com/angular/angular) | dependencies | patch | [`15.1.2` -> `15.1.3`](https://renovatebot.com/diffs/npm/@angular%2fplatform-browser-dynamic/15.1.2/15.1.3) | --- ### Release Notes <details> <summary>angular/angular</summary> ### [`v15.1.3`](https://github.com/angular/angular/blob/HEAD/CHANGELOG.md#​1513-2023-02-02) [Compare Source](angular/angular@15.1.2...15.1.3) ##### animations | Commit | Type | Description | | -- | -- | -- | | [d36dfd4b62](angular/angular@d36dfd4) | fix | fix non-animatable warnings for easing ([#​48583](angular/angular#48583)) | ##### common | Commit | Type | Description | | -- | -- | -- | | [a334e4efbe](angular/angular@a334e4e) | fix | warn if using ngSrcset without a configured image loader ([#​48804](angular/angular#48804)) | ##### compiler | Commit | Type | Description | | -- | -- | -- | | [171b4d4640](angular/angular@171b4d4) | fix | incorrect code when non-null assertion is used after a safe access ([#​48801](angular/angular#48801)) | ##### migrations | Commit | Type | Description | | -- | -- | -- | | [9e86dd231b](angular/angular@9e86dd2) | fix | Fixed file format issue with lint ([#​48859](angular/angular#48859)) | | [af31f98b00](angular/angular@af31f98) | fix | migration host incorrectly reading empty files ([#​48849](angular/angular#48849)) | ##### platform-server | Commit | Type | Description | | -- | -- | -- | | [73972c684e](angular/angular@73972c6) | fix | insert transfer state `script` before other `script` tags ([#​48868](angular/angular#48868)) | ##### router | Commit | Type | Description | | -- | -- | -- | | [d5b2c249a3](angular/angular@d5b2c24) | fix | Handle routerLink directive on svg anchors. ([#​48857](angular/angular#48857)) | #### Special Thanks Alan Agius, Besim Gürbüz, Brecht Billiet, Dario Piotrowicz, Dylan Hunn, Iván Navarro, Jessica Janiuk, Kristiyan Kostadinov, Matthieu Riegler, Onkar Ruikar, Payam Valadkhan, Santosh Yadav, Virginia Dooley and Walid Bouguima <!-- CHANGELOG SPLIT MARKER --> </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about these updates again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNC4xMTkuMiIsInVwZGF0ZWRJblZlciI6IjM0LjEyMC4wIn0=--> Co-authored-by: cabr2-bot <cabr2.help@gmail.com> Reviewed-on: https://codeberg.org/Calciumdibromid/CaBr2/pulls/1769 Reviewed-by: Epsilon_02 <epsilon_02@noreply.codeberg.org> Co-authored-by: Calciumdibromid Bot <cabr2_bot@noreply.codeberg.org> Co-committed-by: Calciumdibromid Bot <cabr2_bot@noreply.codeberg.org>
alan-agius4
added a commit
to alan-agius4/angular-cli
that referenced
this pull request
Feb 6, 2023
…chematic The bootstrapping wrapping is no longer neccesry as of 15.1.3. See: angular/angular#48868
alan-agius4
added a commit
to alan-agius4/angular-cli
that referenced
this pull request
Feb 6, 2023
…schematic The bootstrapping wrapping is no longer necessary as of 15.1.3. See: angular/angular#48868
alan-agius4
added a commit
to alan-agius4/angular-cli
that referenced
this pull request
Feb 6, 2023
…schematic The bootstrapping wrapping is no longer necessary as of 15.1.3. See: angular/angular#48868
angular-robot bot
pushed a commit
to angular/angular-cli
that referenced
this pull request
Feb 7, 2023
…schematic The bootstrapping wrapping is no longer necessary as of 15.1.3. See: angular/angular#48868
angular-robot bot
pushed a commit
to angular/angular-cli
that referenced
this pull request
Feb 7, 2023
…schematic The bootstrapping wrapping is no longer necessary as of 15.1.3. See: angular/angular#48868 (cherry picked from commit 88fddc0)
alan-agius4
added a commit
to alan-agius4/angular
that referenced
this pull request
Feb 17, 2023
…ther `script` tags (angular#48868)" This reverts commit 2fc5b70 as this change is no longer needed since `type=module` script are deferred by default. Which causes the transfer data to be queried after the browser has finished parsing the DOM.
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Previously, the state
scriptwas always appended as the last item in thebodytag. This can result in the state not being available when the Angular application is bootstrap. A workaround for this was to delay the bootstrapping of the application until by using theDOMContentLoadedevent listener.With this change the above workaround is no longer necessary as the state
scripttag is now added prior of any otherscriptwhich guarantees that the state is present prior of the Angular application is bootstrapped.