From 0fa28fa4d1acb66e862f93a5798271403a40c586 Mon Sep 17 00:00:00 2001 From: Matthew Phillips Date: Fri, 28 Apr 2023 13:23:10 -0400 Subject: [PATCH 1/3] Update Solid ecosystem package logic to include packages with peerDep of Solid --- .changeset/purple-lamps-sleep.md | 5 +++++ packages/integrations/solid/src/dependencies.ts | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/purple-lamps-sleep.md diff --git a/.changeset/purple-lamps-sleep.md b/.changeset/purple-lamps-sleep.md new file mode 100644 index 000000000000..63f532cca9da --- /dev/null +++ b/.changeset/purple-lamps-sleep.md @@ -0,0 +1,5 @@ +--- +"@astrojs/solid-js": patch +--- + +Update Solid ecosystem package logic to include packages with peerDep of Solid diff --git a/packages/integrations/solid/src/dependencies.ts b/packages/integrations/solid/src/dependencies.ts index ebe5e2a0a481..115090848802 100644 --- a/packages/integrations/solid/src/dependencies.ts +++ b/packages/integrations/solid/src/dependencies.ts @@ -8,7 +8,7 @@ export async function getSolidPkgsConfig(isBuild: boolean, astroConfig: AstroCon isBuild, viteUserConfig: astroConfig.vite, isFrameworkPkgByJson(pkgJson) { - return containsSolidField(pkgJson.exports || {}); + return containsSolidField(pkgJson.exports || {}) || !!(pkgJson.peerDependencies || {})['solid-js']; }, }); } From ed04e62f874705655a335e0f74ba754375ebea5b Mon Sep 17 00:00:00 2001 From: Matthew Phillips Date: Mon, 1 May 2023 12:44:03 -0400 Subject: [PATCH 2/3] Remove solid as a noExternal --- packages/integrations/solid/src/dependencies.ts | 2 +- packages/integrations/solid/src/index.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/integrations/solid/src/dependencies.ts b/packages/integrations/solid/src/dependencies.ts index 115090848802..ebe5e2a0a481 100644 --- a/packages/integrations/solid/src/dependencies.ts +++ b/packages/integrations/solid/src/dependencies.ts @@ -8,7 +8,7 @@ export async function getSolidPkgsConfig(isBuild: boolean, astroConfig: AstroCon isBuild, viteUserConfig: astroConfig.vite, isFrameworkPkgByJson(pkgJson) { - return containsSolidField(pkgJson.exports || {}) || !!(pkgJson.peerDependencies || {})['solid-js']; + return containsSolidField(pkgJson.exports || {}); }, }); } diff --git a/packages/integrations/solid/src/index.ts b/packages/integrations/solid/src/index.ts index edf58fdeae16..8ec9f4d8d0d6 100644 --- a/packages/integrations/solid/src/index.ts +++ b/packages/integrations/solid/src/index.ts @@ -47,7 +47,7 @@ async function getViteConfiguration(isDev: boolean, astroConfig: AstroConfig) { ssr: { target: 'node', external: ['babel-preset-solid', ...solidPkgsConfig.ssr.external], - noExternal: ['solid-js', ...solidPkgsConfig.ssr.noExternal], + noExternal: [...solidPkgsConfig.ssr.noExternal], }, }; } From 80d447f9e87e7abc6bc950cc43eeb876620b4592 Mon Sep 17 00:00:00 2001 From: Matthew Phillips Date: Tue, 2 May 2023 12:01:57 -0400 Subject: [PATCH 3/3] Update the changeset --- .changeset/purple-lamps-sleep.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/purple-lamps-sleep.md b/.changeset/purple-lamps-sleep.md index 63f532cca9da..9dd063e6aa73 100644 --- a/.changeset/purple-lamps-sleep.md +++ b/.changeset/purple-lamps-sleep.md @@ -2,4 +2,4 @@ "@astrojs/solid-js": patch --- -Update Solid ecosystem package logic to include packages with peerDep of Solid +Allow Solid ecosystem packages to not need special export map configuration. By default Solid is now treated as an external package in SSR, so any other dependent packages will receive the same instance.