Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix script injection during build #12392

Merged
merged 16 commits into from
Nov 14, 2024
Merged

Conversation

apatel369
Copy link
Contributor

@apatel369 apatel369 commented Nov 7, 2024

Changes

Closes #12171
This pull request addresses issue #12171 where shared entrypoints in injectRoute() remove client-side scripts in SSR builds. The changes ensure that client-side scripts are correctly included for all routes using the same entrypoint.

Testing

added tests

Docs

Internal bug fix so docs update not needed

@github-actions github-actions bot added the pkg: astro Related to the core `astro` package (scope) label Nov 7, 2024
@ematipico
Copy link
Member

Should we add new tests?

@apatel369
Copy link
Contributor Author

apatel369 commented Nov 7, 2024 via email

@apatel369
Copy link
Contributor Author

Should we add new tests?

Added. Thanks for your patience. Let me know if any changes are needed.

.changeset/slimy-pets-lick.md Outdated Show resolved Hide resolved
value: id,
};
}
for (const pageData of getPageDatasByHoistedScriptId(internals, facadeId)) {
Copy link
Member

Choose a reason for hiding this comment

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

As you noticed from the Github bot comments, settings isn't used anymore, so we can remove it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed. Thanks.

@apatel369 apatel369 changed the title Fix script handling in injectRoute shared entrypoint during SSR Fix script injection during build Nov 12, 2024
@ematipico
Copy link
Member

@apatel369 the build is failing, can you please fix it?

@apatel369
Copy link
Contributor Author

@apatel369 the build is failing, can you please fix it?

Fixed.

@ematipico ematipico merged commit 0462219 into withastro:main Nov 14, 2024
12 of 14 checks passed
@astrobot-houston astrobot-houston mentioned this pull request Nov 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: astro Related to the core `astro` package (scope)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Shared entrypoint in injectRoute() Removes Client-Side Scripts in SSR Build
2 participants