Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/astro-devtools/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@
"vite-plus": "catalog:"
},
"peerDependencies": {
"@vitejs/devtools": "^0.7.5",
"@vitejs/devtools-kit": "^0.7.5",
"@vitejs/devtools": "^0.7.6",
"@vitejs/devtools-kit": "^0.7.6",
"astro": "^7.0.0"
}
}
14 changes: 0 additions & 14 deletions packages/astro-devtools/src/vite-plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,20 +52,6 @@ export function astroDevtoolsVitePlugin(store: AstroDevtoolsStore): PluginWithDe
},
devtools: {
setup(context) {
// The docks below point their renderer at the bare specifier
// "astro-devtools/client", which Vite resolves through `/@id/` — but it
// only says so in `initHub()`, after this hook, so each registration
// warns DF8111 ("the script will fail to load") about scripts that load
// fine. Writing Vite's own value first silences that; `initHub()` then
// rewrites it identically. Drop it once DevTools (0.7.5 today)
// advertises it earlier.
if (context.viteServer && !context.staticConfig.dock?.clientModuleResolution) {
context.staticConfig.dock = {
...context.staticConfig.dock,
clientModuleResolution: "/@id/{specifier}",
};
}

for (const [defaultOrder, entry] of PANEL_ENTRIES.entries()) {
context.docks.register({
id: entry.id,
Expand Down
6 changes: 5 additions & 1 deletion playground/e2e/server.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@ test("the dev server serves the standalone DevTools UI at /__devtools/", async (
expect(await res.text()).toContain("Devframes");
});

test("the integration advertises Vite client-module resolution before registering dock scripts", async () => {
// The Astro docks name their renderer by the bare specifier
// "astro-devtools/client". Vite DevTools 0.7.6+ (the peer floor) declares the
// `/@id/` resolution that loads it before any plugin's setup runs, so the
// registrations raise no DF8111 ("the script will fail to load").
test("the dev server registers the Astro dock scripts without a DF8111 warning", async () => {
expect(await readFile(serverLogPath, "utf8")).not.toContain("[DF8111]");
});

Expand Down
Loading
Loading