# @lynx-js/web-core

## 0.26.1

### Patch Changes

- Fix page child events being dispatched as component events by registering the page element unique ID in the Web host. ([#3842](https://github.com/lynx-family/lynx-stack/pull/3842))

- Support `enableCSSInheritance` for text inside views, including gradient text colors, in client rendering and SSR. ([#3907](https://github.com/lynx-family/lynx-stack/pull/3907))
- Updated dependencies [[`8321c8f`](https://github.com/lynx-family/lynx-stack/commit/8321c8f58346223d33130ca342686adc92a0fd35), [`8419cb6`](https://github.com/lynx-family/lynx-stack/commit/8419cb6becd191cd49acb092507eeee7b77b3fcd)]:
  - @lynx-js/web-elements@0.12.11
  - @lynx-js/web-worker-rpc@0.26.1

## 0.26.0

### Minor Changes

- Add an opt-in `@lynx-js/web-core/animax` side-effect entry that loads `@lynx-js/animax` on the Web platform. ([#3602](https://github.com/lynx-family/lynx-stack/pull/3602))

- Parse single-file Lynx XML with the current Vanilla Lynx `engine-version` and ([#3628](https://github.com/lynx-family/lynx-stack/pull/3628))
  `thread="main"` / `thread="background"` syntax, and reject the legacy wrapper
  syntax.
- Support a view-scoped `console` in background bundles through the ([#3648](https://github.com/lynx-family/lynx-stack/pull/3648))
  `LynxConsoleModule` native module.

### Patch Changes

- Support legacy XElement component names in Lynx for Web element creation, SSR, and CSS selectors. ([#3734](https://github.com/lynx-family/lynx-stack/pull/3734))

- Defer callbacks registered through `__AddEventListener` by one microtask. ([#3643](https://github.com/lynx-family/lynx-stack/pull/3643))

- Render main-only Lynx XML cards without requesting a missing `app-service.js` ([#3717](https://github.com/lynx-family/lynx-stack/pull/3717))
  by registering an empty background entry when the optional background script
  is omitted.
- Add an optional `scroll-view` mouse-drag plugin for touchscreen-like scrolling ([#3594](https://github.com/lynx-family/lynx-stack/pull/3594))
  on desktop browsers. Enable it by importing
  `@lynx-js/web-core/plugins/scroll-view-mouse-drag` or
  `@lynx-js/web-elements/plugins/scroll-view-mouse-drag` before registering the
  web elements.
- Support the `bindselectionchange` event on `text` and `inline-text` in Lynx for Web. ([#3741](https://github.com/lynx-family/lynx-stack/pull/3741))

- Allow Lynx-for-Web pages that use `main-thread:gesture` to render by providing no-op gesture detector element APIs. ([#3743](https://github.com/lynx-family/lynx-stack/pull/3743))
- Updated dependencies [[`f256648`](https://github.com/lynx-family/lynx-stack/commit/f256648ae74cf5070c914b2a1cd38d98a7e8feea), [`b2a8367`](https://github.com/lynx-family/lynx-stack/commit/b2a8367e4ec481f7cf026f902fb049fc1caf04ed), [`4d81264`](https://github.com/lynx-family/lynx-stack/commit/4d812643c39bd5cc48bd6e9fdbacc6d06a051a4a)]:
  - @lynx-js/web-elements@0.12.10
  - @lynx-js/web-worker-rpc@0.26.0

## 0.25.0

### Minor Changes

- Support `lynx.createIntersectionObserver` in Lynx for Web. ([#3383](https://github.com/lynx-family/lynx-stack/pull/3383))

- Load a hand-written Lynx XML markup card in the browser, by compiling it into a ([#3404](https://github.com/lynx-family/lynx-stack/pull/3404))
  `.web.bundle` there and then loading that.

  A markup card is not a kind of artifact. The decode worker already dispatches on
  the eight header bytes it reads - `{` for a `.json` template, the magic header for
  a bundle - and a markup card is what neither of those claims, so it costs the two
  shapes that stream nothing to reach. From there it is handed to `encodeLynxXML`,
  the same function `@lynx-js/web-core/encode` gives a build, which returns real
  bundle bytes: magic header, version, and the five sections in the encoder's order.
  Those bytes go straight back to `handleStream`, so every section is read by the
  reader that already existed. There is no markup decoding anywhere - not in the
  worker, not on the main thread - and a markup card is not merely equivalent to a
  built card, it _is_ one by the time anything decodes it.

  Compiling in the browser is what #3589 made possible: `binary/encode`'s glue used
  to load its wasm through `node:fs`, and is now generated with
  `wasm-bindgen --target bundler`, which a bundler resolves on either platform.

  **What this costs, measured**

  Both sides rebuilt from source - `npm run build:wasm` then `rsbuild build`, with
  `--force` so neither figure is a cache replay - because `binary/` is gitignored
  and survives `git switch`, which has produced wrong numbers here before. Raw /
  `gzip -9`.

  | artifact                            | `origin/main`    | this change      | delta         |
  | ----------------------------------- | ---------------- | ---------------- | ------------- |
  | `binary/client/client_bg.wasm`      | 227,536 / 82,883 | _byte-identical_ | 0             |
  | `binary/client_legacy/…_bg.wasm`    | 183,444 / 74,949 | _byte-identical_ | 0             |
  | eager `client.js`                   | 45,287 / 14,388  | _byte-identical_ | 0             |
  | `web-core-main-chunk.js`            | 159,621 / 33,074 | _byte-identical_ | 0             |
  | `web-core-worker-chunk.js`          | 15,135 / 6,001   | _byte-identical_ | 0             |
  | worker chunk (`…-loader-thread.js`) | 33,257 / 9,912   | 34,755 / 10,357  | +1,498 / +445 |
  | `web-core-markup-encoder.js` (new)  | –                | 227,811 / 64,809 | new, lazy     |
  | encode wasm asset (new)             | –                | 167,689 / 55,689 | new, lazy     |

  So a card that was built ahead of time pays **+1,498 B raw / +445 B gzip**, all of
  it in the worker chunk, and nothing at all in the eager entry or the main chunk.
  The four byte-identical rows are sha256 comparisons, not size comparisons.

  The laziness is load bearing rather than tidy: `TemplateManager` requests the
  worker with `webpackPrefetch`, `webpackPreload` and `fetchPriority: "high"`, so a
  static import would eagerly fetch all 395 kB for _every_ card. Verified positively
  and with a negative control on `origin/main`, counting occurrences (a minified
  chunk is one line, so a line count cannot tell 1 from 60):

  | marker                       | eager `client.js` | worker chunk | main chunk | markup chunk |
  | ---------------------------- | ----------------- | ------------ | ---------- | ------------ |
  | encode wasm asset name       | 0                 | 0            | 0          | 1            |
  | `css-tree` token names       | 0 / 0             | 0 / 0        | 0 / 0      | 2 / 2        |
  | the XML parser's own message | 0                 | 0            | 0          | 2            |

  All of these are 0 everywhere on `origin/main`, including in the chunk that does
  not exist there. `encode_legacy_json_generated_raw_style_info` reads 2 in the
  eager entry and 3 in the worker chunk on **both** sides - it is the _client_ wasm's
  own export, used by `cssLoader` for `.json` artifacts, and is not this change.

  Compiling itself is work that moved from a build into the browser, medians of 41
  interleaved rounds: a 72 B stylesheet takes 0.42 ms, 872 B takes 0.89 ms, 9.1 kB
  takes 7.4 ms and 26 kB takes 23.5 ms. Only markup cards pay it.

  **Reviewer decisions this change deliberately leaves open**

  - **`encodeLynxXML` warns on the console unconditionally, and now does so at
    runtime.** It reports each at-rule the Lynx style format cannot carry. That was
    written when the only caller was a build, which has no production runtime to
    stay quiet for; the same code now runs in a browser. It is left exactly as it is
    on `origin/main` so that `ts/encode/` keeps a zero diff, but gating it on a dev
    build, or deduplicating it per at-rule name, are both reasonable and neither is
    done here.
  - **The published tarball grows by 397 kB**, being the new markup chunk plus the
    encode wasm, which rspack now also emits under `dist/client_prod/static/wasm/`.
    That wasm is consequently present three times in the package - there, under
    `dist/encode_prod/static/wasm/` since #3589, and under `binary/encode/`. Nothing
    here makes that worse than the pattern already in place for the client wasm, and
    reclaiming it is a `files` change that would alter what deep importers can
    reach, so it is left out of this change.
  - **If #3390 lands first, the two chunk figures above need re-measuring.** It
    reaches `css-tree` directly where this change reaches it through
    `@lynx-js/css-serializer`; the spec resolves to a single `css-tree@3.2.1`, so
    rspack would either duplicate it into both lazy chunks or hoist it into a shared
    one. Nobody has built the union yet, so no combined figure is quoted here.

  **Other limits worth knowing**

  - `@lynx-js/css-serializer` becomes a real `dependency` rather than the optional
    peer it was. `dist/client` ships as unbundled ESM, so the `import` the compiler
    chunk performs is resolved by the consumer, and an optional peer nobody installs
    would make a markup card fail to load in exactly the packaging that looks fine
    on disk.
  - **A corrupted bundle now reaches the markup path**, because markup is what is
    left when a response is neither a bundle nor JSON. Handing those bytes to the XML
    parser would answer `expected '<lynx version="...">' root element`, which points
    the reader at a markup bug in a file that is not markup, so the two are told
    apart first - before the compiler chunk is even fetched - on whether the content
    begins a tag at all. Bytes that do not keep the diagnosis they always had,
    `Invalid Magic Header`, now carrying the eight header bytes that failed to match;
    a document that does gets the XML parser's own message and offset. A response
    shorter than 8 bytes is still rejected by the header read, exactly as before.
  - `@media`, `@supports` and `@layer` are dropped, as they already were when
    building a markup card into a bundle: Lynx's style format has no rule kind for a
    conditional group, so they are not Lynx features on any platform. Same for
    `@import` with a URL.
  - The `handleMarkup` recursion is one level deep and cannot loop: `encode` writes
    the magic header at offset 0 unconditionally, so the second `handleStream` takes
    the binary branch. Were that untrue, the bytes would fail the "begins a tag"
    check and the recursion would end in a thrown error rather than a cycle.

### Patch Changes

- Build `binary/encode` with `wasm-bindgen --target bundler` and publish `@lynx-js/web-core/encode` as an rslib bundle, so one set of artifacts serves both Node and the browser. ([#3589](https://github.com/lynx-family/lynx-stack/pull/3589))

  **Why**

  `binary/encode` used to be generated with `--target experimental-nodejs-module`, whose glue calls `readFileSync('node:fs')` at module scope. That made `@lynx-js/web-core/encode` importable from Node only. The `bundler` target instead emits an "async wasm module" glue (`import * as wasm from './encode_bg.wasm'`), which a bundler can resolve for either platform.

  **What changed in the published package**

  - `./encode` now resolves to `dist/encode_prod/index.js` (bundled by rslib, like `./server` already was) instead of the unbundled `dist/encode/index.js` emitted by `tsc`. The wasm is emitted as a build asset under `dist/encode_prod/static/wasm/`.
  - Bundling is what keeps the import clean: consuming the `bundler` glue directly from Node would work only on Node 22 or newer, and would print `ExperimentalWarning: Importing WebAssembly module instances` on every build. Letting rslib resolve the wasm at web-core build time avoids both.
  - `encode_bg.wasm` is byte-for-byte unchanged; only the JavaScript glue differs. The `binary/encode/*.d.ts` type declarations are identical under both targets.

  **Compatibility**

  - No API change. `encode()` and `encodeCSS(cssMap): Uint8Array` keep their synchronous signatures. The wasm initialization becomes a single module-level `await` inside the bundle, which is already accommodated by the `await import('@lynx-js/web-core/encode')` that consumers use. Encoded output is byte-identical to the previous release.
  - `@lynx-js/css-serializer` stays an external dependency of the bundle and is not inlined.
  - Note on Node versions: `@lynx-js/web-core/encode` does not work on Node 20 and did not work there before this change either. The `encode` wasm is optimized with `wasm-opt --all-features`, and Node 20's engine rejects it with `CompileError: Unknown heap type -14` regardless of which glue is used. This is a pre-existing limitation that this change neither introduces nor fixes; the effective floor for this entry point is Node 22.
  - The tarball grows by roughly the size of the encode wasm, because `binary/encode/encode_bg.wasm` is still shipped alongside the copy that rslib emits into `dist/encode_prod/`.
- Prevent event dispatch failures from escaping through the WebAssembly boundary. ([#3356](https://github.com/lynx-family/lynx-stack/pull/3356))
- Updated dependencies [[`9c2be3e`](https://github.com/lynx-family/lynx-stack/commit/9c2be3e239daf55f55a1991a9490705aa3587f46), [`d671851`](https://github.com/lynx-family/lynx-stack/commit/d67185113f38514e4946d1fcb295c0c6a36d6783), [`d671851`](https://github.com/lynx-family/lynx-stack/commit/d67185113f38514e4946d1fcb295c0c6a36d6783)]:
  - @lynx-js/css-serializer@0.1.9
  - @lynx-js/web-elements@0.12.9
  - @lynx-js/web-worker-rpc@0.25.0

## 0.24.1

### Patch Changes

- Allow `__FlushElementTree()` to run inside a main-thread event handler without ([#3438](https://github.com/lynx-family/lynx-stack/pull/3438))
  triggering wasm-bindgen's recursive-borrow error or aborting the remaining
  event dispatch.
- Support the `__GetAttributeNames` element PAPI. ([#3291](https://github.com/lynx-family/lynx-stack/pull/3291))

  `ElementNode.getAttributeNames()` of the ReactLynx worklet runtime calls it, so a
  main-thread script reaching that API threw `ReferenceError` on web.
- Updated dependencies [[`948eece`](https://github.com/lynx-family/lynx-stack/commit/948eece02aa9f7051f879a21f6c51d96a99fe1aa), [`f9fdbad`](https://github.com/lynx-family/lynx-stack/commit/f9fdbad607c5c8893d8f6e13c658fd46bbac3aeb), [`6cc9624`](https://github.com/lynx-family/lynx-stack/commit/6cc9624fb54dc7f73b6e68e49e2322b8136d3418), [`6cc9624`](https://github.com/lynx-family/lynx-stack/commit/6cc9624fb54dc7f73b6e68e49e2322b8136d3418)]:
  - @lynx-js/css-serializer@0.1.8
  - @lynx-js/web-elements@0.12.8
  - @lynx-js/web-worker-rpc@0.24.1

## 0.24.0

### Minor Changes

- Add the `__AddEventListener` and `__RemoveEventListener` element PAPIs. ([#3388](https://github.com/lynx-family/lynx-stack/pull/3388))

  These bind a main-thread _function_ as an event listener, as opposed to
  `__AddEvent`, which binds a handler _name_ for cross-thread dispatch or a
  worklet object for main-thread dispatch. Cards that build their UI directly from
  the Element PAPIs need the callback form.

  Callbacks are filed in the element's own handler table, the same one
  `__AddEvent` writes to, so they take part in the engine's event dispatch rather
  than in a second one: capture ordering, `catch` stopping propagation and
  global-bind all behave as they do for handler names, and the two forms can stop
  each other.

  `capture`, `once` and `passive` are honored, `closure_type` and `bind_type`
  select the binding semantics, and a `kClient` binding with a string handler is
  filed as a cross-thread handler. `signal` is accepted for parity with the engine
  PAPI, which also reads it as a boolean, and is otherwise ignored; remove a
  listener with `__RemoveEventListener`. Several callbacks may be registered for
  one element and event, as with `addEventListener`.

- Add `lynx.getEngine()`, the main-thread Engine context proxy. ([#3389](https://github.com/lynx-family/lynx-stack/pull/3389))

  This is the web counterpart of the engine's `kEngine` context proxy. A card
  subscribes to it to receive the engine lifecycle events `__RenderPage`,
  `__UpdatePage`, `__DestroyLifetime` and `__UpdateGlobalProps`, which is how a
  card built directly from the Element PAPIs drives its own first paint, updates
  and cleanup.

  Listeners receive a plain `{ type, data }` object rather than a DOM event,
  matching what the engine hands scripts. For `__RenderPage` and `__UpdatePage`,
  `data` holds the call's positional arguments as an array.

  Existing bundles are unaffected. Each of these events keeps the engine's own
  fallback rule: if the card registered a listener the event is dispatched,
  otherwise the corresponding `globalThis.renderPage` / `updatePage` call happens
  exactly as before. Server-side rendering always reports no listener, so it stays
  on the direct path.

  Card teardown no longer requires a framework lifetime hook. A card that runs its
  own background script never installs `tt.callDestroyLifetimeFun`, and the
  resulting error previously propagated far enough to skip `destroyCard`, leaving
  the card registered after its view was gone. The hook is now optional, while a
  hook that exists and fails is still reported.

- Build a single file Lynx XML markup document into a `.web.bundle`. ([#3402](https://github.com/lynx-family/lynx-stack/pull/3402))

  `@lynx-js/web-core/encode` gains `encodeLynxXML(source)` and `xmlToTasmJSON(source)`,
  which turn a hand-written Lynx XML document - a versioned `<lynx>` root wrapping an
  optional `<style>`, a required `<script main-thread>` and an optional
  `<script background>` - into the same bundle bytes a ReactLynx build produces: same
  magic header, same section sequence, same rkyv-encoded `StyleInfo`. Nothing
  downstream has to know the card was hand-written, and no new decode path is
  introduced.

  Because the stylesheet is tokenized into the bundle rather than passed through as
  text, a markup card gets the engine's full style pipeline:

  - the `transform-vw` / `transform-vh` / `transform-rem` attributes apply, so those
    units resolve against the `lynx-view` box. They remain off by default, in which
    case the units keep their native browser meaning.
  - Lynx-specific property rewriting runs, so `display: linear` and the `linear-*`
    properties are translated instead of being discarded by the browser as invalid.
  - `:root` is rewritten to the card's own root element. A card renders inside a
    shadow root, where a literal `:root` matches nothing.

  A parse failure is returned rather than thrown, formatted like the engine's
  reference parser and located by offset.

  **At-rules that Lynx does not support are dropped from the bundle.** This is
  intended, not a limitation of the web implementation: Lynx's binary style format
  has exactly three rule kinds - style, `@font-face` and `@keyframes` - so a
  conditional group has no representation on any Lynx platform. Concretely, in a
  markup card's `<style>`:

  - `@media`, `@supports` and `@layer` do not apply. The rules inside them are
    dropped with them; they are not promoted to the top level, so a card renders as
    though those blocks had not been written.
  - `@container`, `@property`, `@scope`, `@starting-style`, `@page`, `@charset` and
    `@namespace` are not recognised by the Lynx CSS parser and are dropped the same
    way, along with anything inside them.
  - `@import url("...")` does not resolve. A markup card owns a single stylesheet and
    has nothing to link to, so it is dropped rather than aborting the build. `@import`
    itself is supported - the numeric form a build step emits is unaffected.
  - `@font-face` and `@keyframes` **nested inside** one of the above are dropped with
    their enclosing block, even though both are supported at the top level.

  Every one of these is reported on the console during the build, once per at-rule,
  naming the at-rule and why it could not be carried - so the cause is visible rather
  than showing up later as a rendering difference with nothing to go on.

  The existing encode path is untouched: `encodeCSS` and `encode` are byte for byte
  unchanged, and a ReactLynx build produces exactly the bundle it produced before.

### Patch Changes

- Updated dependencies []:
  - @lynx-js/web-worker-rpc@0.24.0

## 0.23.1

### Patch Changes

- Wait for main-thread lazy-component evaluation before invoking background callbacks. ([#3252](https://github.com/lynx-family/lynx-stack/pull/3252))

- Support the `__GetComputedStyleByKey` element PAPI. ([#3262](https://github.com/lynx-family/lynx-stack/pull/3262))

- Allow Web-gated MTS compatibility shims to replace the chunk-local window binding. ([#3294](https://github.com/lynx-family/lynx-stack/pull/3294))

- Updated dependencies []:
  - @lynx-js/web-worker-rpc@0.23.1

## 0.23.0

### Minor Changes

- Add a bidirectional per-card devtool event channel. Background scripts can use `lynx.getDevtool()` to dispatch events to a `devtoolMessage` event on `<lynx-view>` and listen for events sent through `lynxView.sendDevtoolEvent()`. ([#2999](https://github.com/lynx-family/lynx-stack/pull/2999))

### Patch Changes

- fix `auto-height` for frame ([#3062](https://github.com/lynx-family/lynx-stack/pull/3062))

- Reuse the first bundle loaded for a URL and ignore override configs from later requests without replacing or disposing the cached bundle. ([#3164](https://github.com/lynx-family/lynx-stack/pull/3164))

- Fix `nativeApp.callLepusMethod` always invoking its callback with `undefined`: the UI-thread handler now returns the lepus method's result so the callback receives it. ([#2994](https://github.com/lynx-family/lynx-stack/pull/2994))

- Include the `<lynx-view>` host and page baseline styles in its shadow root so client rendering and declarative Shadow DOM SSR do not depend on the outer document stylesheet. ([#3004](https://github.com/lynx-family/lynx-stack/pull/3004))

- Map the Lynx `textarea` tag to the `x-textarea` custom element when creating elements on web. ([#2971](https://github.com/lynx-family/lynx-stack/pull/2971))

  `__CreateElement` looked up `LYNX_TAG_TO_HTML_TAG_MAP`, which had no `textarea` entry, so `textarea` fell through to a bare HTML `<textarea>` instead of the `x-textarea` custom element registered by `@lynx-js/web-elements`. Because the element was never `x-textarea`, none of the Lynx event forwarding (`input`/`focus`/`blur`) was wired up, so typed input never bridged to the framework thread — any `bindinput`/`@input` binding (e.g. Vue's `v-model`) silently did nothing. `input` already worked because it was mapped to `x-input`.

  Adding `textarea: 'x-textarea'` to the map makes `textarea` render as `x-textarea`, matching native Lynx and the existing `input` behavior; the runtime event tables already know how to bridge `x-textarea`'s `lynxinput`/`lynxfocus`/`lynxblur` events. The same entry is added to the parallel Rust map (`src/constants.rs`) so `textarea` type selectors in Lynx stylesheets are rewritten to `x-textarea` and keep matching the rendered element.

- Updated dependencies [[`087a59b`](https://github.com/lynx-family/lynx-stack/commit/087a59b24b43f91df71450e63e91a31a40a88158), [`5a83170`](https://github.com/lynx-family/lynx-stack/commit/5a8317089341c4a5d594f92286980e7f17b9798c), [`0d3623b`](https://github.com/lynx-family/lynx-stack/commit/0d3623bae7741223083b2723af87a0d32226d01e), [`a1cccf9`](https://github.com/lynx-family/lynx-stack/commit/a1cccf9ab57fd22ece00ba30e34c6734d79c8c4e), [`226ac0e`](https://github.com/lynx-family/lynx-stack/commit/226ac0e7c2969aad37c9a4bffe7e82517e12e4eb), [`02c875c`](https://github.com/lynx-family/lynx-stack/commit/02c875cdfe772d552f119a386b3cf6e3fc7f9305)]:
  - @lynx-js/web-elements@0.12.7
  - @lynx-js/css-serializer@0.1.7
  - @lynx-js/web-worker-rpc@0.23.0

## 0.22.2

### Patch Changes

- Break a circular dependency in the web-core main thread runtime by using `import type` for type-only `LynxViewInstance` imports. ([#2927](https://github.com/lynx-family/lynx-stack/pull/2927))

- Updated dependencies [[`db543ea`](https://github.com/lynx-family/lynx-stack/commit/db543ea9be725eb343cd6c2c4b0fc0785ab6a3d1)]:
  - @lynx-js/web-elements@0.12.6
  - @lynx-js/web-worker-rpc@0.22.2

## 0.22.1

### Patch Changes

- Updated dependencies [[`d7a98bd`](https://github.com/lynx-family/lynx-stack/commit/d7a98bd8f40ea31d980e91ee47e9b16605a52965)]:
  - @lynx-js/web-elements@0.12.5
  - @lynx-js/web-worker-rpc@0.22.1

## 0.22.0

### Minor Changes

- Support `lynx.fetchBundle` and `lynx.loadScript` for async external bundles on the web platform. ([#2846](https://github.com/lynx-family/lynx-stack/pull/2846))

  `@lynx-js/externals-loading-webpack-plugin` (via `@lynx-js/external-bundle-rsbuild-plugin`) can now load external bundles at runtime on web. Both APIs are available on the `lynx` object in the main-thread and background JS realms. An external bundle reuses the card's own chunk machinery rather than custom sections: its main-thread chunk rides the `LepusCode` section (loaded in the mts realm via `lepusCodeUrls`) and its background chunk rides the `Manifest` section (loaded in the bts worker via `updateBTSChunk` → `templateCache`), while its pre-processed style section is applied globally through the existing wasm style engine. The background thread now requires `@lynx-js/lynx-core` >= 0.1.4, whose `lynx.loadScript` runs the loaded section's init.

  Web binary external bundles are produced by `@lynx-js/lynx-bundle-rslib-config` with `target: 'web'`.

  Only the async usage is supported (`async: true`); the synchronous `promise.wait()` usage is not available on web.

### Patch Changes

- Implement web performance profiling APIs by bridging ReactLynx `profileStart`, `profileEnd`, `profileMark`, `profileFlowId`, and `isProfileRecording` to browser User Timing entries. ([#2874](https://github.com/lynx-family/lynx-stack/pull/2874))

- Updated dependencies []:
  - @lynx-js/web-worker-rpc@0.22.0

## 0.21.1

### Patch Changes

- fix: avoid wasm 4kb error on chrome < 115 ([#2717](https://github.com/lynx-family/lynx-stack/pull/2717))

  fix `Uncaught (in promise) RangeError: WebAssembly.Instance is disallowed on the main thread, if the buffer size is larger than 4KB. Use WebAssembly.instantiate.` error on `chrome < 115`

- Fix web font-face stylesheet insertion so custom fonts are appended through the Lynx view shadow host. ([#2745](https://github.com/lynx-family/lynx-stack/pull/2745))

- Restore CSS var fallback values when encoding web binary templates. ([#2841](https://github.com/lynx-family/lynx-stack/pull/2841))

- Updated dependencies [[`445c6c7`](https://github.com/lynx-family/lynx-stack/commit/445c6c77c227bb30ae4a92f8385518cf8b4b8bc2)]:
  - @lynx-js/web-elements@0.12.4
  - @lynx-js/web-worker-rpc@0.21.1

## 0.21.0

### Minor Changes

- feat: support global keyboard events (keydown/keyup) on web ([#2594](https://github.com/lynx-family/lynx-stack/pull/2594))

  Register `keydown`/`keyup` listeners on `document` instead of the ShadowRoot, which never receives keyboard events. Handle the case where `target_unique_id` is 0 (no element in the Lynx tree) by falling back to `currentTarget`, enabling `global-bindkeydown` and `global-bindkeyup` to work correctly in web previews.

### Patch Changes

- Add lynx-view-relative coordinates to positional event payloads (matching native Lynx semantics) while preserving viewport/document coordinates for Web interop, and switch the `boundingClientRect` UI method to lynx-view-relative. ([#2583](https://github.com/lynx-family/lynx-stack/pull/2583))

  The lynx-view's rect is cached by a new `BoundingClientRectService` (one per `LynxViewInstance`). The cache is invalidated by `transitionend`/`animationend` on the lynx-view itself (filtered to ignore descendants bubbling through) and by an idle-callback path throttled to at most one invalidation per 240 ms. This picks up CSS `transform`s and similar drifts that `ResizeObserver` would not catch, while bounding the cost when many events read the rect in a tight loop and avoiding event-modification feedback loops.

  Coordinate model:

  - `x`/`y` (top-level on `mouse*`; `detail.x`/`detail.y` on `click`/`touch*`; per-touch on `touches`/`targetTouches`/`changedTouches`) — lynx-view-relative (Lynx parity).
  - `clientX`/`clientY`, `pageX`/`pageY` (top-level on `mouse*`/`click`; per-touch alongside the added `x`/`y`) — viewport- and document-relative, unchanged from the underlying DOM event (Web interop).
  - `layoutchange.detail.{top,left,right,bottom}` is lynx-view-relative.
  - The `boundingClientRect` UI method (`SelectorQuery#fields({rect: true})`, `NodesRef.invoke('boundingClientRect')`) returns lynx-view-relative coordinates.

- Updated dependencies [[`531ef76`](https://github.com/lynx-family/lynx-stack/commit/531ef76434a513f1e0c47137ca1051e0dacf04f6)]:
  - @lynx-js/web-elements@0.12.3
  - @lynx-js/web-worker-rpc@0.21.0

## 0.20.4

### Patch Changes

- Always clone touch event lists when creating cross-thread events so synthetic touch events only carry structured-clone-safe primitive fields. ([#2636](https://github.com/lynx-family/lynx-stack/pull/2636))

- Conditionally pass Card and Component params based on cardType in background thread. ([#2610](https://github.com/lynx-family/lynx-stack/pull/2610))

- Add bidirectional decode worker heartbreak liveness messages. ([#2599](https://github.com/lynx-family/lynx-stack/pull/2599))

- Add web support for the `<frame>` element by mapping it to `<lynx-view>`. ([#2604](https://github.com/lynx-family/lynx-stack/pull/2604))

- Stop redeclaring `fetch` as a chunk-scope binding. Reusing the host ([#2562](https://github.com/lynx-family/lynx-stack/pull/2562))
  `window.fetch` from BTS chunks (instead of capturing the no-op stub the
  chunk wrapper used to install) lets the renderer issue real network
  requests.
- Updated dependencies [[`c1db603`](https://github.com/lynx-family/lynx-stack/commit/c1db6034641954680c529e3a01a04077196cd94d)]:
  - @lynx-js/web-elements@0.12.2
  - @lynx-js/web-worker-rpc@0.20.4

## 0.20.3

### Patch Changes

- fix: `__AddClass` triggers style updates when `enableCSSSelector` is `false` ([#2515](https://github.com/lynx-family/lynx-stack/pull/2515))

  `__AddClass` was missing the expected call to `update_css_og_style` when CSS selectors are disabled (`enableCSSSelector: false`). With this fix, dynamically adding a class correctly delegates style population from the template AST into the DOM, mirroring the behavior of `__SetClasses`.

  Added behavioral unit test and end-to-end playwright validations using dynamically generated JSON AST `styleInfo` mocks.

- fix(web-core): skip setting lynxEntryNameAttribute for **Card** and use constants for server element APIs ([#2510](https://github.com/lynx-family/lynx-stack/pull/2510))

- Fix componentCSSID behavior for SSR and main thread by calculating element css_id from parent component correctly. ([#2495](https://github.com/lynx-family/lynx-stack/pull/2495))

- fix: avoid panic in dispatch_event_by_path when element data cannot be retrieved ([#2508](https://github.com/lynx-family/lynx-stack/pull/2508))

- fix: filter out -1 uniqueId in commonEventHandler ([#2493](https://github.com/lynx-family/lynx-stack/pull/2493))

- feat: add x-markdown support ([#2412](https://github.com/lynx-family/lynx-stack/pull/2412))

  Add opt-in support for the `x-markdown` element on Lynx Web, including
  Markdown rendering together with its related styling, interaction, animation,
  truncation, range rendering, and effect capabilities exposed through the
  component API.

  Update the `web-core`, `web-core-wasm`, and `web-mainthread-apis` runtime
  paths to use the shared property-or-attribute setter from `web-constants`, so
  custom elements such as `x-markdown` can receive structured property values
  correctly instead of being forced through string-only attribute updates.

  ```javascript
  import '@lynx-js/web-elements/XMarkdown';
  ```

- fix: transformVH not work with cqw unit as the base length ([#2469](https://github.com/lynx-family/lynx-stack/pull/2469))

- fix: add cardType resolution for legacy json lynx bundle ([#2510](https://github.com/lynx-family/lynx-stack/pull/2510))

- fix: the default value of rpx is supposed to be 1/750 cqw ([#2469](https://github.com/lynx-family/lynx-stack/pull/2469))

- Updated dependencies [[`e179680`](https://github.com/lynx-family/lynx-stack/commit/e1796803444ba70efa86609b620c3a753b6694de), [`647334c`](https://github.com/lynx-family/lynx-stack/commit/647334cfec91cf7f13d118ed5a9933e0eacda831), [`fb7bc84`](https://github.com/lynx-family/lynx-stack/commit/fb7bc84534e6ada5aea82ef70202950855f61dff), [`9454dc4`](https://github.com/lynx-family/lynx-stack/commit/9454dc49a06d99a8787c1ee33acecdff6286603e), [`bdec498`](https://github.com/lynx-family/lynx-stack/commit/bdec4980651301372ac9badf652fb3fb31f48158), [`b0247f9`](https://github.com/lynx-family/lynx-stack/commit/b0247f98189a230c4423b1eaab51f578f21302dd), [`eec539a`](https://github.com/lynx-family/lynx-stack/commit/eec539abaa4c4f6485c7ba0442da50c6eeac53ee)]:
  - @lynx-js/css-serializer@0.1.6
  - @lynx-js/web-elements@0.12.1
  - @lynx-js/web-worker-rpc@0.20.3

## 0.20.2

### Patch Changes

- fix: map clientX and clientY to x and y in touch event detail ([#2458](https://github.com/lynx-family/lynx-stack/pull/2458))

- fix(web-platform): completely detach event listeners and forcefully free `MainThreadWasmContext` pointer alongside strict FIFO async component disposal to ensure total memory reclamation without use-after-free risks ([#2457](https://github.com/lynx-family/lynx-stack/pull/2457))

- refactor: with WeakRef in element APIs and WASM bindings to improve memory management. ([#2439](https://github.com/lynx-family/lynx-stack/pull/2439))

- fix: preserve CSS variable fallback values when encoding web-core stylesheets so declarations like `var(--token, rgba(...))` are emitted with their fallback intact. ([#2460](https://github.com/lynx-family/lynx-stack/pull/2460))

- fix: avoid to do use-after-free for rust instance ([#2461](https://github.com/lynx-family/lynx-stack/pull/2461))

- fix: Change uniqueId to uid in LynxCrossThreadEventTarget ([#2467](https://github.com/lynx-family/lynx-stack/pull/2467))

- Updated dependencies []:
  - @lynx-js/web-worker-rpc@0.20.2

## 0.20.1

### Patch Changes

- Added support for the `global-bind` event handling modifier in the web platform runtime. ([#2438](https://github.com/lynx-family/lynx-stack/pull/2438))

  This mechanism enables seamless cross-element event communication without requiring a formal DOM tree relationship, allowing decoupled elements to observe and respond to standard events occurring anywhere within the component tree.

  #### Usage

  Global bindings allow an observer element to react to events triggered on another target element.

  #### 1. Define the Global Subscription

  Attach `global-bindTap` (or any equivalent standard event alias) to your observer element:

  ```jsx
  <view
    id='observer'
    global-bindTap={(event) => {
      // This will trigger whenever 'tap' is caught by a globally bound event.
      console.log('Global tap handled!', event);
    }}
  />;
  ```

  #### 2. Trigger the Event anywhere

  The event will be triggered via normal user interaction (such as `tap`) on any other constituent elements:

  ```jsx
  <view
    id='target'
    bindTap={(event) => {
      // Note: To successfully propagate globally, ensure the event bubbles.
    }}
  />;
  ```

- feat(web-core): add support for configurable rem unit transform ([#2403](https://github.com/lynx-family/lynx-stack/pull/2403))

  - **Description**: Added a new configuration option `transformREM` (also exposed as `transform_rem` on the Rust layer) to the Web Core renderer. When enabled, it recursively converts static `rem` unit values in your styles into dynamic CSS custom properties (`calc(VALUE * var(--rem-unit))`) during template decoding and evaluation. This enables developers to implement responsive font scaling and layout sizing dynamically on the client side simply by modifying the root CSS variable `--rem-unit`.

  - **Usage**:
    You can enable this feature when working with `LynxView` by setting `transformREM` to `true`, or directly as an HTML attribute `transform-rem`:

    ```html
    <lynx-view
      url="https://example.com/template.js"
      transform-rem="true"
    ></lynx-view>
    ```

    ```javascript
    const lynxView = document.createElement('lynx-view');
    lynxView.transformREM = true;
    ```

    With this enabled, a CSS declaration like `font-size: 1.5rem;` is transparently evaluated as `font-size: calc(1.5 * var(--rem-unit));` by the runtime engine.

- Updated dependencies [[`156d64d`](https://github.com/lynx-family/lynx-stack/commit/156d64da67e83dfc92e63568cee602c21db873cf), [`59d11b2`](https://github.com/lynx-family/lynx-stack/commit/59d11b2549e5d2ca2ef18c5fe238c468e6db7d9a)]:
  - @lynx-js/css-serializer@0.1.5
  - @lynx-js/web-worker-rpc@0.20.1

## 0.20.0

### Minor Changes

- **This is a breaking change** ([#2322](https://github.com/lynx-family/lynx-stack/pull/2322))

  #### Architectural Upgrade: `web-core-wasm` replaces `web-core`

  This release marks a major architectural upgrade for the web platform. The experimental, WASM-powered engine formerly known as `web-core-wasm` has been fully stabilized and merged into the main branch, completely replacing the previous pure JS/TS based `web-core` implementation. This consolidation massively improves execution performance and aligns the API boundaries of the Web platform directly with other native Lynx implementations.

  ##### 🎉 Added Features

  - **Core API Enhancements**: Successfully exposed and supported `__QuerySelector` and `__InvokeUIMethod` methods.
  - **Security & CSP Compliance**: Added a `nonce` attribute to the iframe's `srcdoc` script execution, strengthening Content Security Policy (CSP) compliance.
  - **`<lynx-view>` Parameter Enhancements**:
    - Added the `browser-config` attribute and property to `<lynx-view>`. Development environments can now supply a `BrowserConfig` object (e.g., configuring `pixelRatio`, `pixelWidth`, `pixelHeight`) allowing the `systemInfo` payload to be dynamically configured at the instance level.

  ##### 🔄 Changed Features

  - **Legacy JSON Backwards Compatibility**: Delivered comprehensive fixes and optimizations to deeply support legacy JSON output templates:
    - Added support for lazy loading execution mode (`lazy usage`).
    - Implemented the correct decoding and handling of `@keyframe` animation rules.
    - Rectified rule scoping matching including scoped CSS, root selectors, and type selectors.
  - **Ecosystem Migration**: Updated testing and ecosystem applications (such as `web-explorer` and `shell-project`) to migrate away from obsolete fragmented dependencies. The new WASM architecture seamlessly integrates Element APIs and CSS directly inside the core client module, requiring a much simpler initialization footprint.

    **Before (Legacy `web-core` + `web-elements`):**

    ```typescript
    // Required multiple imports to assemble the environment
    import '@lynx-js/web-core/client';
    import type { LynxViewElement as LynxView } from '@lynx-js/web-core';

    // Had to manually import separate elements and their CSS
    import '@lynx-js/web-elements/index.css';
    import '@lynx-js/web-elements/all';

    const lynxView = document.createElement('lynx-view') as LynxView;
    // ...
    ```

    **After (New `web-core` unified architecture):**

    ```typescript
    // The new engine natively registers Web Components and injects fundamental CSS
    import '@lynx-js/web-core/client';
    import type { LynxViewElement as LynxView } from '@lynx-js/web-core/client';

    const lynxView = document.createElement('lynx-view') as LynxView;
    // ...
    ```

    _(Applications can now drop `@lynx-js/web-elements` entirely from their `package.json` dependencies)._

  - **Dependency & Boot Sequence Improvements**: Re-architected module loading pathways. Promoted `wasm-feature-detect` directly to a core dependency, and hardened the web worker count initialization assertions.
  - **Initialization Optimizations**: Converted `SERVER_IN_SHADOW_CSS` initialization bounds to use compilation-time constant expressions for better optimization.

  ##### 🗑️ Deleted Features & Structural Deprecations

  - **`<lynx-view>` Parameter Removals**:
    - Removed the `thread-strategy` property and attribute. Historically, this permitted consumers to toggle between `'multi-thread'` and `'all-on-ui'` modes depending on how they wanted the background logic to be executed. The WASM-driven architecture enforces a consolidated concurrency model, deprecating this `<lynx-view>` attribute entirely.
    - Removed the `overrideLynxTagToHTMLTagMap` property/attribute. HTML tag overriding mechanism has been deprecated in the new engine.
    - Removed the `customTemplateLoader` property handler from `<lynx-view>`.
    - Removed the `inject-head-links` property and attribute (`injectHeadLinks`), which previously was used to automatically inject `<link rel="stylesheet">` tags from the document head into the `lynx-view` shadow root.
  - **Fragmented Packages Removal**: The new cohesive WASM architecture native to `@lynx-js/web-core` handles cross-thread communication, worker boundaries, and rendering loops uniformly. Consequently, multiple obsolete packages have been completely removed from the workspace:
    - `@lynx-js/web-mainthread-apis`
    - `@lynx-js/web-worker-runtime`
    - `@lynx-js/web-core-server`
    - `@lynx-js/web-core-wasm-e2e` (transitioned into standard test suites)

- Added support for `rpx` unit ([#2377](https://github.com/lynx-family/lynx-stack/pull/2377))

  **This is a breaking change**

  The following Styles has been added to `web-core`

  ```css
  lynx-view {
    width: 100%;
    container-name: lynx-view;
    container-type: inline-size;
    --rpx-unit: 1cqw;
  }
  ```

  Check MDN for the details about these styles:

  - https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Properties/container-name
  - https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Properties/container-type
  - https://developer.mozilla.org/en-US/docs/Web/CSS/Guides/Containment/Container_queries

  #### how it works?

  For the following code

  ```html
  <view style="height:1rpx"></view>
  ```

  it will be transformed to

  ```html
  <view style="height:calc(1 * var(--rpx-unit))"></view>
  ```

  Therefore you could use any `<length>` value to replace the unit, for example:

  ```html
  <lynx-view style="--rpx-unit:1px"></lynx-view>
  ```

  By default, the --rpx-unit value is `1cqw`

- Added support for transform `vw` and `vh` unit ([#2377](https://github.com/lynx-family/lynx-stack/pull/2377))

  Add `transform-vw` and `transform-vh` attributes and properties on `<lynx-view>`.

  For the following code

  ```html
  <view style="height:1vw"></view>
  ```

  If the `transform-vw` is enabled `<lynx-view transform-vw="true">`, it will be transformed to

  ```html
  <view style="height:calc(1 * var(--vw-unit))"></view>
  ```

  Therefore you could use any `<length>` value to replace the unit, for example:

  ```html
  <lynx-view style="--vw-unit:1px"></lynx-view>
  ```

### Patch Changes

- feat(web-core): add `is_bubble` parameter to `common_event_handler` to properly handle non-bubbling events like `window.Event('click', { bubbles: false })`. ([#2399](https://github.com/lynx-family/lynx-stack/pull/2399))

- chore: update readme ([#2380](https://github.com/lynx-family/lynx-stack/pull/2380))

- fix: the output format should be module ([#2388](https://github.com/lynx-family/lynx-stack/pull/2388))

- opt: use opt-level 3 to compile wasm ([#2371](https://github.com/lynx-family/lynx-stack/pull/2371))

- fix(web-core): avoid partial bundle loading and double fetching when fetchBundle is called concurrently for the same url. ([#2386](https://github.com/lynx-family/lynx-stack/pull/2386))

- fix(web-core): fallback to the original export chunk when `processEvalResult` is absent during `queryComponent` execution ([#2399](https://github.com/lynx-family/lynx-stack/pull/2399))

- fix: tokenizing inline style values correctly to support rpx and ppx unit conversion ([#2381](https://github.com/lynx-family/lynx-stack/pull/2381))

  This fixes an issue where the `transform_inline_style_key_value_vec` API bypassed the CSS tokenizer, preventing dimension units like `rpx` or `ppx` from being successfully transformed into `calc` strings when specified via inline styles.

- feat: add mts lynx.querySelectorAll API ([#2382](https://github.com/lynx-family/lynx-stack/pull/2382))

- fix: mts in lazy component ([#2375](https://github.com/lynx-family/lynx-stack/pull/2375))

- fix: enableJSDataProcessor not work ([#2372](https://github.com/lynx-family/lynx-stack/pull/2372))

- feat: add `ppx` unit support for CSS, transforming to `calc(... * var(--ppx-unit))` directly. ([#2381](https://github.com/lynx-family/lynx-stack/pull/2381))

- Updated dependencies []:
  - @lynx-js/web-worker-rpc@0.20.0

## 0.19.8

### Patch Changes

- reexports essential utils & types in @lynx-js/web-elements from @lynx-js/web-core-wasm/client ([#2321](https://github.com/lynx-family/lynx-stack/pull/2321))

- fix: avoid error when LynxView is removed immediately after connected ([#2182](https://github.com/lynx-family/lynx-stack/pull/2182))

- Updated dependencies []:
  - @lynx-js/web-constants@0.19.8
  - @lynx-js/web-mainthread-apis@0.19.8
  - @lynx-js/web-worker-rpc@0.19.8
  - @lynx-js/web-worker-runtime@0.19.8

## 0.19.7

### Patch Changes

- feat: add browser config of lynx-view, now you can customize the browser config of lynx-view: ([#2140](https://github.com/lynx-family/lynx-stack/pull/2140))

  ```
  lynxView.browserConfig = {
    pixelRatio: 1,
    pixelWidth: 1234,
    pixelHeight: 5678,
  }
  ```

- Updated dependencies []:
  - @lynx-js/web-constants@0.19.7
  - @lynx-js/web-mainthread-apis@0.19.7
  - @lynx-js/web-worker-rpc@0.19.7
  - @lynx-js/web-worker-runtime@0.19.7

## 0.19.6

### Patch Changes

- fix: avoid crash on CPUs that do not support SIMD ([#2133](https://github.com/lynx-family/lynx-stack/pull/2133))

- feat: support lynx.reload() ([#2127](https://github.com/lynx-family/lynx-stack/pull/2127))

- Updated dependencies [[`179f984`](https://github.com/lynx-family/lynx-stack/commit/179f9844adf00ff4b2cd450ffb943649441c87d3), [`f7133c1`](https://github.com/lynx-family/lynx-stack/commit/f7133c137f094063e991dfa0e993ea92177aa173), [`6c2b51a`](https://github.com/lynx-family/lynx-stack/commit/6c2b51a661ae244eb40671f63f29ee971e084ed4), [`556fe9f`](https://github.com/lynx-family/lynx-stack/commit/556fe9fded90945a7926093897288d5302c314d3), [`5b589ab`](https://github.com/lynx-family/lynx-stack/commit/5b589ab53b01a8e2357d3ccbb159edab004086d3)]:
  - @lynx-js/web-constants@0.19.6
  - @lynx-js/web-mainthread-apis@0.19.6
  - @lynx-js/web-worker-rpc@0.19.6
  - @lynx-js/web-worker-runtime@0.19.6

## 0.19.5

### Patch Changes

- fix: pixelWidth and pixelHeight use client instead of screen ([#2055](https://github.com/lynx-family/lynx-stack/pull/2055))

- Updated dependencies [[`a91173c`](https://github.com/lynx-family/lynx-stack/commit/a91173c986ce3f358f1c11c788ca46a0529c701d)]:
  - @lynx-js/web-worker-rpc@0.19.5
  - @lynx-js/web-constants@0.19.5
  - @lynx-js/web-worker-runtime@0.19.5
  - @lynx-js/web-mainthread-apis@0.19.5

## 0.19.4

### Patch Changes

- Updated dependencies [[`bba05e2`](https://github.com/lynx-family/lynx-stack/commit/bba05e2ed06cca8009ad415fd9777e8334a0887a)]:
  - @lynx-js/web-worker-rpc@0.19.4
  - @lynx-js/web-constants@0.19.4
  - @lynx-js/web-worker-runtime@0.19.4
  - @lynx-js/web-mainthread-apis@0.19.4

## 0.19.3

### Patch Changes

- Updated dependencies [[`986761d`](https://github.com/lynx-family/lynx-stack/commit/986761dd1e9e631f8118faec68188f29f78e9236)]:
  - @lynx-js/web-worker-rpc@0.19.3
  - @lynx-js/web-constants@0.19.3
  - @lynx-js/web-worker-runtime@0.19.3
  - @lynx-js/web-mainthread-apis@0.19.3

## 0.19.2

### Patch Changes

- chore: mark the "multi-thread" deprecated ([#2030](https://github.com/lynx-family/lynx-stack/pull/2030))

  **NOTICE This will be a breaking change in the future**

  mark the thread strategy "multi-thread" as deprecated.

  Please use "all-on-ui" instead. If you still want to use multi-thread mode, please try to use a cross-origin isolated iframe.

  A console warning will be printed if `thread-strategy` is set to `multi-thread`.

- fix csp issue for mts realm ([#1998](https://github.com/lynx-family/lynx-stack/pull/1998))

- Updated dependencies []:
  - @lynx-js/web-constants@0.19.2
  - @lynx-js/web-mainthread-apis@0.19.2
  - @lynx-js/web-worker-rpc@0.19.2
  - @lynx-js/web-worker-runtime@0.19.2

## 0.19.1

### Patch Changes

- fix: support CSP for mts ([#1994](https://github.com/lynx-family/lynx-stack/pull/1994))

- Updated dependencies [[`f7256d5`](https://github.com/lynx-family/lynx-stack/commit/f7256d5bd920b2f6c0cadab44455585c35621b35)]:
  - @lynx-js/web-mainthread-apis@0.19.1
  - @lynx-js/web-worker-runtime@0.19.1
  - @lynx-js/web-constants@0.19.1
  - @lynx-js/web-worker-rpc@0.19.1

## 0.19.0

### Minor Changes

- feat: new flex:val impl ([#1979](https://github.com/lynx-family/lynx-stack/pull/1979))

### Patch Changes

- Updated dependencies [[`40c3a1a`](https://github.com/lynx-family/lynx-stack/commit/40c3a1a0436701e46b505301c4ba66a8f68de7c0), [`46bd5ee`](https://github.com/lynx-family/lynx-stack/commit/46bd5eea324d0c8348f44b3d0b437e745411ab5c)]:
  - @lynx-js/web-mainthread-apis@0.19.0
  - @lynx-js/web-worker-runtime@0.19.0
  - @lynx-js/web-constants@0.19.0
  - @lynx-js/web-worker-rpc@0.19.0

## 0.18.4

### Patch Changes

- feat: builtinTagTransformMap add `'x-input-ng': 'x-input'` ([#1932](https://github.com/lynx-family/lynx-stack/pull/1932))

- Updated dependencies []:
  - @lynx-js/web-constants@0.18.4
  - @lynx-js/web-mainthread-apis@0.18.4
  - @lynx-js/web-worker-rpc@0.18.4
  - @lynx-js/web-worker-runtime@0.18.4

## 0.18.3

### Patch Changes

- Updated dependencies [[`fece7d0`](https://github.com/lynx-family/lynx-stack/commit/fece7d0a92fa76948488373757a27dff52a90437), [`e1db63f`](https://github.com/lynx-family/lynx-stack/commit/e1db63fac8a351f98711b9b47acbb871f7a23701), [`ebc1a60`](https://github.com/lynx-family/lynx-stack/commit/ebc1a606318e9809e8a07457e18536b59be12a18)]:
  - @lynx-js/web-mainthread-apis@0.18.3
  - @lynx-js/web-worker-runtime@0.18.3
  - @lynx-js/web-constants@0.18.3
  - @lynx-js/web-worker-rpc@0.18.3

## 0.18.2

### Patch Changes

- feat: builtinTagTransformMap add `'input': 'x-input'` ([#1907](https://github.com/lynx-family/lynx-stack/pull/1907))

- Updated dependencies []:
  - @lynx-js/web-constants@0.18.2
  - @lynx-js/web-mainthread-apis@0.18.2
  - @lynx-js/web-worker-rpc@0.18.2
  - @lynx-js/web-worker-runtime@0.18.2

## 0.18.1

### Patch Changes

- fix: mts freeze after reload() ([#1892](https://github.com/lynx-family/lynx-stack/pull/1892))

  The mts may be freezed after reload() called.

  We fixed it by waiting until the all-on-ui Javascript realm implementation, an iframe, to be fully loaded.

- Updated dependencies [[`70a18fc`](https://github.com/lynx-family/lynx-stack/commit/70a18fce0083743e4516eefc91c0392d748b855f)]:
  - @lynx-js/web-mainthread-apis@0.18.1
  - @lynx-js/web-worker-runtime@0.18.1
  - @lynx-js/web-constants@0.18.1
  - @lynx-js/web-worker-rpc@0.18.1

## 0.18.0

### Minor Changes

- fix: ([#1837](https://github.com/lynx-family/lynx-stack/pull/1837))

  1. `LynxView.updateData()` cannot trigger `dataProcessor`.

  2. **This is a break change:** The second parameter of `LynxView.updateData()` has been changed from `UpdateDataType` to `string`, which is the `processorName` (default is `default` which will use `defaultDataProcessor`). This change is to better align with Native. The current complete type is as follows:

  ```ts
  LynxView.updateData(data: Cloneable, processorName?: string | undefined, callback?: (() => void) | undefined): void
  ```

### Patch Changes

- Updated dependencies [[`77397fd`](https://github.com/lynx-family/lynx-stack/commit/77397fd535cf60556f8f82f7ef8dae8a623d1625), [`7d90ed5`](https://github.com/lynx-family/lynx-stack/commit/7d90ed52a20fd7665a3517507800e7e29426f6f9)]:
  - @lynx-js/web-worker-runtime@0.18.0
  - @lynx-js/web-constants@0.18.0
  - @lynx-js/web-mainthread-apis@0.18.0
  - @lynx-js/web-worker-rpc@0.18.0

## 0.17.2

### Patch Changes

- feat: support load bts chunk from remote address ([#1834](https://github.com/lynx-family/lynx-stack/pull/1834))

  - re-support chunk splitting
  - support lynx.requireModule with a json file
  - support lynx.requireModule, lynx.requireModuleAsync with a remote url
  - support to add a breakpoint in chrome after reloading the web page

- Updated dependencies [[`a35a245`](https://github.com/lynx-family/lynx-stack/commit/a35a2452e5355bda3c475f9a750a86085e0cf56a)]:
  - @lynx-js/web-worker-runtime@0.17.2
  - @lynx-js/web-constants@0.17.2
  - @lynx-js/web-mainthread-apis@0.17.2
  - @lynx-js/web-worker-rpc@0.17.2

## 0.17.1

### Patch Changes

- Updated dependencies []:
  - @lynx-js/web-constants@0.17.1
  - @lynx-js/web-mainthread-apis@0.17.1
  - @lynx-js/web-worker-rpc@0.17.1
  - @lynx-js/web-worker-runtime@0.17.1

## 0.17.0

### Minor Changes

- break(web): temporary remove support for chunk split ([#1739](https://github.com/lynx-family/lynx-stack/pull/1739))

  Since the global variables cannot be accessed in the splited chunk, we temporary remove supporting for chunk spliting

  Developers could easily remove the chunk Split settings in Rspeedy for migration

  ```
  import { defineConfig } from '@lynx-js/rspeedy'

  export default defineConfig({
    performance: {
      chunkSplit: {
        strategy: 'all-in-one',
      },
    },
  })
  ```

### Patch Changes

- fix: lazy component load error ([#1794](https://github.com/lynx-family/lynx-stack/pull/1794))

  Some special version template may have chunk loading error. We fixed it.

- fix: avoid duplicate style transformation ([#1748](https://github.com/lynx-family/lynx-stack/pull/1748))

  After this commit, we use DAG methods to handle the styleInfos

- fix: add sandbox attribute to iframe for enhanced security ([#1709](https://github.com/lynx-family/lynx-stack/pull/1709))

- fix: the default template loader won't fetch twice for one url ([#1709](https://github.com/lynx-family/lynx-stack/pull/1709))

- Updated dependencies [[`721635d`](https://github.com/lynx-family/lynx-stack/commit/721635de6c1d2d617c7cbaa86e7d816c42d62930), [`93d707b`](https://github.com/lynx-family/lynx-stack/commit/93d707b82a59f7256952e21da6dcad2999f8233d), [`d150ed4`](https://github.com/lynx-family/lynx-stack/commit/d150ed440a4f1e9d9a3a2911adf6e6fa39a0c589)]:
  - @lynx-js/web-mainthread-apis@0.17.0
  - @lynx-js/web-constants@0.17.0
  - @lynx-js/web-worker-runtime@0.17.0
  - @lynx-js/web-worker-rpc@0.17.0

## 0.16.1

### Patch Changes

- refactor: improve chunk loading ([#1703](https://github.com/lynx-family/lynx-stack/pull/1703))

- feat: supports lazy bundle. (This feature requires `@lynx-js/lynx-core >= 0.1.3`) ([#1235](https://github.com/lynx-family/lynx-stack/pull/1235))

- Updated dependencies [[`608f375`](https://github.com/lynx-family/lynx-stack/commit/608f375e20732cc4c9f141bfbf9800ba6896100b)]:
  - @lynx-js/web-mainthread-apis@0.16.1
  - @lynx-js/web-worker-runtime@0.16.1
  - @lynx-js/web-constants@0.16.1
  - @lynx-js/web-worker-rpc@0.16.1

## 0.16.0

### Minor Changes

- refactor: provide the mts a real globalThis ([#1589](https://github.com/lynx-family/lynx-stack/pull/1589))

  Before this change, We create a function wrapper and a fake globalThis for Javascript code.

  This caused some issues.

  After this change, we will create an iframe for createing an isolated Javascript context.

  This means the globalThis will be the real one.

### Patch Changes

- refactor: add `:not([l-e-name])` at the end of selector for lazy component ([#1622](https://github.com/lynx-family/lynx-stack/pull/1622))

- feat: remove multi-thread mts heating ([#1597](https://github.com/lynx-family/lynx-stack/pull/1597))

  The default rendering mode is "all-on-ui". Therefore the preheating for "multi-thread" will be removed.

- fix: the SystemInfo in bts should be assigned to the globalThis ([#1599](https://github.com/lynx-family/lynx-stack/pull/1599))

- Updated dependencies [[`1a32dd8`](https://github.com/lynx-family/lynx-stack/commit/1a32dd886fe736c95639f67028cf7685377d9769), [`bb53d9a`](https://github.com/lynx-family/lynx-stack/commit/bb53d9a035f607e7c89952098d4ed77877a2e3c1), [`1a32dd8`](https://github.com/lynx-family/lynx-stack/commit/1a32dd886fe736c95639f67028cf7685377d9769), [`c1f8715`](https://github.com/lynx-family/lynx-stack/commit/c1f8715a81b2e69ff46fc363013626db4468c209)]:
  - @lynx-js/web-mainthread-apis@0.16.0
  - @lynx-js/web-constants@0.16.0
  - @lynx-js/web-worker-runtime@0.16.0
  - @lynx-js/offscreen-document@0.1.4
  - @lynx-js/web-worker-rpc@0.16.0

## 0.15.7

### Patch Changes

- fix: fake uidisappear event ([#1539](https://github.com/lynx-family/lynx-stack/pull/1539))

- Updated dependencies [[`70863fb`](https://github.com/lynx-family/lynx-stack/commit/70863fbc311d8885ebda40855668097b0631f521)]:
  - @lynx-js/web-mainthread-apis@0.15.7
  - @lynx-js/web-constants@0.15.7
  - @lynx-js/web-worker-runtime@0.15.7
  - @lynx-js/web-worker-rpc@0.15.7

## 0.15.6

### Patch Changes

- fix: systeminfo in mts function ([#1537](https://github.com/lynx-family/lynx-stack/pull/1537))

- refactor: use utf-8 string ([#1473](https://github.com/lynx-family/lynx-stack/pull/1473))

- Fix mtsGlobalThis race condition in createRenderAllOnUI ([#1506](https://github.com/lynx-family/lynx-stack/pull/1506))

- Updated dependencies [[`405a917`](https://github.com/lynx-family/lynx-stack/commit/405a9170442ae32603b7687549b49ab4b34aff92), [`b8f89e2`](https://github.com/lynx-family/lynx-stack/commit/b8f89e25f106a15ba9d70f2df06dfb684cbb6633), [`f76aae9`](https://github.com/lynx-family/lynx-stack/commit/f76aae9ea06abdc7022ba508d22f9f4eb00864e8), [`b8b060b`](https://github.com/lynx-family/lynx-stack/commit/b8b060b9bef722bb47bd90c33fab3922160c711d), [`d8381a5`](https://github.com/lynx-family/lynx-stack/commit/d8381a58d12af6424cab4955617251e798bdc9f1), [`214898b`](https://github.com/lynx-family/lynx-stack/commit/214898bb9c74fc9b44e68cb220a4c02485102ce2), [`ab8cee4`](https://github.com/lynx-family/lynx-stack/commit/ab8cee4bab384fa905c045c4b4b93e5d4a95d57f)]:
  - @lynx-js/web-mainthread-apis@0.15.6
  - @lynx-js/web-constants@0.15.6
  - @lynx-js/web-worker-runtime@0.15.6
  - @lynx-js/web-worker-rpc@0.15.6

## 0.15.5

### Patch Changes

- fix: load main-thread chunk in ESM format ([#1437](https://github.com/lynx-family/lynx-stack/pull/1437))

  See [nodejs/node#59362](https://github.com/nodejs/node/issues/59362) for more details.

- feat: support path() for `createQuerySelector` ([#1456](https://github.com/lynx-family/lynx-stack/pull/1456))

  - Added `getPathInfo` API to `NativeApp` and its cross-thread handler for retrieving the path from a DOM node to the root.
  - Implemented endpoint and handler registration in both background and UI threads.
  - Implemented `nativeApp.getPathInfo()`

- fix: when `onNativeModulesCall` is delayed in mounting, the NativeModules execution result may be undefined. ([#1457](https://github.com/lynx-family/lynx-stack/pull/1457))

- fix: `onNativeModulesCall` && `onNapiModulesCall` use getter to get. ([#1466](https://github.com/lynx-family/lynx-stack/pull/1466))

- Updated dependencies [[`29434ae`](https://github.com/lynx-family/lynx-stack/commit/29434aec853f14242f521316429cf07a93b8c371), [`fb7096b`](https://github.com/lynx-family/lynx-stack/commit/fb7096bb3c79166cd619a407095b8206eccb7918)]:
  - @lynx-js/web-mainthread-apis@0.15.5
  - @lynx-js/web-constants@0.15.5
  - @lynx-js/web-worker-runtime@0.15.5
  - @lynx-js/web-worker-rpc@0.15.5

## 0.15.4

### Patch Changes

- feat: support `__ElementFromBinary` ([#1391](https://github.com/lynx-family/lynx-stack/pull/1391))

- fix: crash on chrome<96 ([#1361](https://github.com/lynx-family/lynx-stack/pull/1361))

  https://github.com/wasm-bindgen/wasm-bindgen/issues/4211#issuecomment-2505965903

  https://github.com/WebAssembly/binaryen/issues/7358

  The rust toolchain enables WASM feature `reference types` by default.

  However this feature is not supported by chromium lower than version 96

  Therefore we found a workaround for it.

  In this implementation we detect if browser supports `reference types` first.

  If user's browser supported it, we load the wasm file with `reference types` on, otherwise we load the wasm file with `reference types` off.

- Updated dependencies [[`22ca433`](https://github.com/lynx-family/lynx-stack/commit/22ca433eb96b39724c6eb47ce0a938d291bbdef2), [`8645d12`](https://github.com/lynx-family/lynx-stack/commit/8645d1240ecb2005da52ab2ffeb10a5d08cc9cc2), [`143e481`](https://github.com/lynx-family/lynx-stack/commit/143e481b4353b3c3d2e8d9cc4f201442ca56f097)]:
  - @lynx-js/web-mainthread-apis@0.15.4
  - @lynx-js/web-constants@0.15.4
  - @lynx-js/web-worker-runtime@0.15.4
  - @lynx-js/web-worker-rpc@0.15.4

## 0.15.3

### Patch Changes

- fix: improve compatibility with legacy template ([#1337](https://github.com/lynx-family/lynx-stack/pull/1337))

  avoid "object Object" error for old version rspeedy outputs

- Updated dependencies [[`0da5ef0`](https://github.com/lynx-family/lynx-stack/commit/0da5ef03e41f20e9f8019c6dc03cb4a38ab18854)]:
  - @lynx-js/web-constants@0.15.3
  - @lynx-js/web-mainthread-apis@0.15.3
  - @lynx-js/web-worker-runtime@0.15.3
  - @lynx-js/web-worker-rpc@0.15.3

## 0.15.2

### Patch Changes

- feat: support SSR for all-on-ui ([#1029](https://github.com/lynx-family/lynx-stack/pull/1029))

- feat: move SSR hydrate essential info to the ssr attribute ([#1292](https://github.com/lynx-family/lynx-stack/pull/1292))

  We found that in browser there is no simple tool to decode a base64 string

  Therefore we move the data to `ssr` attribute

  Also fix some ssr issues

- feat: support \_\_MarkTemplateElement, \_\_MarkPartElement and \_\_GetTemplateParts for all-on-ui ([#1275](https://github.com/lynx-family/lynx-stack/pull/1275))

- feat: mark template elements for SSR and update part ID handling ([#1286](https://github.com/lynx-family/lynx-stack/pull/1286))

- Updated dependencies [[`cebda59`](https://github.com/lynx-family/lynx-stack/commit/cebda592ac5c7d152c877c2ac5ec403d477077e1), [`1443e46`](https://github.com/lynx-family/lynx-stack/commit/1443e468a353363e29aab0d90cd8b91c232a5525), [`5062128`](https://github.com/lynx-family/lynx-stack/commit/5062128c68e21abcf276ebcb40d7cc8f6e54244b), [`f656b7f`](https://github.com/lynx-family/lynx-stack/commit/f656b7f0d390d69c0da0d11a6c9b3f66ae877ac8)]:
  - @lynx-js/web-mainthread-apis@0.15.2
  - @lynx-js/web-constants@0.15.2
  - @lynx-js/web-worker-runtime@0.15.2
  - @lynx-js/web-worker-rpc@0.15.2

## 0.15.1

### Patch Changes

- Updated dependencies []:
  - @lynx-js/web-mainthread-apis@0.15.1
  - @lynx-js/web-worker-runtime@0.15.1
  - @lynx-js/web-constants@0.15.1
  - @lynx-js/web-worker-rpc@0.15.1

## 0.15.0

### Minor Changes

- refactor: move exposure system to web-core ([#1254](https://github.com/lynx-family/lynx-stack/pull/1254))

  **THIS IS A BREAKING CHANGE**

  **You'll need to upgrade your @lynx-js/web-elements to >= 0.8.0**

  For SSR and better performance, we moved the lynx's exposure system from web-element to web-core.

  Before this commit, we create Intersection observers by creating HTMLElements.

  After this commit, we will create such Intersection observers after dom stabled.

  Also, the setInterval for exposure has been removed, now we use an on time lazy timer for such features.

### Patch Changes

- refactor: improve `linear-weight-sum` performance ([#1216](https://github.com/lynx-family/lynx-stack/pull/1216))

- feat: lynx-view error event adds a new parameter: `e.detail.fileName`, which will be determined by the file location where the error occurred, either `lepus.js` or `app-service.js`. ([#1242](https://github.com/lynx-family/lynx-stack/pull/1242))

- perf: use rust implemented style transformer ([#1094](https://github.com/lynx-family/lynx-stack/pull/1094))

- Updated dependencies [[`7b75469`](https://github.com/lynx-family/lynx-stack/commit/7b75469d05dd2ec78bf6e1e54b94c8dff938eb40), [`f54a7aa`](https://github.com/lynx-family/lynx-stack/commit/f54a7aa539ad56ccd1e7e1b49d7ee59e742fe493), [`224c653`](https://github.com/lynx-family/lynx-stack/commit/224c653f370d807281fa0a9ffbb4f4dd5c9d308e)]:
  - @lynx-js/offscreen-document@0.1.3
  - @lynx-js/web-worker-runtime@0.15.0
  - @lynx-js/web-mainthread-apis@0.15.0
  - @lynx-js/web-constants@0.15.0
  - @lynx-js/web-worker-rpc@0.15.0

## 0.14.2

### Patch Changes

- feat: merge multiple markTiming RPC communication events together and send them together, which can effectively reduce the number of RPC communications. ([#1178](https://github.com/lynx-family/lynx-stack/pull/1178))

- chore: extract shared logic from web-core and web-core-server's loadTemplate into a unified generateTemplate function ([#1211](https://github.com/lynx-family/lynx-stack/pull/1211))

- Updated dependencies [[`e44b146`](https://github.com/lynx-family/lynx-stack/commit/e44b146b1bc2b58c0347af7fb4e4157688e07e36), [`5a9b38b`](https://github.com/lynx-family/lynx-stack/commit/5a9b38b783e611aa9761c4cd52191172270c09c7), [`6ca5b91`](https://github.com/lynx-family/lynx-stack/commit/6ca5b9106aade393dfac88914b160960a61a82f2)]:
  - @lynx-js/web-mainthread-apis@0.14.2
  - @lynx-js/web-worker-runtime@0.14.2
  - @lynx-js/web-constants@0.14.2
  - @lynx-js/web-worker-rpc@0.14.2

## 0.14.1

### Patch Changes

- feat: support BTS API `lynx.reportError` && `__SetSourceMapRelease`, now you can use it and handle it in lynx-view error event. ([#1059](https://github.com/lynx-family/lynx-stack/pull/1059))

- fix: under the all-on-ui strategy, reload() will add two page elements. ([#1147](https://github.com/lynx-family/lynx-stack/pull/1147))

- Updated dependencies [[`a64333e`](https://github.com/lynx-family/lynx-stack/commit/a64333ef28228d6b90c32e027f67bef8acbd8432), [`7751375`](https://github.com/lynx-family/lynx-stack/commit/775137521782ca5445f22029c39163c0a63bbfa5), [`b52a924`](https://github.com/lynx-family/lynx-stack/commit/b52a924a2375cb6f7ebafdd8abfbab0254eb2330)]:
  - @lynx-js/web-worker-runtime@0.14.1
  - @lynx-js/web-constants@0.14.1
  - @lynx-js/web-mainthread-apis@0.14.1
  - @lynx-js/web-worker-rpc@0.14.1

## 0.14.0

### Minor Changes

- refactor: the default thread-strategy will be all on ui ([#1105](https://github.com/lynx-family/lynx-stack/pull/1105))

  **This is a breaking change!!!**

### Patch Changes

- feat: add `_SetSourceMapRelease(errInfo)` MTS API. ([#1118](https://github.com/lynx-family/lynx-stack/pull/1118))

  You can get `errInfo.release` through `e.detail.release` in the error event callback of lynx-view.

  The `_SetSourceMapRelease` function is not complete yet, because it is currently limited by the Web platform and some functions and some props such as `err.stack` do not need to be supported for the time being.

- feat: add `_I18nResourceTranslation` api in mts && `init-i18n-resources` attr, `i18nResourceMissed` event of lynx-view. ([#1065](https://github.com/lynx-family/lynx-stack/pull/1065))

  `init-i18n-resource` is the complete set of i18nResources that need to be maintained on the container side. Note: You need to pass this value when lynx-view is initialized.

  You can use `_I18nResourceTranslation` in MTS to get the corresponding i18nResource from `init-i18n-resources`. If it is undefined, the `i18nResourceMissed` event will be dispatched.

  ```js
  // ui thread
  lynxView.initI18nResources = [
    {
      options: {
        locale: 'en',
        channel: '1',
        fallback_url: '',
      },
      resource: {
        hello: 'hello',
        lynx: 'lynx web platform1',
      },
    },
  ];
  lynxView.addEventListener('i18nResourceMissed', (e) => {
    console.log(e);
  });

  // mts
  _I18nResourceTranslation({
    locale: 'en',
    channel: '1',
    fallback_url: '',
  });
  ```

- fix: lynx-view `updateGlobalProps` method will also update globalProps, so `reload()` will use the latest updated globalProps. ([#1119](https://github.com/lynx-family/lynx-stack/pull/1119))

- feat: supports `lynx.getI18nResource()` and `onI18nResourceReady` event in bts. ([#1088](https://github.com/lynx-family/lynx-stack/pull/1088))

  - `lynx.getI18nResource()` can be used to get i18nResource in bts, it has two data sources:
    - the result of `_I18nResourceTranslation()`
    - lynx-view `updateI18nResources(data: InitI18nResources, options: I18nResourceTranslationOptions)`, it will be matched to the correct i8nResource as a result of `lynx.getI18nResource()`
  - `onI18nResourceReady` event can be used to listen `_I18nResourceTranslation` and lynx-view `updateI18nResources` execution.

- refactor: make the opcode be a plain array ([#1051](https://github.com/lynx-family/lynx-stack/pull/1051))

  #1042

- feat: The error event return value detail of lynx-view adds `sourceMap` value, the type is as follows: ([#1058](https://github.com/lynx-family/lynx-stack/pull/1058))

  ```
  CustomEvent<{
    error: Error;
    sourceMap: {
      offset: {
        line: number;
        col: number;
      };
    };
  }>;
  ```

  This is because web-core adds wrapper at runtime, which causes the stack offset to be different. Now you can calculate the real offset based on it.

- feat: add `updateI18nResources` method of lynx-view. ([#1085](https://github.com/lynx-family/lynx-stack/pull/1085))

  Now you can use `updateI18nResources` to update i18nResources, and then use \_I18nResourceTranslation() to get the updated result.

- fix: --lynx-color will be removed, and if color contains `gradient` it will be processed as transparent. ([#1069](https://github.com/lynx-family/lynx-stack/pull/1069))

- Updated dependencies [[`42ed2e3`](https://github.com/lynx-family/lynx-stack/commit/42ed2e325ff38f781dc88b92cc56093a7a7164ea), [`25a04c9`](https://github.com/lynx-family/lynx-stack/commit/25a04c9e59f4b893227bdead74f2de69f6615cdb), [`0dbb8b1`](https://github.com/lynx-family/lynx-stack/commit/0dbb8b1f580d0700e2b67b92018a7a00d1494837), [`f99de1e`](https://github.com/lynx-family/lynx-stack/commit/f99de1ef60cc5a11eae4fd0acc70a490787d36c9), [`873a285`](https://github.com/lynx-family/lynx-stack/commit/873a2852fa3df9e32c48a6504160bb243540c7b9), [`afacb2c`](https://github.com/lynx-family/lynx-stack/commit/afacb2cbea7feca46c553651000625d0845b2b00), [`1861cbe`](https://github.com/lynx-family/lynx-stack/commit/1861cbead4b373e0511214999b0e100b6285fa9a)]:
  - @lynx-js/web-worker-runtime@0.14.0
  - @lynx-js/web-mainthread-apis@0.14.0
  - @lynx-js/web-constants@0.14.0
  - @lynx-js/offscreen-document@0.1.2
  - @lynx-js/web-worker-rpc@0.14.0

## 0.13.5

### Patch Changes

- refactor: move some internal status to dom's attribute ([#945](https://github.com/lynx-family/lynx-stack/pull/945))

  It's essential for SSR

- refactor: avoid to create many style element for cssog ([#1026](https://github.com/lynx-family/lynx-stack/pull/1026))

- refactor: move component config info to attribute ([#984](https://github.com/lynx-family/lynx-stack/pull/984))

- fix: ensure render starts after dom connected ([#1020](https://github.com/lynx-family/lynx-stack/pull/1020))

- refactor: save dataset on an attribute ([#981](https://github.com/lynx-family/lynx-stack/pull/981))

  On lynx, the `data-*` attributes have different behaviors than the HTMLElement has.

  The dataset will be treated as properties, the key will not be applied the camel-case <-> hyphenate name transformation.

  Before this commit we use it as a runtime data, but after this commit we will use encodeURI(JSON.stringify(dataset)) to encode it as a string.

- refactor: implement mts apis in closure pattern ([#1004](https://github.com/lynx-family/lynx-stack/pull/1004))

- Updated dependencies [[`70b82d2`](https://github.com/lynx-family/lynx-stack/commit/70b82d23744d6b6ec945dff9f8895ab3488ba4c8), [`5651e24`](https://github.com/lynx-family/lynx-stack/commit/5651e24827358963c3261252bcc53c2ad981c13e), [`9499ea9`](https://github.com/lynx-family/lynx-stack/commit/9499ea91debdf73b2d31af0b31bcbc216135543b), [`50f0193`](https://github.com/lynx-family/lynx-stack/commit/50f01933942268b697bf5abe790da86c932f1dfc), [`57bf0ef`](https://github.com/lynx-family/lynx-stack/commit/57bf0ef19f1d79bc52ab6a4f0cd2939e7901d98b), [`5651e24`](https://github.com/lynx-family/lynx-stack/commit/5651e24827358963c3261252bcc53c2ad981c13e), [`0525fbf`](https://github.com/lynx-family/lynx-stack/commit/0525fbf38baa7a977a7a8c66e8a4d8bf34cc3b68), [`b6b87fd`](https://github.com/lynx-family/lynx-stack/commit/b6b87fd11dbc76c28f3b5022aa8c6afeb773d90f), [`c014327`](https://github.com/lynx-family/lynx-stack/commit/c014327ad0cf599b32d4182d95116b46c35f5fa5)]:
  - @lynx-js/web-mainthread-apis@0.13.5
  - @lynx-js/web-constants@0.13.5
  - @lynx-js/offscreen-document@0.1.1
  - @lynx-js/web-worker-runtime@0.13.5
  - @lynx-js/web-worker-rpc@0.13.5

## 0.13.4

### Patch Changes

- feat: lynx-view supports `updateGlobalProps` method, which can be used to update lynx.\_\_globalProps ([#918](https://github.com/lynx-family/lynx-stack/pull/918))

- feat: supports `lynx.getElementById()` && `animate()`. ([#912](https://github.com/lynx-family/lynx-stack/pull/912))

  After this commit, you can use `lynx.getElementById()` to get the element by id, and use `element.animate()` to animate the element.

- Updated dependencies [[`96d3133`](https://github.com/lynx-family/lynx-stack/commit/96d3133b149b61af01c5478f4dc7b0a071137d98), [`75e5b2f`](https://github.com/lynx-family/lynx-stack/commit/75e5b2ff16ecf5f7072a45cd130e653dee747461), [`569618d`](https://github.com/lynx-family/lynx-stack/commit/569618d8e2665f5c9e1672f7ee5900ec2a5179a2), [`f9f88d6`](https://github.com/lynx-family/lynx-stack/commit/f9f88d6fb9c42d3370a6622d9d799d671ffcf1a7)]:
  - @lynx-js/web-mainthread-apis@0.13.4
  - @lynx-js/offscreen-document@0.1.0
  - @lynx-js/web-worker-runtime@0.13.4
  - @lynx-js/web-constants@0.13.4
  - @lynx-js/web-worker-rpc@0.13.4

## 0.13.3

### Patch Changes

- refactor: code clean ([#897](https://github.com/lynx-family/lynx-stack/pull/897))

  rename many internal apis to make logic be clear:

  multi-thread: startMainWorker -> prepareMainThreadAPIs -> startMainThread -> createMainThreadContext(new MainThreadRuntime)
  all-on-ui: prepareMainThreadAPIs -> startMainThread -> createMainThreadContext(new MainThreadRuntime)

- perf: improve dom operation performance ([#881](https://github.com/lynx-family/lynx-stack/pull/881))

  - code clean for offscreen-document, cut down inheritance levels
  - add `appendChild` method for OffscreenElement, improve performance for append one node
  - bypass some JS getter for dumping SSR string

- fix: worker not released when backgroundWorkerContextCount != 1 ([#845](https://github.com/lynx-family/lynx-stack/pull/845))

- Updated dependencies [[`bb1f9d8`](https://github.com/lynx-family/lynx-stack/commit/bb1f9d845ef2395a0508666701409972e159389d), [`b6e27da`](https://github.com/lynx-family/lynx-stack/commit/b6e27daf865b0627b1c3238228a4fdf65ad87ee3), [`3d716d7`](https://github.com/lynx-family/lynx-stack/commit/3d716d79ae053b225e9bac2bbb036c968f5261e7)]:
  - @lynx-js/offscreen-document@0.0.4
  - @lynx-js/web-mainthread-apis@0.13.3
  - @lynx-js/web-worker-runtime@0.13.3
  - @lynx-js/web-constants@0.13.3
  - @lynx-js/web-worker-rpc@0.13.3

## 0.13.2

### Patch Changes

- feat: allow lynx code to get JS engine provided properties on globalThis ([#786](https://github.com/lynx-family/lynx-stack/pull/786))

  ```
  globalThis.Reflect; // this will be the Reflect Object
  ```

  Note that `assigning to the globalThis` is still not allowed.

- perf: use v8 hint for generated javascript file ([#807](https://github.com/lynx-family/lynx-stack/pull/807))

  https://v8.dev/blog/explicit-compile-hints

- feat: add new property `inject-style-rules` for LynxView ([#785](https://github.com/lynx-family/lynx-stack/pull/785))

  This property allows developer to inject some style rules into the shadowroot.

  It's a wrapper of https://developer.mozilla.org/docs/Web/API/CSSStyleSheet/insertRule

- fix: corrupt mainthread module cache ([#806](https://github.com/lynx-family/lynx-stack/pull/806))

- Updated dependencies [[`03a5f64`](https://github.com/lynx-family/lynx-stack/commit/03a5f64d7d09e38903f5d1c022f36f6e68b6432d), [`6d3d852`](https://github.com/lynx-family/lynx-stack/commit/6d3d8529d0d528419920102ca52da279bbe0f1e0), [`8cdd288`](https://github.com/lynx-family/lynx-stack/commit/8cdd28884288b9456aee3a919d6edbf72da1c67b), [`6d3d852`](https://github.com/lynx-family/lynx-stack/commit/6d3d8529d0d528419920102ca52da279bbe0f1e0)]:
  - @lynx-js/web-mainthread-apis@0.13.2
  - @lynx-js/web-worker-runtime@0.13.2
  - @lynx-js/web-constants@0.13.2
  - @lynx-js/offscreen-document@0.0.3
  - @lynx-js/web-worker-rpc@0.13.2

## 0.13.1

### Patch Changes

- fix: some inline style properties cause crash ([#647](https://github.com/lynx-family/lynx-stack/pull/647))

  add support for the following css properties

  - mask
  - mask-repeat
  - mask-position
  - mask-clip
  - mask-origin
  - mask-size
  - gap
  - column-gap
  - row-gap
  - image-rendering
  - hyphens
  - offset-path
  - offset-distance

- feat: support touch events for MTS ([#641](https://github.com/lynx-family/lynx-stack/pull/641))

  now we support

  - main-thread:bindtouchstart
  - main-thread:bindtouchend
  - main-thread:bindtouchmove
  - main-thread:bindtouchcancel

- feat: add SystemInfo.screenWidth and SystemInfo.screenHeight ([#641](https://github.com/lynx-family/lynx-stack/pull/641))

- Updated dependencies [[`c9ccad6`](https://github.com/lynx-family/lynx-stack/commit/c9ccad6b574c98121149d3e9d4a9a7e97af63d91), [`9ad394e`](https://github.com/lynx-family/lynx-stack/commit/9ad394ea9ef28688a3b810b4051868b2a28eb7de), [`f4cfb70`](https://github.com/lynx-family/lynx-stack/commit/f4cfb70606d46cd4017254c326095432f9c6bcb8), [`c9ccad6`](https://github.com/lynx-family/lynx-stack/commit/c9ccad6b574c98121149d3e9d4a9a7e97af63d91), [`839d61c`](https://github.com/lynx-family/lynx-stack/commit/839d61c8a329ed1e265fe2edc12a702e9592f743)]:
  - @lynx-js/offscreen-document@0.0.2
  - @lynx-js/web-mainthread-apis@0.13.1
  - @lynx-js/web-worker-runtime@0.13.1
  - @lynx-js/web-constants@0.13.1
  - @lynx-js/web-worker-rpc@0.13.1

## 0.13.0

### Patch Changes

- refactor: isolate SystemInfo ([#628](https://github.com/lynx-family/lynx-stack/pull/628))

  Never assign `SystemInfo` on worker's self object.

- feat: support thread strategy `all-on-ui` ([#625](https://github.com/lynx-family/lynx-stack/pull/625))

  ```html
  <lynx-view thread-strategy="all-on-ui"></lynx-view>
  ```

  This will make the lynx's main-thread run on the UA's main thread.

  Note that the `all-on-ui` does not support the HMR & chunk splitting yet.

- fix(web): css selector not work for selectors with combinator and pseudo-class on WEB ([#608](https://github.com/lynx-family/lynx-stack/pull/608))

  like `.parent > :not([hidden]) ~ :not([hidden])`

  you will need to upgrade your `react-rsbuild-plugin` to fix this issue

- Updated dependencies [[`4ee0465`](https://github.com/lynx-family/lynx-stack/commit/4ee0465f6e5846a0d038b49d2a7c95e87c9e5c77), [`74b5bd1`](https://github.com/lynx-family/lynx-stack/commit/74b5bd15339b70107a7c42525494da46e8f8f6bd), [`06bb78a`](https://github.com/lynx-family/lynx-stack/commit/06bb78a6b93d4a7be7177a6269dd4337852ce90d), [`5a3d9af`](https://github.com/lynx-family/lynx-stack/commit/5a3d9afe52ba639987db124ca35580261e0718b5), [`5269cab`](https://github.com/lynx-family/lynx-stack/commit/5269cabef7609159bdd0dd14a03c5da667907424), [`74b5bd1`](https://github.com/lynx-family/lynx-stack/commit/74b5bd15339b70107a7c42525494da46e8f8f6bd), [`2b069f8`](https://github.com/lynx-family/lynx-stack/commit/2b069f8786c95bdb9ac1f35091f05f7fd3b52225)]:
  - @lynx-js/web-mainthread-apis@0.13.0
  - @lynx-js/web-worker-runtime@0.13.0
  - @lynx-js/web-constants@0.13.0
  - @lynx-js/offscreen-document@0.0.1
  - @lynx-js/web-worker-rpc@0.13.0

## 0.12.0

### Minor Changes

- feat: improve compatibility for chrome 108 & support linear-gradient for nested x-text ([#590](https://github.com/lynx-family/lynx-stack/pull/590))

  **This is a breaking change**

  - Please upgrade your `@lynx-js/web-elements` to >=0.6.0
  - Please upgrade your `@lynx-js/web-core` to >=0.12.0
  - The compiled lynx template json won't be impacted.

  On chrome 108, the `-webkit-background-clip:text` cannot be computed by a `var(--css-var-value-text)`

  Therefore we move the logic into style transformation logic.

  Now the following status is supported

  ```
  <text style="color:linear-gradient()">
    <text>
    <text>
  </text>
  ```

### Patch Changes

- feat: allow user to implement custom template load function ([#587](https://github.com/lynx-family/lynx-stack/pull/587))

  ```js
  lynxView.customTemplateLoader = (url) => {
    return (await (await fetch(url, {
      method: 'GET',
    })).json());
  };
  ```

- feat: support mts event with target methods ([#564](https://github.com/lynx-family/lynx-stack/pull/564))

  After this commit, developers are allowed to invoke `event.target.setStyleProperty` in mts handler

- fix: crash on removing a id attribute ([#582](https://github.com/lynx-family/lynx-stack/pull/582))

- Updated dependencies [[`f1ca29b`](https://github.com/lynx-family/lynx-stack/commit/f1ca29bd766377dd46583f15e1e75bca447699cd)]:
  - @lynx-js/web-worker-runtime@0.12.0
  - @lynx-js/web-constants@0.12.0
  - @lynx-js/web-worker-rpc@0.12.0

## 0.11.0

### Minor Changes

- feat: upgrade @lynx-js/lynx-core to 0.1.2 ([#465](https://github.com/lynx-family/lynx-stack/pull/465))

  refactor some internal logic

  - \_\_OnLifeCycleEvent
  - \_\_OnNativeAppReady

### Patch Changes

- feat: support mts event handler (1/n) ([#495](https://github.com/lynx-family/lynx-stack/pull/495))

  now the main-thread:bind handler could be invoked. The params of the handler will be implemented later.

- feat: allow multi lynx-view to share bts worker ([#520](https://github.com/lynx-family/lynx-stack/pull/520))

  Now we allow users to enable so-called "shared-context" feature on the Web Platform.

  Similar to the same feature for Lynx iOS/Android, this feature let multi lynx cards to share one js context.

  The `lynx.getSharedData` and `lynx.setSharedData` are also supported in this commit.

  To enable this feature, set property `lynxGroupId` or attribute `lynx-group-id` before a lynx-view starts rendering. Those card with same context id will share one web worker for the bts scripts.

- perf: dispatchLynxViewEventEndpoint is a void call ([#506](https://github.com/lynx-family/lynx-stack/pull/506))

- Updated dependencies [[`ea42e62`](https://github.com/lynx-family/lynx-stack/commit/ea42e62fbcd5c743132c3e6e7c4851770742d544), [`a0f5ca4`](https://github.com/lynx-family/lynx-stack/commit/a0f5ca4ea0895ccbaa6aa63f449f53a677a1cf73)]:
  - @lynx-js/web-worker-runtime@0.11.0
  - @lynx-js/web-constants@0.11.0
  - @lynx-js/web-worker-rpc@0.11.0

## 0.10.1

### Patch Changes

- docs: fix documents about lynx-view's properties ([#412](https://github.com/lynx-family/lynx-stack/pull/412))

  Attributes should be hyphen-name: 'init-data', 'global-props'.

  now all properties has corresponding attributes.

- feat: onNapiModulesCall function add new param: `dispatchNapiModules`, napiModulesMap val add new param: `handleDispatch`. ([#414](https://github.com/lynx-family/lynx-stack/pull/414))

  Now you can use them to actively communicate to napiModules (background thread) in onNapiModulesCall (ui thread).

- Updated dependencies [[`1af3b60`](https://github.com/lynx-family/lynx-stack/commit/1af3b6052ab27f98bf0e4d1b0ec9f7d9e88e0afc)]:
  - @lynx-js/web-constants@0.10.1
  - @lynx-js/web-worker-runtime@0.10.1
  - @lynx-js/web-worker-rpc@0.10.1

## 0.10.0

### Minor Changes

- feat: rewrite the main thread Element PAPIs ([#343](https://github.com/lynx-family/lynx-stack/pull/343))

  In this commit we've rewritten the main thread apis.

  The most highlighted change is that

  - Before this commit we send events directly to bts
  - After this change, we send events to mts then send them to bts with some data combined.

### Patch Changes

- refactor: timing system ([#378](https://github.com/lynx-family/lynx-stack/pull/378))

  Now we moved the timing system to the background thread.

- feat: support `defaultOverflowVisible` config ([#406](https://github.com/lynx-family/lynx-stack/pull/406))

- fix(web): rsbuild will bundle 2 exactly same chunk for two same `new Worker` stmt ([#372](https://github.com/lynx-family/lynx-stack/pull/372))

  the bundle size will be optimized about 28.2KB

- fix: inline style will be removed for value number `0` ([#368](https://github.com/lynx-family/lynx-stack/pull/368))

  the inline style value could be incorrectly removed for number value `0`;

  For example, `flex-shrink:0` may be ignored.

- feat: The onNapiModulesCall function of lynx-view provides the fourth parameter: `lynxView`, which is the actual lynx-view DOM. ([#350](https://github.com/lynx-family/lynx-stack/pull/350))

- fix: publicComponentEvent args order ([#401](https://github.com/lynx-family/lynx-stack/pull/401))

- Updated dependencies [[`3a8dabd`](https://github.com/lynx-family/lynx-stack/commit/3a8dabd877084c15db1404c912dd8a19c7a0fc59), [`a521759`](https://github.com/lynx-family/lynx-stack/commit/a5217592f5aebea4b17860e729d523ecabb5f691), [`890c6c5`](https://github.com/lynx-family/lynx-stack/commit/890c6c51470c82104abb1049681f55e5d97cf9d6)]:
  - @lynx-js/web-worker-runtime@0.10.0
  - @lynx-js/web-constants@0.10.0
  - @lynx-js/web-worker-rpc@0.10.0

## 0.9.1

### Patch Changes

- feat: remove extra div #lynx-view-root ([#311](https://github.com/lynx-family/lynx-stack/pull/311))

  In this commit we've re-implemented the lynx-view's auto-size. Now we use the `contain:content` instead of `resizeObserver`.

- Updated dependencies []:
  - @lynx-js/web-constants@0.9.1
  - @lynx-js/web-worker-rpc@0.9.1
  - @lynx-js/web-worker-runtime@0.9.1

## 0.9.0

### Minor Changes

- feat: `nativeModulesUrl` of lynx-view is changed to `nativeModulesMap`, and the usage is completely aligned with `napiModulesMap`. ([#220](https://github.com/lynx-family/lynx-stack/pull/220))

  "warning: This is a breaking change."

  `nativeModulesMap` will be a map: key is module-name, value should be a esm url which export default a
  function with two parameters(you never need to use `this`):

  - `NativeModules`: oriented `NativeModules`, which you can use to call
    other Native-Modules.

  - `NativeModulesCall`: trigger `onNativeModulesCall`, same as the deprecated `this.nativeModulesCall`.

  example:

  ```js
  const nativeModulesMap = {
    CustomModule: URL.createObjectURL(
      new Blob(
        [
          `export default function(NativeModules, NativeModulesCall) {
      return {
        async getColor(data, callback) {
          const color = await NativeModulesCall('getColor', data);
          callback(color);
        },
      }
    };`,
        ],
        { type: 'text/javascript' },
      ),
    ),
  };
  lynxView.nativeModulesMap = nativeModulesMap;
  ```

  In addition, we will use Promise.all to load `nativeModules`, which will optimize performance in the case of multiple modules.

- refractor: remove entryId concept ([#217](https://github.com/lynx-family/lynx-stack/pull/217))

  After the PR #198
  All contents are isolated by a shadowroot.
  Therefore we don't need to add the entryId selector to avoid the lynx-view's style taking effect on the whole page.

### Patch Changes

- refactor: code clean ([#266](https://github.com/lynx-family/lynx-stack/pull/266))

- refactor: clean the decodeOperations implementation ([#261](https://github.com/lynx-family/lynx-stack/pull/261))

- fix: When the width and height of lynx-view are not auto, the width and height of the `lynx-tag="page"` need to be correctly set to 100%. ([#228](https://github.com/lynx-family/lynx-stack/pull/228))

- refactor: remove customelement defined detecting logic ([#247](https://github.com/lynx-family/lynx-stack/pull/247))

  Before this commit, for those element with tag without `-`, we always try to detect if the `x-${tagName}` is defined.

  After this commit, we pre-define a map(could be override by the `overrideLynxTagToHTMLTagMap`) to make that transformation for tag name.

  This change is a path to SSR and the MTS support.

- fix: 'error' event for main-thread \_reportError ([#283](https://github.com/lynx-family/lynx-stack/pull/283))

- Updated dependencies [[`5b5e090`](https://github.com/lynx-family/lynx-stack/commit/5b5e090fdf0e896f1c38a49bf3ed9889117c4fb8), [`b844e75`](https://github.com/lynx-family/lynx-stack/commit/b844e751f566d924256365d37aec4c86c520ec00), [`53230f0`](https://github.com/lynx-family/lynx-stack/commit/53230f012216f3a627853e11d544e4be175c5b9b), [`6f16827`](https://github.com/lynx-family/lynx-stack/commit/6f16827d1f4d7364870d354fc805a8868c110f1e), [`d2d55ef`](https://github.com/lynx-family/lynx-stack/commit/d2d55ef9fe438c35921d9db0daa40d5228822ecc)]:
  - @lynx-js/web-worker-runtime@0.9.0
  - @lynx-js/web-constants@0.9.0
  - @lynx-js/web-worker-rpc@0.9.0

## 0.8.0

### Minor Changes

- refactor: remove web-elements/lazy and loadNewTag ([#123](https://github.com/lynx-family/lynx-stack/pull/123))

  - remove @lynx-js/web-elements/lazy
  - remove loadElement
  - remove loadNewTag callback

  **This is a breaking change**

  Now we removed the default lazy loading preinstalled in web-core

  Please add the following statement in your web project

  ```
  import "@lynx-js/web-elements/all";
  ```

- feat: use shadowroot to isolate one lynx-view ([#198](https://github.com/lynx-family/lynx-stack/pull/198))

  Before this commit, we have been detecting if current browser supports the `@scope` rule.
  This allows us to scope one lynx-view's styles.

  After this commit we always create a shadowroot to scope then.

  Also for the new shadowroot pattern, we add a new **attribute** `inject-head-links`.
  By default, we will iterate all `<link rel="stylesheet">` in the `<head>`, and use `@import url()` to import them inside the shadowroot.
  Developers could add a `inject-head-links="false"` to disable this behavior.

- feat: never add the x-enable-xx-event attributes ([#157](https://github.com/lynx-family/lynx-stack/pull/157))

  After this commit, we update the reqirement of the version of `@lynx-js/web-elements` to `>=0.3.1`

### Patch Changes

- feat: add pixelRatio of SystemInfo, now you can use `SystemInfo.pixelRatio`. ([#150](https://github.com/lynx-family/lynx-stack/pull/150))

- Improve LynxView resize observer cleanup ([#124](https://github.com/lynx-family/lynx-stack/pull/124))

- feat: add two prop of lynx-view about `napiLoader`: ([#173](https://github.com/lynx-family/lynx-stack/pull/173))

  - `napiModulesMap`: [optional] the napiModule which is called in lynx-core. key is module-name, value is esm url.

  - `onNapiModulesCall`: [optional] the NapiModule value handler.

  **Warning:** This is the internal implementation of `@lynx-js/lynx-core`. In most cases, this API is not required for projects.

  1. The `napiModulesMap` value should be a esm url which export default a function with two parameters:

  - `NapiModules`: oriented `napiModulesMap`, which you can use to call other Napi-Modules

  - `NapiModulesCall`: trigger `onNapiModulesCall`

  example:

  ```js
  const color_environment = URL.createObjectURL(
    new Blob(
      [
        `export default function(NapiModules, NapiModulesCall) {
    return {
      getColor() {
        NapiModules.color_methods.getColor({ color: 'green' }, color => {
          console.log(color);
        });
      },
      ColorEngine: class ColorEngine {
        getColor(name) {
          NapiModules.color_methods.getColor({ color: 'green' }, color => {
            console.log(color);
          });
        }
      },
    };
  };`,
      ],
      { type: 'text/javascript' },
    ),
  );

  const color_methods = URL.createObjectURL(
    new Blob(
      [
        `export default function(NapiModules, NapiModulesCall) {
    return {
      async getColor(data, callback) {
        const color = await NapiModulesCall('getColor', data);
        callback(color);
      },
    };
  };`,
      ],
      { type: 'text/javascript' },
    ),
  );

  lynxView.napiModuleMap = {
    color_environment: color_environment,
    color_methods: color_methods,
  };
  ```

  2. The `onNapiModulesCall` function has three parameters:

  - `name`: the first parameter of `NapiModulesCall`, the function name
  - `data`: the second parameter of `NapiModulesCall`, data
  - `moduleName`: the module-name of the called napi-module

  ```js
  lynxView.onNapiModulesCall = (name, data, moduleName) => {
    if (name === 'getColor' && moduleName === 'color_methods') {
      return data.color;
    }
  };
  ```

- Updated dependencies [[`eab1328`](https://github.com/lynx-family/lynx-stack/commit/eab1328a83797fc903255c984d9f39537b9138b9), [`e9e8370`](https://github.com/lynx-family/lynx-stack/commit/e9e8370e070a50cbf65a4ebc46c2e37ea1e0be40), [`ec4e1ce`](https://github.com/lynx-family/lynx-stack/commit/ec4e1ce0d7612d6c0701792a46c78cd52130bad4), [`f0a717c`](https://github.com/lynx-family/lynx-stack/commit/f0a717c630700e16ab0af7f1fe370fd60ac75b30)]:
  - @lynx-js/web-worker-runtime@0.8.0
  - @lynx-js/web-constants@0.8.0
  - @lynx-js/web-worker-rpc@0.8.0

## 0.7.1

### Patch Changes

- Support NPM provenance. ([#30](https://github.com/lynx-family/lynx-stack/pull/30))

- fix: some valus should be updateable by global scope ([#130](https://github.com/lynx-family/lynx-stack/pull/130))

  Now we add an allowlist to allow some identifiers could be updated by globalThis.

  For those values in the allowlist:

  ```
  globalThis.foo = 'xx';
  console.log(foo); //'xx'
  ```

- refactor: isolate the globalThis in mts ([#90](https://github.com/lynx-family/lynx-stack/pull/90))

  After this commit, developers' mts code won't be able to access the globalThis

  The following usage will NOT work

  ```
  globalThis.foo = () =>{};
  foo();//crash
  ```

- refractor: improve some internal logic for element creating in MTS ([#71](https://github.com/lynx-family/lynx-stack/pull/71))

- Updated dependencies [[`c617453`](https://github.com/lynx-family/lynx-stack/commit/c617453aea967aba702967deb2916b5c883f03bb), [`2044571`](https://github.com/lynx-family/lynx-stack/commit/204457166531dae6e9f653db56b14187553b7666), [`7da7601`](https://github.com/lynx-family/lynx-stack/commit/7da7601f00407970c485046ad73eeb8534aaa4f6)]:
  - @lynx-js/web-worker-runtime@0.7.1
  - @lynx-js/web-worker-rpc@0.7.1
  - @lynx-js/web-constants@0.7.1

## 0.7.0

### Minor Changes

- 1abf8f0: feat(web):

  **This is a breaking change**

  1. A new param for `lynx-view`: `nativeModulesUrl`, which allows you to pass an esm url to add a new module to `NativeModules`. And we bind the `nativeModulesCall` method to each function on the module, run `this.nativeModulesCall()` to trigger onNativeModulesCall.

  ```typescript
  export type NativeModuleHandlerContext = {
    nativeModulesCall: (name: string, data: Cloneable) => Promise<Cloneable>;
  };
  ```

  a simple case:

  ```js
  lynxView.nativeModules = URL.createObjectURL(
    new Blob(
      [
        `export default {
    myNativeModules: {
      async getColor(data, callback) {
        // trigger onNativeModulesCall and get the result
        const color = await this.nativeModulesCall('getColor', data);
        // return the result to caller
        callback(color);
      },
    }
  };`,
      ],
      { type: 'text/javascript' },
    ),
  );
  ```

  2. `onNativeModulesCall` is no longer the value handler of `NativeModules.bridge.call`, it will be the value handler of all `NativeModules` modules.

  **Warning: This is a breaking change.**

  Before this commit, you listen to `NativeModules.bridge.call('getColor')` like this:

  ```js
  lynxView.onNativeModulesCall = (name, data, callback) => {
    if (name === 'getColor') {
      callback(data.color);
    }
  };
  ```

  Now you should use it like this:

  ```js
  lynxView.onNativeModulesCall = (name, data, moduleName) => {
    if (name === 'getColor' && moduleName === 'bridge') {
      return data.color;
    }
  };
  ```

  You need to use `moduleName` to determine the NativeModules-module. And you don’t need to run callback, just return the result!

### Patch Changes

- Updated dependencies [1abf8f0]
  - @lynx-js/web-worker-runtime@0.7.0
  - @lynx-js/web-constants@0.7.0
  - @lynx-js/web-worker-rpc@0.7.0

## 0.6.2

### Patch Changes

- 15381ca: fix: the 'page' should have default style width:100%; height:100%;
- 0412db0: fix: The runtime wrapper parameter name is changed from `runtime` to `lynx_runtime`.

  This is because some project logic may use `runtime`, which may cause duplication of declarations.

- 2738fdc: feat: support linear-direction
- Updated dependencies [0412db0]
- Updated dependencies [085b99e]
  - @lynx-js/web-constants@0.6.2
  - @lynx-js/web-worker-runtime@0.6.2
  - @lynx-js/web-worker-rpc@0.6.2

## 0.6.1

### Patch Changes

- 9c25c3d: feat: support synchronously chunk loading

  now the `lynx.requireModule` is available in bts.

- Updated dependencies [62b7841]
  - @lynx-js/web-worker-runtime@0.6.1
  - @lynx-js/web-constants@0.6.1
  - @lynx-js/web-worker-rpc@0.6.1

## 0.6.0

### Minor Changes

- e406d69: refractor: update output json format

  **This is a breaking change**

  Before this change the style info is dump in Javascript code.

  After this change the style info will be pure JSON data.

  Now we're using the css-serializer tool's output only. If you're using plugins for it, now they're enabled.

### Patch Changes

- bfae2ab: feat: We will only preheat the mainThreadWorker now, and the backgroundWorker will be created when renderPage is called, which can save some memory.

  Before this change, We will preheat two workers: mainThreadWorker and backgroundWorker.

- b80e2bb: feat: add reload() method
- Updated dependencies [e406d69]
  - @lynx-js/web-worker-runtime@0.6.0
  - @lynx-js/web-constants@0.6.0
  - @lynx-js/web-worker-rpc@0.6.0

## 0.5.1

### Patch Changes

- c49b1fb: feat: updateData api needs to have the correct format, now you can pass a callback.
- ee340da: feat: add SystemInfo.platform as 'web'. now you can use `SystemInfo.platform`.
- b5ef20e: feat: updateData should also call `updatePage` in main-thread.
- Updated dependencies [c49b1fb]
- Updated dependencies [ee340da]
- Updated dependencies [b5ef20e]
  - @lynx-js/web-constants@0.5.1
  - @lynx-js/web-worker-runtime@0.5.1
  - @lynx-js/web-worker-rpc@0.5.1

## 0.5.0

### Minor Changes

- 7b84edf: feat: introduce new output chunk format

  **This is a breaking change**

  After this commit, we new introduce a new output format for web platform.

  This new output file is a JSON file, includes all essential info.

  Now we'll add the chunk global scope wrapper on runtime, this will help us to provide a better backward compatibility.

  Also we have a intergrated output file cache for one session.

  Now your `output.filename` will work.

  The split-chunk feature has been temporary removed until the rspeedy team supports this feature for us.

### Patch Changes

- 3050faf: refractor: housekeeping
- dc6216c: feat: add selectComponent of nativeApp
- 5eaa052: refractor: unifiying worker runtime
- Updated dependencies [04607bd]
- Updated dependencies [3050faf]
- Updated dependencies [7b84edf]
- Updated dependencies [e0f0793]
  - @lynx-js/web-worker-rpc@0.5.0
  - @lynx-js/web-worker-runtime@0.5.0
  - @lynx-js/web-constants@0.5.0

## 0.4.2

### Patch Changes

- 958efda: feat(web): bundle background.js into main-thread.js for web

  To enable this feature:

  1. set the performance.chunkSplit.strategy to `all-in-one`
  2. use the `mode:'production'` to build

  The output will be only one file.

- 283e6bd: fix: invoke callback should be called after invoke && the correct callback params should be passed to callback function.

  Before this commit the invoke() success and fail callback function was be called.

- 8d583f5: refactor: organize internal dependencies
- 8cd3f65: feat: add triggerComponentEvent of NativeApp.
- 38f21e4: fix: avoid card freezing on the background.js starts too fast

  if the background thread starts too fast, Reactlynx runtime will assign an lazy handler first and then replace it by the real handler.

  Before this commit we cannot handle such "replace" operation for cross-threading call.

  Now we fix this issue

- 8714140: fix(web): check and assign globalThis property of nativeTTObject
- 7c3c2a1: feat: support `sendGlobalEvent` method.

  Now developers can do this:

  ```javascript
  const lynxView = createLynxView(configs);
  lynxView.sendGlobalEvent(eventName, params);
  ```

- 168b4fa: feat: rename CloneableObject to Cloneable, Now its type refers to a structure that can be cloned; CloneableObject type is added, which only refers to object types that can be cloned.
- Updated dependencies [8d583f5]
- Updated dependencies [38f21e4]
- Updated dependencies [168b4fa]
  - @lynx-js/web-worker-rpc@0.4.2
  - @lynx-js/web-constants@0.4.2
  - @lynx-js/web-mainthread-apis@0.4.2

## 0.4.1

### Patch Changes

- 2a49a42: fix(web): gen 2nd parameter for updateData
- 084eb17: feat: At any time, a worker is reserved for preheating subsequent cards.
- d3eac58: fix(web): refractor worker terminate system
- de2f62b: fix(web): performance doesn't handle main-thread timings correctly
- e72aae0: feat(web): support onNativeAppReady
- 27c0e6e: feat(web): infer the cssId if parent component unique id is set

  ```
  (The following info is provided for DSL maintainers)

  - the 'infer' operation only happens on fiber element creating, changing the parent's cssId, changing children's parent component unique id will cause an issue
  - __SetCSSId will be called for setting inferred cssId value. Runtime could use the same `__SetCSSId` to overwrite this value.
  - cssId: `0` will be treated as an void value
  ```

- 500057e: fix: `__GetElementUniqueID` return -1 for illegal param

  (Only DSL developers need to care this)

- Updated dependencies [27c0e6e]
- Updated dependencies [500057e]
  - @lynx-js/web-mainthread-apis@0.4.1
  - @lynx-js/web-constants@0.4.1

## 0.4.0

### Minor Changes

- a3c39d6: fix: enableRemoveCSSScope:false with descendant combinator does not work

  **THIS IS A BREAKING CHANGE**

  Before this commit, we will add a [lynx-css-id=""] selector at the beginning of all selector, like this

  ```css
  [lynx-css-id="12345"].bg-pink {
    background-color: pink;
  }
  ```

  However, for selector with descendant combinator, this will cause an issue

  ```css
  [lynx-css-id="12345"].light .bg-pink {
    background-color: pink;
  }
  ```

  What we actually want is

  ```css
  .light .bg-pink[lynx-css-id="12345"] {
    background-color: pink;
  }
  ```

  After this commit, we changed the data structor of the styleinfo which bundled into the main-thread.js.
  This allows us to add class selectors at the begining of selector and the end of plain selector(before the pseudo part).

  **THIS IS A BREAKING CHANGE**

  After this version, you will need to upgrade the version of @lynx-js/web-core^0.4.0

- 2dd0aef: feat: support performance apis for lynx

  - support `nativeApp.generatePipelineOptions`
  - support `nativeApp.onPipelineStart`
  - support `nativeApp.markPipelineTiming`
  - support `nativeApp.bindPipelineIdWithTimingFlag`

  for lynx developers, the following apis are now supported

  - `lynx.performance.addTimingListener`
  - `__lynx_timing_flag` attribute

  for lynx-view container developers

  - `mainChunkReady` event has been removed
  - add a new `timing` event

### Patch Changes

- 3123b86: fix(web): do not use @scope for safari for enableCSSSelector:false

  We this there is a bug in webkit.

- 585d55a: feat(web): support animation-_ and transition-_ event

  Now we will append the correct `event.params` property for animation events and transition events

  - @lynx-js/web-constants@0.4.0
  - @lynx-js/web-mainthread-apis@0.4.0

## 0.3.1

### Patch Changes

- 9f2ad5e: feat: add worker name for debug

  before this commit, all web workers will be named as `main-thread` or `worker-thread`

  now we name based on it's entryId

- 583c003: fix:

  1. custom-element pre-check before define to avoid duplicate registration.

  2. make sure @lynx-js/lynx-core is bundled into @lynx-js/web-core.

- 61a7014: refractor: migrate to publishEvent
- c3726e8: feat: pre heat the worker runtime at the very beginning

  We cecently found that the worker booting takes some time.

  Here we boot the first 2 workers for the first lynx-view.

  This will help use to improve performance

  - @lynx-js/web-constants@0.3.1
  - @lynx-js/web-mainthread-apis@0.3.1

## 0.3.0

### Minor Changes

- 267c935: feat: make cardType could be configurable
- f44c589: feat: support exports field of the lynx-core

### Patch Changes

- 884e31c: fix: bind lazy rpc handlers
- 6e873bc: fix: incorrect parent component id value on publishComponentEvent
- Updated dependencies [d255d24]
- Updated dependencies [6e873bc]
- Updated dependencies [267c935]
  - @lynx-js/web-mainthread-apis@0.3.0
  - @lynx-js/web-constants@0.3.0

## 0.2.0

### Minor Changes

- 32d47c4: chore: upgrate dep version of web-core

### Patch Changes

- 272db24: refractor: the main-thread worker will be dedicated for every lynx view
  - @lynx-js/web-constants@0.2.0
  - @lynx-js/web-mainthread-apis@0.2.0

## 0.1.0

### Minor Changes

- 78638dc: feat: support invokeUIMethod and setNativeProps
- 06fe3cd: feat: support splitchunk and lynx.requireModuleAsync

  - support splitchunk option of rspeedy
  - add implementation for lynx.requireModuleAsync for both main-thread and background-thread
  - mark worker `ready` after \_OnLifeCycleEvent is assigned

  close #96

- fe0d06f: feat: add onError callback to `LynxCard`

  The onError callback is a wrapper of the ElementAPI `_reportError`.

  This allows the externel caller to detect errors.

- 66ce343: feat: support config `defaultDisplayLinear`
- c43f436: feat: add `dispose()` method for lynxview
- 068f677: feat: suppport createSelectorQuery
- 3547621: feat(web): use `<lynx-wrapper/>` to replace `<div style="display:content"/>`
- d551d81: feat: support customSection

  - support lynx.getCustomSection
  - support lynx.getCustomSectionSync

- f1ddb5a: feat: never need to pass background entry url
- b323923: feat(web): support **ReplaceElement, **CreateImage, \_\_CreateScrollView
- 3a370ab: feat: support global identifier `lynxCoreInject` and `SystemInfo`
- 23e6fa5: feat(web): support enableCSSSelector:false

  We will extract all selectors with single class selector and rules in a Json object.

  These classes will be applied on runtime.

  **About enableCSSSelector:false**

  This flag changes the behaviour of cascading. It provide a way to do this

  ```jsx
  <view class='class-a class-b' />;
  ```

  The class-b will override (cascading) styles of class-a.

- 39cf3ae: feat: improve performance for supporting linear layout

  Before this commit, we'll use `getComputedStyle()` to find out if a dom is a linear container.

  After this commit, we'll use the css variable cyclic toggle pattern and `@container style()`

  This feature requires **Chrome 111, Safari 18**.

  We'll provide a fallback implementation for firefox and legacy browsers.

  After this commit, your `flex-direction`, `flex-shrink`, `flex`, `flex-grow`, `flex-basis` will be transformed to a css variable expression.

- 2973ba5: feat: move lynx main-thread to web worker

  Move The Mainthread of Lynx to a web worker.

  This helps the performance.

- 6327fa8: feat(web): add support for \_\_CreateWrapperElement
- 2047658: feat: support exposure system

  support the following APIs:

  - lynx.stopExposure({sendEvent?:boolean})
  - lynx.resumeExposure()
  - GlobalEvent: 'exposure'
  - GlobalEvent: 'disexposure'
  - uiappear event
  - uidisappear event

- 269bf61: feat: support rspeedy layer model and support sharing chunk between main and background
- c95430c: feat: support `updateData`

  Now developers can do this:

  ```javascript
  const lynxView = createLynxView(configs);
  lynxView.updateData(newData);
  ```

- 29f24aa: feat(web): support removeCSSScope:false

  - add element api `__SetCSSId`
  - add new WebpackPlugin `@lynx-js/web-webpack-plugin`
  - add support for removeCSSSCope
  - pass all configs via thie \*.lepus.js
  - support to scope styles of lynx card for browsers do not support `@scope` and nesting

- 216ed68: feat: add a new <lynx-view> element

  ```
  * @param {string} url [required] The url of the entry of your Lynx card
  * @param {Cloneable} globalProps [optional] The globalProps value of this Lynx card
  * @param {Cloneable} initData [optional] The initial data of this Lynx card
  * @param {Record<string,string>} overrideLynxTagToHTMLTagMap [optional] use this property/attribute to override the lynx tag -> html tag map
  * @param {NativeModulesCallHandler} onNativeModulesCall [optional] the NativeModules.bridge.call value handler. Arguments will be cached before this property is assigned.
  *
  * @property entryId the currently Lynx view entryId.
  *
  * @event error lynx card fired an error
  * @event mainchunkready performance event. All mainthread chunks are ready
  ```

  - HTML Exmaple

  Note that you should declarae the size of lynx-view

  ```html
  <lynx-view
    url="https://path/to/main-thread.js"
    rawData="{}"
    globalProps="{}"
    style="height:300px;width:300px"
  >
  </lynx-view>
  ```

  - React 19 Example

  ```jsx
  <lynx-view url={myLynxCardUrl} rawData={{}} globalProps={{}} style={{height:'300px', width:'300px'}}>
  </lynx-vew>
  ```

- f8d1d98: feat: allow custom elements to be lazy loaded

  After this commit, we'll allow developer to define custom elements lazy.

  A new api `onElementLoad` will be added to the `LynxCard`.

  Once a new element is creating, it will be called with the tag name.

  There is also a simple way to use this feature

  ```javascript
  import { LynxCard } from '@lynx-js/web-core';
  import { loadElement } from '@lynx-js/web-elements/lazy';
  import '@lynx-js/web-elements/index.css';
  import '@lynx-js/web-core/index.css';
  import './index.css';

  const lynxcard = new LynxCard({
    ...beforeConfigs,
    onElementLoad: loadElement,
  });
  ```

- 906e894: feat(web): support dataset & \_\_AddDataset
- 6e003e8: feat(web): support linear layout and add tests
- 2b85d73: feat(web): support Nativemodules.bridge.call
- 0fc1826: feat(web): add \_\_CreateListElement Element API

### Patch Changes

- 238df71: fix(web): fix bugs of Elements
  includes:
  **AddClass,
  **ReplaceElements,
  **GetElementUniqueID,
  **GetConfig,
  **GetChildren,
  **FlushElementTree,
  \_\_SetInlineStyles
- 32952fb: chore: bump target to esnext
- f900b75: refactor: do not use inline style to apply css-in-js styles

  Now you will see your css-in-js styles applied under a `[lynx-unique-id="<id>"]` selector.

- 9c23659: fix(web): \_\_SetAttribute allows the value to be null
- d3acc7b: fix: we should call \_\_FlushElementTree after renderPage
- 314cb44: fix(web): x-textarea replace blur,focus with lynxblur,lynxfocus.
- e170052: chore: remove tslib

  We provide ESNext output for this lib.

- Updated dependencies [987da15]
- Updated dependencies [3e66349]
- Updated dependencies [2b7a4fe]
- Updated dependencies [461d965]
- Updated dependencies [2973ba5]
- Updated dependencies [7ee0dc1]
- Updated dependencies [7c752d9]
- Updated dependencies [29e4684]
- Updated dependencies [068f677]
- Updated dependencies [3547621]
- Updated dependencies [bed4f24]
- Updated dependencies [33691cd]
- Updated dependencies [2047658]
- Updated dependencies [b323923]
- Updated dependencies [39cf3ae]
- Updated dependencies [2973ba5]
- Updated dependencies [917e496]
- Updated dependencies [532380d]
- Updated dependencies [a41965d]
- Updated dependencies [f900b75]
- Updated dependencies [2e0a780]
- Updated dependencies [a7a222b]
- Updated dependencies [f8d1d98]
- Updated dependencies [c04669b]
- Updated dependencies [81be6cf]
- Updated dependencies [f8d1d98]
- Updated dependencies [5018d8f]
- Updated dependencies [c0a482a]
- Updated dependencies [314cb44]
- Updated dependencies [8c6eeb9]
- Updated dependencies [c43f436]
- Updated dependencies [67a70ac]
- Updated dependencies [e0854a8]
- Updated dependencies [e170052]
- Updated dependencies [e86bba0]
- Updated dependencies [1fe49a2]
- Updated dependencies [f0a50b6]
  - @lynx-js/web-elements@0.1.0
  - @lynx-js/web-constants@0.1.0
  - @lynx-js/lynx-core@0.0.1
  - @lynx-js/web-mainthread-apis@0.1.0
