Skip to content

Commit

Permalink
Merge branch 'main' into fix/preact-signals
Browse files Browse the repository at this point in the history
closes #7864
  • Loading branch information
ph1p committed Aug 25, 2024
2 parents b9fa93a + 6fcaab8 commit b5adf3f
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/fuzzy-falcons-tan.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'astro': patch
---

Marks internal `vite-plugin-fileurl` plugin with `enforce: 'pre'`
2 changes: 1 addition & 1 deletion packages/astro/src/core/create-vite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ export async function createVite(
astroPrefetch({ settings }),
astroTransitions({ settings }),
astroDevToolbar({ settings, logger }),
vitePluginFileURL({}),
vitePluginFileURL(),
astroInternationalization({ settings }),
settings.config.experimental.serverIslands && vitePluginServerIslands({ settings }),
astroContainer(),
Expand Down
3 changes: 2 additions & 1 deletion packages/astro/src/vite-plugin-fileurl/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import type { Plugin as VitePlugin } from 'vite';

export default function vitePluginFileURL({}): VitePlugin {
export default function vitePluginFileURL(): VitePlugin {
return {
name: 'astro:vite-plugin-file-url',
enforce: 'pre',
resolveId(source, importer) {
if (source.startsWith('file://')) {
const rest = source.slice(7);
Expand Down
2 changes: 1 addition & 1 deletion packages/integrations/preact/src/signals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ export function serializeSignals(
props[key] = props[key].map((v: SignalLike, i: number) =>
i === index ? [signal.peek(), i] : v,
);

map.set(key, [...((map.get(key) || []) as []), [signal, index]]);

signals[key] = [...((signals[key] || []) as []), [getSignalId(ctx, signal), index]];
}
});
Expand Down

0 comments on commit b5adf3f

Please sign in to comment.