Minor Changes
-
Export
useInsertionEffectfrom@lynx-js/react/compat, currently an alias ofuseEffect. (#3784) -
Export
usefrom@lynx-js/react/compat. (#3672) -
Upgrade the bundled Preact fork to Preact 11 (
@lynx-js/internal-preact(#3450)
based on11.0.0-rc.1).Breaking:
useEffectcleanups of unmounted components no longer run
synchronously during unmount. They run in the after-paint flush instead,
matching React. This applies touseLayoutEffecttoo, which ReactLynx
exports as an alias ofuseEffect. Page destroy is unaffected — it drains
them synchronously, so cleanups that release native resources still run
before the runtime goes away. Code that assumed a cleanup had already run
right after a re-render removed the component needs to await a flush;
ReactLynx does not currently export a hook whose cleanup stays inside the
unmount commit.Other runtime-visible changes:
- Context consumers no longer double-render on provider updates
(preactjs/preact#4724), so fewerrLynxChangeflushes are emitted and
patches merge into the first flush. - List reorders use Preact 11's longest-increasing-subsequence diff, which
may pick an equivalent-but-different minimal set of moves.
- Context consumers no longer double-render on provider updates
Patch Changes
-
Reach lynx-core's app object through
lynx.getApp()instead of the (#3553)
lynxCoreInjectglobal the AMD wrapper injects. It is the same instance, so
behavior is unchanged, and resolving it throughlynxalso stays correct once
several cards share a runtime chunk.@lynx-js/testing-environmentnow exposes
lynx.getApp()alongside the object it already provided. -
Move runtime attribute-name configuration to the page-scoped
lynxobject and (#3718)
inject it from the host compilation through a standalone webpack plugin. Lazy
and external bundles reuse the host-injected configuration without applying
the plugin themselves. The runtime-config webpack plugin is published through
its own DSL-neutral package entry and accepts arbitrary runtime configuration
keys without depending on ReactLynx. The merged top-level configuration is
shallow-frozen to prevent accidental mutation after host initialization. -
Keep
refin props for function components on the main thread, matching the background thread. (#3688) -
Update
swc_coreto 77 in the transform. (#3793)