Patch Changes
-
Support
cloneElementfor more ReactLynx snapshot scenarios, including compiled snapshots, runtime-created snapshots, and repeated clones. (#2857)Cloning compiled snapshots still cannot replace children and will warn in that case. Use components or runtime-created snapshots when clone-time children replacement is needed.
-
Preserve list item platform info on background-thread snapshots for hydrate (#2904)
diffing. -
Support enabling preact devtools in production via the
REACT_DEVTOOLenvironment variable. (#2880)By default
@lynx-js/preact-devtoolsis aliased away in production builds. Setting theREACT_DEVTOOLenvironment variable now:- keeps a user-imported
@lynx-js/preact-devtoolsfrom being stripped; - defines
__REACT_DEVTOOL__, which gates the dev-only runtime hooks devtools depends on (such asinjectLepusMethods) so they also run in production; - keeps function/class names during minification (
keep_fnames/keep_classnames), which devtools needs to resolve component names (type.name) and to reconstruct the hook tree (it matches minified stack frames by function name).
@lynx-js/react/debugremains development-only. - keeps a user-imported