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

Hoist Astro.globbed hoisted scripts in dev #3930

Merged
merged 5 commits into from
Jul 18, 2022
Merged

Hoist Astro.globbed hoisted scripts in dev #3930

merged 5 commits into from
Jul 18, 2022

Conversation

matthewp
Copy link
Contributor

Changes

  • This uses the Vite graph to discover scripts that need to be hoisted, similar to how we do so for styles.
  • Previously was using the Astro metadata hoistedScriptPaths() method, but this does not traverse through Astro.globs, or through JS re-export pattern. Using the Vite graph ensures we get all hoisted scripts.
  • This is how it's done in the build as well.
  • Bug reported on Discord: https://discord.com/channels/830184174198718474/996921397978857522

Testing

  • Test added

Docs

N/A, bug fix

@changeset-bot
Copy link

changeset-bot bot commented Jul 14, 2022

🦋 Changeset detected

Latest commit: 276ebb3

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

This PR includes changesets to release 9 packages
Name Type
astro Patch
@e2e/astro-component Patch
@e2e/lit-component Patch
@e2e/preact-component Patch
@e2e/react-component Patch
@e2e/solid-component Patch
@e2e/svelte-component Patch
@e2e/e2e-tailwindcss Patch
@e2e/ts-resolution 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

@github-actions github-actions bot added the pkg: astro Related to the core `astro` package (scope) label Jul 14, 2022
@matthewp
Copy link
Contributor Author

Holding off on merging since this is a biggish change to dev.

Copy link
Member

@natemoo-re natemoo-re left a comment

Choose a reason for hiding this comment

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

LGTM once we're ready to merge this next week!

@natemoo-re natemoo-re linked an issue Jul 15, 2022 that may be closed by this pull request
1 task
@matthewp matthewp merged commit 3acb9ec into main Jul 18, 2022
@matthewp matthewp deleted the hoist-glob branch July 18, 2022 15:33
@astrobot-houston astrobot-houston mentioned this pull request Jul 18, 2022
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.

🐛 BUG: Hoisted scripts not working with Astro.glob in dev
2 participants