This repository was archived by the owner on Mar 24, 2026. It is now read-only.
fix ssr for sl-alert and scrollend-polyfill#2359
Merged
claviska merged 7 commits intoshoelace-style:nextfrom Feb 3, 2025
Merged
fix ssr for sl-alert and scrollend-polyfill#2359claviska merged 7 commits intoshoelace-style:nextfrom
claviska merged 7 commits intoshoelace-style:nextfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Member
|
Thanks for submitting this! Looks great. |
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.
Hello Shoelace team!
We are currently in the works of creating an SSR compatible version of our own fork of Shoelace, Synergy. It works pretty well, but we stumbled upon two issues, preventing it to work in Angular SSR environments:
<sl-alert>component does automatically create the toast stack when imported, leading to errors in SSR environments becausedocument.createElementis always fired.scrollend-polyfilldirectly checks for'scrollend' in windowwhen it is included. This prevents the use of<sl-tab-group>in SSR environments.We already patched this in our alert and polyfill implementation, but wanted to mirror this back for everyone that might be interested.
That said, as we have not tested SSR in Vanilla environments, but only in framework based ones (e.g. https://github.com/synergy-design-system/ssr-demos/tree/main/packages/angular gives a good demo with our findings).
The changes are really simple ones and, for
<sl-alert>, also have the benefit that the stack is only created when thetoastmethod is called at all.Hope this may prove helpful for the community, also regarding the discussion in #1641.
We would also loved to have provided this for Webawesome, but as I see, you seem to have completely got rid of
<sl-alert>in favor of<wa-callout>which comes without the original toast stack functionality. Just out of curiosity, what where the reasons for this change?Closes #2358