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

Add ability to generate script source for manual script injection in hooks #89

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

fnimick
Copy link

@fnimick fnimick commented Jul 29, 2024

Adds a new function to return the script source, for manual injection into a <script> tag using a hook, as described in sveltejs/kit#10377 (comment)

Adds a new prop to disable head script addition at the component level, if you are using the above function for manual injection.

Also updates setInitialMode to correctly use configured local storage keys.

Copy link

changeset-bot bot commented Jul 29, 2024

⚠️ No Changeset found

Latest commit: a9991c4

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@fnimick fnimick changed the title Add new ability to generate script source for manual script injection in hooks Add ability to generate script source for manual script injection in hooks Jul 29, 2024
Copy link
Contributor

github-actions bot commented Jul 29, 2024

built with Refined Cloudflare Pages Action

⚡ Cloudflare Pages Deployment

Name Status Preview Last Commit
mode-watcher ✅ Ready (View Log) Visit Preview a9991c4

- adds a new function to generate the script source for manual injection
using a hook
- adds a new prop `disableHeadScriptInjection` to disable script
addition from the rendered component
@fnimick fnimick force-pushed the update-head-script-injection branch from ef36566 to 576551a Compare July 29, 2024 15:35
@fnimick
Copy link
Author

fnimick commented Aug 5, 2024

is there anything I should do to have this considered?

@huntabyte
Copy link
Member

Hey there @fnimick, thanks for this! I need to investigate why the contents of the <script> aren't being minified. I must have introduced a regression in a previous release as at one point it was being minified.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants