Repository navigation
fix(devtools): depend on the stable nanoviews and keep the panel off with a production core - #304
Merged
Merged
Conversation
…with a production core The 2.0.0 panel pinned a nanoviews prerelease that brings its own kida prerelease, so an app got a second kida and its build failed on the missing `text` export. `nanoviews` and the `@nanoviews/*` packages are taken at `^1.0.0` now. With a production core, as in a production build that calls `devtools()` unguarded, the page hung: such a core marks no node of the panel, `onSignal` handed the registry every node the panel created for its records, and the panel recorded itself without end. `devtools()` now checks that the core marks a node created inside `uninspected`, and otherwise warns and stays off.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #304 +/- ##
=======================================
Coverage 83.62% 83.62%
=======================================
Files 228 228
Lines 4849 4849
Branches 1074 1074
=======================================
Hits 4055 4055
Misses 553 553
Partials 241 241 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
@nano_kit/devtools@2.0.0cannot be used outside this repository. It pinsnanoviews@1.0.0-prerelease.20260923175652, which pinskida@2.0.0-prerelease.20260919114914, so an app with@nano_kit/store@2.0.0installs a second kida, and a Vite build fails right away:"text" is not exported by "node_modules/nanoviews/dist/store.js", since that kida prerelease still named the template tagf. The workspace never shows it: its overrides hand nanoviews the workspace kida.Once the build passes, a second problem shows:
devtools()against a production core hangs the page, as in a production build that calls it unguarded.onSignalfires in every build, while the mark that keeps the nodes of the panel out,UninspectedModeset insideuninspected, exists in the development build of the core alone. With a production core every signal the panel creates for its records comes back throughonSignalas a node of the application, the registry records it, and the microtasks never end.What
nanoviews,@nanoviews/storybook,@nanoviews/storybook-viteand@nanoviews/testing-libraryat^1.0.0. The stable nanoviews depends onkida ^2.0.0, so an app gets one kida. The lockfile holds onlynanoviews@1.0.0, and kida and agera stay linked to the workspace.devtools()first creates a signal insideuninspectedand checks that the core marked it. A production core does not: the function warns thatdevtools()belongs to development, with thedevelopmentcondition resolved, and returns, so the panel stays off instead of recording itself.onSignalstays as it is in the core:@nano_kit/svelteneeds it in production.pnpm-workspace.yamlno longer speaks of kida snapshots.Size
dist/index.jsgrows by 288 B raw and 110 B gzip against the published 2.0.0, the warning mostly. A call behindimport.meta.env.DEV, as the README shows, still ships nothing: the production bundle of the probe app is 5.16 kB with no code of the panel.Notes
@nano_kit/store@2.0.0from npm, Vite 8.2.1 and no overrides: one kida; invite devthe panel mounts with no errors; in a production build an unguarded call warns and the page stays responsive; a guarded call leaves nothing of the panel in the bundle.tsc, the 249 specs and the build of devtools pass, and so doesstorybook:buildon the@nanoviews/*1.0.0 packages. The entry has no spec: it imports the styles that only the library build makes.overrides("nanoviews": "^1.0.0").