Repository navigation
Major Changes
-
713a3c4: Support Solid 2.0 and rewrite the compiler on Oxc.
solid-labelsnow targets Solid 2.0. The peer dependencies aresolid-js@^2.0.0and@solidjs/web@^2.0.0, andunplugin-solid-labelsrequires the matchingsolid-labelsmajor. Solid 1 users stay on the previous major:solid-labels@0.17andunplugin-solid-labels@0.17, maintained on the0.xbranch.The Babel-based compiler is replaced with
oxc-parser(native parsing) and
magic-string(span-based output): untouched code keeps its formatting and
source maps are high-resolution. Thesolid-labels/babelentry is gone;
plugins consumesolid-labels/compiler, whosecompile(id, code, options)
takes the same arguments as before. It returnsnullwhen the file has
nothing to compile, and the plugin then keeps the original code and map.Breaking changes:
- Labels (
signal: x = 0) and comment pragmas (/* @signal */) are
removed. Compile-time functions are the single remaining syntax, and
disabled.label/disabled.pragmaplugin options are gone. - CTF names follow Solid 2.0 keywords strictly:
$settled(onSettled),
$snapshot(snapshot),$merge,$omit. The$mountand$unwrap
aliases are removed. - CTFs whose underlying 1.x API no longer exists are removed:
$batch,
$computed,$resource,$selector,$on,$observable,
$error,$catchError,$startTransition,$useTransition,
$indexArray,$mutable,$produce. - The
Dynamicauto-import and<solid:dynamic>are removed, because Solid
2.0 deprecatesDynamic. Usedynamic()from@solidjs/web. - An unknown
solid:element name is a compile error. It used to pass through
as an intrinsic element. $effect,$renderEffect, and the$(expr);statement compile through a
new capture mechanism: outer identifiers used by the callback are read in a
generated tracked compute phase and passed to the untracked callback as a
destructured array; the callback is hoisted to module level when safe.$signaladopts the memoized signal convention: non-static initializers
compile to the writable-derived formcreateSignal(() => expr).- The
vite-plugin-solid-labelsandrollup-plugin-solid-labelspackages
are discontinued. Useunplugin-solid-labelsinstead. It serves Vite and
Rollup throughsolidLabels.vite(options)andsolidLabels.rollup(options)
with the same options.
New CTFs for the Solid 2.0 surface:
$flush,$action,
$isPending,$latest,$refresh,$affects,$resolve,$repeat,
$projection,$optimistic,$optimisticStore,$snapshot,$deep,
$until,$from,$deferred,$onFlush,$observer,$isDisposed,
$isWrappable,$flatten,$useHead,$clientOnly,$lazyModule, plus the
Repeat,Errored,Loading,Reveal, andHydrationcomponents.$deferredreturns with a new meaning. In 1.x it lagged a sync signal and took
timeoutMs. In 2.0 it wraps an async computation, andtimeoutMsis removed.See
docs/migration.mdfor the full migration guide. - Labels (
Patch Changes
- c547e45: Match module ids that carry a query against
filterby their file path. SolidStart loads route files asroutes/index.tsx?pick=..., so the defaultsrc/**filter skipped them and their compile-time functions were left uncompiled. - Updated dependencies [713a3c4]
- Updated dependencies [8fa4b58]
- Updated dependencies [509d0f2]
- solid-labels@1.0.0