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

Support solidjs libraries #5059

Merged
merged 9 commits into from
Oct 12, 2022
Merged

Support solidjs libraries #5059

merged 9 commits into from
Oct 12, 2022

Conversation

bluwy
Copy link
Member

@bluwy bluwy commented Oct 12, 2022

Changes

Fix #4871

  • Auto add solidjs deps to ssr.noExternal same as vite-plugin-solid
  • Support __astro_tag_component__ in node_modules, since it imports astro/server/index.js in node_modules (doesn't work in pnpm). This PR pre-resolve astro/server/index.js to an absolute path.

Testing

Added @solidjs/router to test, which previously would error the app entirely.

Docs

Not sure if we should document the noExternal behaviour, it might be an implementation detail we want to hide.

@changeset-bot
Copy link

changeset-bot bot commented Oct 12, 2022

🦋 Changeset detected

Latest commit: d8994c5

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

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 pkg: astro Related to the core `astro` package (scope) pkg: solid Related to Solid (scope) pkg: integration Related to any renderer integration (scope) labels Oct 12, 2022
@bluwy bluwy changed the title Fix solid library Support solidjs libraries Oct 12, 2022
}
const require = createRequire(pkgPath);
const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf-8'));
const deps = [...Object.keys(pkg.dependencies || {}), ...Object.keys(pkg.devDependencies || {})];
Copy link
Contributor

Choose a reason for hiding this comment

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

should this include peerDependencies?

Copy link
Member Author

Choose a reason for hiding this comment

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

This part scans for the root project package.json, so I'm not sure if peerDependencies would make sense here 🤔

Copy link
Contributor

@matthewp matthewp left a comment

Choose a reason for hiding this comment

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

lgtm, just needs to have the lockfile updated

@bluwy bluwy merged commit f7fcdfe into main Oct 12, 2022
@bluwy bluwy deleted the fix-solid-library branch October 12, 2022 13:29
@astrobot-houston astrobot-houston mentioned this pull request Oct 12, 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) pkg: integration Related to any renderer integration (scope) pkg: solid Related to Solid (scope)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

@solid-js/router working in build and preview but not in dev
2 participants