Subpath exports for filters + widgets; build tooling#368
Merged
Conversation
Resolves the stacked-PR squash cascade: #367 (the filter toolkit) landed on v2.0-dev as a squash, conflicting with this branch's copy of the same work. Kept this branch's evolution (filters moved to the /filters subpath, custom-component data→value fix) and pulled in the two late-#367 doc edits that weren't here yet (filters/README live-demo link, _glob.ts glob-rules comment). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Bundle size impact
|
| Format | Base raw | PR raw | Δ raw | Base gzip | PR gzip | Δ gzip |
|---|---|---|---|---|---|---|
| esm | 13.74 KB | 12.24 KB | 🟢 -1.50 KB (-10.91%) | 4.67 KB | 4.14 KB | 🟢 -534 B (-11.18%) |
| cjs | 14.44 KB | 12.89 KB | 🟢 -1.55 KB (-10.71%) | 4.53 KB | 4.02 KB | 🟢 -525 B (-11.32%) |
@json-edit-react/utils
| Format | Base raw | PR raw | Δ raw | Base gzip | PR gzip | Δ gzip |
|---|---|---|---|---|---|---|
| esm | 6.37 KB | 3.37 KB | 🟢 -3.00 KB (-47.15%) | 2.69 KB | 1.49 KB | 🟢 -1.20 KB (-44.66%) |
| cjs | 6.54 KB | 3.46 KB | 🟢 -3.08 KB (-47.10%) | 2.66 KB | 1.47 KB | 🟢 -1.18 KB (-44.55%) |
Measured from build/index.{cjs,esm}.js. Gzip at level 9.
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.
Reorganises two public-API surfaces onto their own subpaths, plus minor build/demo tweaks.
@json-edit-react/utils/filters— the filter toolkit moves off the package root so its generic builder names (and,or,not,root, …) don't crowd it.@json-edit-react/components/widgets— the editor-slot widgets (ReactSelect,CodeEditor) move off the root; they replace JsonEditor'sSelect/TextEditorcontrols rather than render a node type, so the root barrel stays uniformly custom-node definitions.Each subpath is wired in three places: package
exports(+typesVersionsfallback), a second rollupjsBundle/dtsBundlepair, and the demo's Vite alias.Also:
build-allscript (pnpm -r build).buildmode reads core's rawbuild/instead of thebuild_package/publish-staging dir.@codemirror/state/@codemirror/view(same mechanism as the existing react dedupe).data→valuedestructure in three demo custom-component displays.Tests green (618), demo typechecks clean.