Skip to content

Auto-detect playground dependency subpaths (playground 0.3.13) - #612

Merged
titouanmathis merged 3 commits into
mainfrom
chore/playground-0.3.12
Aug 6, 2026
Merged

Auto-detect playground dependency subpaths (playground 0.3.13)#612
titouanmathis merged 3 commits into
mainfrom
chore/playground-0.3.12

Conversation

@titouanmathis

Copy link
Copy Markdown
Contributor

What

Bump @studiometa/playground 0.3.11 → 0.3.12 and replace the hand-rolled packageDeps() loop in packages/playground/meta.config.js with the preset's new subpaths: true option.

Why

0.3.12 adds two related features:

  • entries multi-entry builds (playground#74) — all subpaths of a workspace package build together in one code-split tsdown build, so modules shared between entries are emitted once as a shared chunk and referenced by every entry. That means the barrel (@studiometa/ui), a direct subpath (@studiometa/ui/Accordion) and the ./manifest lazy imports all resolve to the same chunk URL — a single runtime instance, eliminating the singleton/identity hazard of the previous per-subpath builds.
  • subpaths: true auto-detection (playground#75) — derives those entries from the package's package.json exports map, so nothing is hardcoded and the config tracks the source automatically.

Result — verified against a local build

  • @studiometa/ui: 95 entries derived (barrel + ./manifest + every component subpath) → 189 import-map keys (extensionless + .js aliases).
  • @studiometa/ui-mapbox: barrel + ./manifest.
  • @studiometa/ui-autoload: barrel + ./ui + ./ui-mapbox.
  • Singleton confirmed: index.js (barrel), Accordion.js (subpath) and manifest.js's lazy import("./Accordion.js") all reference the single shared chunk Accordion-<hash>.js — only one Accordion chunk exists.
  • Same-origin .d.ts wired via _headers (x-typescript-types) for the barrel and every subpath.
  • Zero references to cdn.studiometa.dev in the bundled deps.
  • Playground build compiles successfully.

Net effect: any @studiometa/ui/<Component> import now works in the editor from local source while developing new components, with correct types and no duplicated component classes.

🤖 Generated with Claude Code

Bump @studiometa/playground to 0.3.12 and replace the hand-rolled `packageDeps`
loop with the preset's `subpaths: true` option. It reads each workspace
package's `package.json` `exports` map and builds every subpath as an entry of
ONE code-split tsdown build, so modules shared between entries — a component
class referenced by the barrel, its own `@studiometa/ui/<Component>` subpath and
the `./manifest` lazy imports — are emitted once as a shared chunk and
referenced by every entry. That gives a single runtime instance and removes the
singleton/identity hazard of bundling each subpath separately.

The playground now resolves every ui / ui-mapbox / ui-autoload subpath from
local source with same-origin declarations, so any `@studiometa/ui/<Component>`
import works in the editor while developing new components.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014FQxYGj2RqgcP8BkubpiNu
@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown

Code Review

Risk: Low — The change is safe to merge based on the reviewed diff; no concrete defects were identified.

Replaces the manual workspace dependency-entry generation with subpaths: true for the three local playground packages. It also upgrades @studiometa/playground and @studiometa/js-toolkit to the versions described in the commits.


Review usage: 7,126 in (3,677 cached) / 334 out tokens — $0.0033 (openrouter/openai/gpt-5.6-luna, thinking: low)

Reviewed by @weareikko/code-review v0.9.5 for commit 7058587.

Previous review runs

Previous run archived 2026-08-06T08:50:17Z

Code Review

Risk: Low — The configuration now relies on @studiometa/playground 0.3.13 to auto-detect workspace package subpaths and build them together, with the dependency version updated accordingly. No concrete defects are evident in the reviewed diff.


Review usage: 6,963 in (3,677 cached) / 246 out tokens — $0.0030 (openrouter/openai/gpt-5.6-luna, thinking: low)

Reviewed by @weareikko/code-review v0.9.5 for commit ef914b8.

Previous run archived 2026-08-06T08:29:53Z

Code Review

Risk: Low — The playground dependency configuration now relies on @studiometa/playground 0.3.12 to auto-detect workspace package subpaths and build them together; no blocking defect is evident in the reviewed diff.

The hand-rolled exports parsing and per-subpath dependency generation were replaced with subpaths: true for the three local workspace packages. The playground package dependency was updated to require the new preset version.

Notes:

  • package-lock.json was not reviewed because it was omitted from the diff.

Review usage: 22,204 in (18,105 cached) / 370 out tokens — $0.0046 (openrouter/openai/gpt-5.6-luna, thinking: low)

Reviewed by @weareikko/code-review v0.9.5 for commit 434c367.

@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown

CDN asset preview

This pull request's build is published as the immutable channel pr-612-705858782960.

Declarative autoloader

Import a @studiometa/ui-autoload entry to mount that package's components from their data-component (declare eager ones with <meta name="studiometa-ui:eager" content="Action, …">; import both to load from one shared loader):

<script type="module" src="https://cdn.studiometa.dev/ui-autoload@pr-612-705858782960/ui.js"></script>
<script type="module" src="https://cdn.studiometa.dev/ui-autoload@pr-612-705858782960/ui-mapbox.js"></script>

Manual ESM imports

Each package surface at its pinned URL:

import { Base, createApp } from "https://cdn.studiometa.dev/js-toolkit@3.8.0/index.js";
import { Action } from "https://cdn.studiometa.dev/ui@pr-612-705858782960/index.js";
import { MapboxMap } from "https://cdn.studiometa.dev/ui-mapbox@pr-612-705858782960/index.js";
import { autoload, composeManifests } from "https://cdn.studiometa.dev/ui-autoload@pr-612-705858782960/index.js";

Component manifests

Each package exposes its own manifest (composed at runtime by the autoloader):

import { manifest as ui } from "https://cdn.studiometa.dev/ui@pr-612-705858782960/manifest.js";
import { manifest as uiMapbox } from "https://cdn.studiometa.dev/ui-mapbox@pr-612-705858782960/manifest.js";

It is pruned from the index automatically when the PR closes.

@codecov

codecov Bot commented Aug 6, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.50%. Comparing base (23367b9) to head (7058587).

Additional details and impacted files
@@            Coverage Diff            @@
##               main     #612   +/-   ##
=========================================
  Coverage     87.50%   87.50%           
  Complexity      145      145           
=========================================
  Files           147      147           
  Lines          5324     5324           
  Branches       1010     1010           
=========================================
  Hits           4659     4659           
  Misses          583      583           
  Partials         82       82           
Flag Coverage Δ
unittests 87.50% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown

Export Size

Unchanged

@studiometa/ui

Name Size Diff
AbstractCarouselChild 754 B -
AbstractCarouselComponent 162 B -
AbstractFrameTrigger 1.75 kB -
AbstractPrefetch 373 B -
AbstractScrollAnimation 3.88 kB -
AbstractSliderChild 706 B -
Accordion 1.78 kB -
AccordionItem 1.66 kB -
Action 1.11 kB -
AnchorNav 3.88 kB -
AnchorNavLink 3.77 kB -
AnchorNavTarget 124 B -
AnchorScrollTo 2.57 kB -
animationScrollWithEase 763 B -
Carousel 4.09 kB -
CarouselBtn 905 B -
CarouselDrag 711 B -
CarouselItem 959 B -
CarouselWrapper 595 B -
CircularMarquee 511 B -
ClickOutside 162 B -
Cursor 652 B -
DataBind 3.63 kB -
DataComputed 3.71 kB -
DataEffect 3.7 kB -
DataModel 3.75 kB -
DataScope 1.36 kB -
Dialog 2.44 kB -
Disclosure 2.89 kB -
DisclosureGroup 1.07 kB -
Draggable 1.61 kB -
Fetch 2.4 kB -
FetchShopifyPartial 2.85 kB -
FetchShopifySection 2.63 kB -
Figure 1.82 kB -
FigureShopify 2.09 kB -
FigureTwicpics 2.36 kB -
FigureVideo 1.99 kB -
FigureVideoTwicpics 2.56 kB -
Frame 3.48 kB -
FrameAnchor 1.84 kB -
FrameForm 1.96 kB -
FrameLoader 1.45 kB -
FrameTarget 1.76 kB -
FrameTriggerLoader 1.47 kB -
Hoverable 910 B -
Indexable 1.02 kB -
InView 158 B -
InViewOnce 203 B -
LargeText 682 B -
LazyInclude 331 B -
Menu 2.33 kB -
MenuBtn 143 B -
MenuList 1.91 kB -
Modal 2.12 kB -
ModalWithTransition 2.24 kB -
Panel 2.52 kB -
PrefetchWhenOver 419 B -
PrefetchWhenVisible 428 B -
ScrollAnimation 4 kB -
ScrollAnimationChild 4.13 kB -
ScrollAnimationChildWithEase 4.73 kB -
ScrollAnimationParent 4.19 kB -
ScrollAnimationTarget 4.07 kB -
ScrollAnimationTimeline 4.12 kB -
ScrollAnimationWithEase 4.61 kB -
ScrollReveal 1.64 kB -
Sentinel 127 B -
Slider 3.65 kB -
SliderBtn 929 B -
SliderCount 757 B -
SliderDots 1.98 kB -
SliderDrag 272 B -
SliderItem 965 B -
SliderProgress 1.06 kB -
Sticky 776 B -
Tabs 1.38 kB -
Target 90 B -
Timer 500 B -
TimerProgress 628 B -
Toast 855 B -
Toaster 1.17 kB -
Track 1.65 kB -
TrackContext 342 B -
TrackShopify 1.73 kB -
Transition 1.42 kB -
viewTransition 295 B -
ViewTransition 740 B -
withDeprecation 199 B -
withIndex 968 B -
withScrollAnimationDebug 2.03 kB -
withTransition 1.39 kB -

@studiometa/ui-mapbox

Name Size Diff
AbstractMapboxControl 925 B -
AbstractMapboxMapChild 739 B -
MAPBOX_CLUSTER_CONNECTED 73 B -
MAPBOX_MAP_CONNECTED 99 B -
MapboxCluster 2 kB -
MapboxClusterItem 521 B -
MapboxFullscreenControl 1.05 kB -
MapboxGeocoder 1.11 kB -
MapboxGeolocateControl 1.1 kB -
MapboxImage 1.25 kB -
MapboxImages 1.29 kB -
MapboxLayer 1.25 kB -
MapboxMap 663 B -
MapboxMarker 999 B -
MapboxNavigationControl 1.07 kB -
MapboxPopup 1.07 kB -
MapboxSource 1.25 kB -
provideMapboxGeocoder 68 B -
provideMapboxGl 65 B -
resolveMapboxGeocoder 134 B -
resolveMapboxGl 128 B -
StoreLocator 1.86 kB -

@studiometa/ui-autoload

Name Size Diff
autoload 2.09 kB -
ComponentLoader 2 kB -
composeManifests 100 B -
DEFAULT_DIAGNOSTIC_PREFIX 94 B -
IDLE_TIMEOUT 84 B -
readEagerTokens 188 B -
registerManifest 2.6 kB -
VISIBLE_ROOT_MARGIN 87 B -

0.3.13 rewrites relative `.js` imports to `.d.ts` inside the emitted
declaration chunks of self-hosted dependencies. rolldown-plugin-dts wrote
cross-chunk type imports with a `.js` extension, but declaration chunks are
content-hashed independently from the JS chunks, so `./X-<hash>.js` never
existed for types (only `./X-<hash>.d.ts` did) — the editor LSP fetched the
dead URL and type resolution broke for every code-split subpath. Verified in
the playground build: all 145 cross-chunk `.d.ts` imports now point at existing
`.d.ts` files (0 dead `.js` type-imports), while the JS shared-chunk singleton
is unchanged.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014FQxYGj2RqgcP8BkubpiNu
@titouanmathis titouanmathis changed the title Auto-detect playground dependency subpaths (playground 0.3.12) Auto-detect playground dependency subpaths (playground 0.3.13) Aug 6, 2026
@titouanmathis

Copy link
Copy Markdown
Contributor Author

Bumped to @studiometa/playground@0.3.13, which fixes type resolution for code-split subpaths (declaration chunks were importing a dead .js URL instead of the content-hashed .d.ts). Verified in the playground build: all 145 cross-chunk .d.ts imports now resolve to existing .d.ts files (0 dead .js type-imports), and the JS shared-chunk singleton is unchanged.

Align the playground's `@studiometa/js-toolkit` dev dependency with the latest
patch release so the local tsdown builds of the workspace packages resolve the
same version consumers get from esm.sh. Playground build verified green.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014FQxYGj2RqgcP8BkubpiNu
@titouanmathis
titouanmathis merged commit 4deb81f into main Aug 6, 2026
24 checks passed
@titouanmathis
titouanmathis deleted the chore/playground-0.3.12 branch August 10, 2026 11:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant