Minor Changes
-
feat: export
GlobalPropsProvider,GlobalPropsConsumer,useGlobalPropsanduseGlobalPropsChangedfor__globalProps(#2346)GlobalPropsProvider: A Provider component that acceptschildren. It is used to provide thelynx.__globalPropscontext.GlobalPropsConsumer: A Consumer component that accepts a function as a child. It is used to consume thelynx.__globalPropscontext.useGlobalProps: A hook that returns thelynx.__globalPropsobject. It triggers a re-render whenlynx.__globalPropschanges.useGlobalPropsChanged: A hook that accepts a callback function. The callback is invoked whenlynx.__globalPropschanges.
Note: When
globalPropsModeis not set to'event'(default is'reactive'), these APIs will be ineffective (pass-through) and will log a warning in development mode, as updates are triggered automatically by full re-render. -
BREAKING CHANGE: (#2319)
Change preact package from
@hongzhiyuan/preactto@lynx-js/internal-preact.Upgrade preact from f7693b72 to 55254ef7, see diffs at f7693b72...55254ef7.
-
feat: add
globalPropsModeoption toPluginReactLynxOptions(#2346)- When configured to
"event",updateGlobalPropswill only trigger a global event and skip therunWithForceflow. - Defaults to
"reactive", which meansupdateGlobalPropswill trigger re-render automatically.
- When configured to
Patch Changes
-
Add
__BACKGROUND__guard ononBackgroundSnapshotInstanceUpdateIdevent to prevent bundling to main-thread on dev environment. (#2332) -
refactor: extract static string in template literal (#2334)
-
fix: avoid crash when spread undefined ref (#2333)
-
Avoid registering lifecycle refs for main-thread functions (MTF) that have not received an
execIdduringrenderPage()first-screen binding. (#2320)