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

feat: ability to use manual script injection in hooks #89

Merged
merged 7 commits into from
Nov 19, 2024

Conversation

fnimick
Copy link
Contributor

@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

🦋 Changeset detected

Latest commit: feef749

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
mode-watcher Minor
mode-watcher-docs Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another 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 feef749

fnimick added 2 commits July 29, 2024 11:33
- 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
Contributor 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.

@fnimick
Copy link
Contributor Author

fnimick commented Oct 24, 2024

Any updates or anything I can do to move this along?

Copy link
Member

@huntabyte huntabyte left a comment

Choose a reason for hiding this comment

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

Thanks a ton for your contributions!

@huntabyte huntabyte changed the title Add ability to generate script source for manual script injection in hooks feat: ability to use manual script injection in hooks Nov 19, 2024
@huntabyte huntabyte merged commit 271a593 into svecosystem:main Nov 19, 2024
4 checks passed
@fnimick fnimick deleted the update-head-script-injection branch November 19, 2024 16:44
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