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 @nanostores/preact to ALWAYS_NOEXTERNAL #3667

Merged
merged 3 commits into from
Jun 22, 2022

Conversation

bholmesdev
Copy link
Contributor

@bholmesdev bholmesdev commented Jun 21, 2022

Changes

Adds @nanostores/preact to the dreaded ALWAYS_NOEXTERNAL list.

It seems noExternal is required for any utility package relying on Preact hooks. From testing, this is likely due to a duplicate Preact getting bundled when used in a component, with a separate Preact coming from your node_modules inside the offending package.

Why not @nanostores/react?

React is a UMD package, while Preact is a true ESM package. This means React will always be bundled due to Vite's heuristics, while Preact will be ignored. This is why resolve.dedupe does not solve the issue for Preact 😓

Testing

N/A, though a "nanostores" E2E test suite is on my list!

Docs

N/A

@changeset-bot
Copy link

changeset-bot bot commented Jun 21, 2022

🦋 Changeset detected

Latest commit: 556017e

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

This PR includes changesets to release 1 package
Name Type
astro 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

@bholmesdev bholmesdev changed the title chore: add nanostores/preact to ALWAYS_NOEXTERNAL Add @nanostores/preact to ALWAYS_NOEXTERNAL Jun 21, 2022
@github-actions github-actions bot added the pkg: astro Related to the core `astro` package (scope) label Jun 21, 2022
@bholmesdev bholmesdev force-pushed the chore/add-nanostores-to-always-no-external branch from cbefaf2 to 556017e Compare June 22, 2022 15:03
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!

@bholmesdev bholmesdev merged commit df02fad into main Jun 22, 2022
@bholmesdev bholmesdev deleted the chore/add-nanostores-to-always-no-external branch June 22, 2022 15:39
@github-actions github-actions bot mentioned this pull request Jun 22, 2022
SiriousHunter pushed a commit to SiriousHunter/astro that referenced this pull request Feb 3, 2023
* chore: add nanostores/preact to ALWAYS_NOEXTERNAL

* chore: update comment to reference pR

* chore: changeset
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.

2 participants