Repository navigation
feat: add development diagnostics with separate development and production builds - #236
Merged
Merged
Conversation
…ction builds Warnings, only in the development build: a signal written or an effect created while a computed is evaluating (agera), a lifecycle listener on a signal that is not mountable (agera), a missing dehydrated value (store), a cache key parameter that serializes to null and a shard registered twice (query), a path built without a required parameter (router), a missing message and a parameter without a value (intl). `inject` outside of an injection context and `DependencyNotFound` keep their full messages in development only. The diagnostics sit behind `import.meta.env.DEV`. agera, kida, store, query, router and intl now build twice into `dist/index.development.js` and `dist/index.production.js`, and `exports` selects them through the `development` and `production` conditions, `default` is production. size-limit measures the production build, kida and store define the flag for the workspace sources they bundle.
dangreen
force-pushed
the
feat/devtools-event
branch
from
September 7, 2026 13:37
7bd7abf to
4319790
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #236 +/- ##
==========================================
+ Coverage 82.75% 82.85% +0.10%
==========================================
Files 98 98
Lines 2465 2497 +32
Branches 521 533 +12
==========================================
+ Hits 2040 2069 +29
Misses 315 315
- Partials 110 113 +3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…s example integration builds The integration mode compiles the package sources through `transpilePackages`. Their `import.meta.env.DEV` is typed by the root declaration the examples do not see, and webpack turns `import.meta.env` into `undefined` in the server build, so prerendering failed. Skip the type check like the other example builds and define the flag as `false`, the production value.
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.
What
Development-only diagnostics across the core packages, delivered through a development build that sits next to the production build.
Warnings,
console.warn, development build only:StaticHydratorfinds no dehydrated value for a key.null); a shard name registered twice.paramsplaceholder whose value isundefined.kida's
injectkeeps its "outside of injection context" check in development only, production falls through to theTypeErrorfromcontext.get.DependencyNotFoundcarries the full message in development and the token name in production.How
import.meta.env.DEV, which Vite replaces statically in library mode. agera, kida, store, query, router and intl build twice,NODE_ENV=developmentandNODE_ENV=production, intodist/index.development.jsanddist/index.production.js. This mirrors the setup kida had before feat(nanoviews,kida): migrate kida and nanoviews to agera #52.publishConfig.exportsgained thedevelopmentandproductionconditions,defaultis production. Vite and webpack pick by mode, bare Node, Bun, esbuild and Rollup get production,node -C developmentopts in. Nonodecondition: the old one mapped Node to the development build.mainafter minification. Verified through Vite, webpack, esbuild and Rollup.vite-env.d.tsincluded throughfilesin the roottsconfig.json, so dependent packages compiling these sources seeimport.meta.env.dist/index.production.js. kida and store moved to.size-limit.jswithmodifyEsbuildConfigdefiningimport.meta.env.DEVasfalse: size-limit resolves workspace dependencies to TypeScript sources, where esbuild cannot fold the flag. The other packages keep JSON, size-limit ignores their peers.../agera/dist/index.production.js.NANO_KIT_DEV) compiles the package sources throughtranspilePackages: it now skips the type check like the other example builds and definesimport.meta.env.DEVasfalsethroughDefinePlugin, webpack turnedimport.meta.envintoundefinedin the server build otherwise.Sizes
Production limits are back at the
mainvalues in every package. kida and store lost theinjectmessage: All publics 4.7 → 4.65 kB and 5.95 → 5.9 kB Brotli.Tests
New cases for every warning in agera, query, store and intl, and for the router path builder. The agera case for a write inside a notified effect guards the
'compute' in activeSubdiscriminator:notify()clearsWatchingFlagon a queued effect, so the flag cannot tell a computed from an effect.