这是开发预览网站。请访问正式文档 lynxjs.org

@lynx-js/web-core

0.20.2

Patch Changes

  • fix: map clientX and clientY to x and y in touch event detail (#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)

  • refactor: with WeakRef in element APIs and WASM bindings to improve memory management. (#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)

  • fix: avoid to do use-after-free for rust instance (#2461)

  • fix: Change uniqueId to uid in LynxCrossThreadEventTarget (#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)

    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:

    <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:

    <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)

    • 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:

      <lynx-view
        url="https://example.com/template.js"
        transform-rem="true"
      ></lynx-view>
      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, 59d11b2]:

    • @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)

    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):

      // 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):

      // 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)

    This is a breaking change

    The following Styles has been added to web-core

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

    Check MDN for the details about these styles:

    how it works?

    For the following code

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

    it will be transformed to

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

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

    <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)

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

    For the following code

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

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

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

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

    <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)

  • chore: update readme (#2380)

  • fix: the output format should be module (#2388)

  • opt: use opt-level 3 to compile wasm (#2371)

  • fix(web-core): avoid partial bundle loading and double fetching when fetchBundle is called concurrently for the same url. (#2386)

  • fix(web-core): fallback to the original export chunk when processEvalResult is absent during queryComponent execution (#2399)

  • fix: tokenizing inline style values correctly to support rpx and ppx unit conversion (#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)

  • fix: mts in lazy component (#2375)

  • fix: enableJSDataProcessor not work (#2372)

  • feat: add ppx unit support for CSS, transforming to calc(... * var(--ppx-unit)) directly. (#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)

  • fix: avoid error when LynxView is removed immediately after connected (#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)

    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)

  • feat: support lynx.reload() (#2127)

  • Updated dependencies [179f984, f7133c1, 6c2b51a, 556fe9f, 5b589ab]:

    • @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)

  • Updated dependencies [a91173c]:

    • @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]:
    • @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]:
    • @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)

    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)

  • 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)

  • Updated dependencies [f7256d5]:

    • @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)

Patch Changes

  • Updated dependencies [40c3a1a, 46bd5ee]:
    • @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)

  • 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, e1db63f, ebc1a60]:
    • @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)

  • 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)

    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]:

    • @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)

    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:

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

Patch Changes

  • Updated dependencies [77397fd, 7d90ed5]:
    • @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)

    • 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]:

    • @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)

    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)

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

  • fix: avoid duplicate style transformation (#1748)

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

  • fix: add sandbox attribute to iframe for enhanced security (#1709)

  • fix: the default template loader won't fetch twice for one url (#1709)

  • Updated dependencies [721635d, 93d707b, d150ed4]:

    • @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)

  • feat: supports lazy bundle. (This feature requires @lynx-js/lynx-core >= 0.1.3) (#1235)

  • Updated dependencies [608f375]:

    • @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)

    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)

  • feat: remove multi-thread mts heating (#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)

  • Updated dependencies [1a32dd8, bb53d9a, 1a32dd8, c1f8715]:

    • @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)

  • Updated dependencies [70863fb]:

    • @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)

  • refactor: use utf-8 string (#1473)

  • Fix mtsGlobalThis race condition in createRenderAllOnUI (#1506)

  • Updated dependencies [405a917, b8f89e2, f76aae9, b8b060b, d8381a5, 214898b, ab8cee4]:

    • @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)

    See nodejs/node#59362 for more details.

  • feat: support path() for createQuerySelector (#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)

  • fix: onNativeModulesCall && onNapiModulesCall use getter to get. (#1466)

  • Updated dependencies [29434ae, fb7096b]:

    • @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

0.15.3

Patch Changes

  • fix: improve compatibility with legacy template (#1337)

    avoid "object Object" error for old version rspeedy outputs

  • Updated dependencies [0da5ef0]:

    • @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)

  • feat: move SSR hydrate essential info to the ssr attribute (#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)

  • feat: mark template elements for SSR and update part ID handling (#1286)

  • Updated dependencies [cebda59, 1443e46, 5062128, f656b7f]:

    • @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)

    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)

  • 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)

  • perf: use rust implemented style transformer (#1094)

  • Updated dependencies [7b75469, f54a7aa, 224c653]:

    • @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)

  • chore: extract shared logic from web-core and web-core-server's loadTemplate into a unified generateTemplate function (#1211)

  • Updated dependencies [e44b146, 5a9b38b, 6ca5b91]:

    • @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)

  • fix: under the all-on-ui strategy, reload() will add two page elements. (#1147)

  • Updated dependencies [a64333e, 7751375, b52a924]:

    • @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)

    This is a breaking change!!!

Patch Changes

  • feat: add _SetSourceMapRelease(errInfo) MTS API. (#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)

    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.

    // 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)

  • feat: supports lynx.getI18nResource() and onI18nResourceReady event in bts. (#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)

    #1042

  • feat: The error event return value detail of lynx-view adds sourceMap value, the type is as follows: (#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)

    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)

  • Updated dependencies [42ed2e3, 25a04c9, 0dbb8b1, f99de1e, 873a285, afacb2c, 1861cbe]:

    • @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)

    It's essential for SSR

  • refactor: avoid to create many style element for cssog (#1026)

  • refactor: move component config info to attribute (#984)

  • fix: ensure render starts after dom connected (#1020)

  • refactor: save dataset on an attribute (#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)

  • Updated dependencies [70b82d2, 5651e24, 9499ea9, 50f0193, 57bf0ef, 5651e24, 0525fbf, b6b87fd, c014327]:

    • @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)

  • feat: supports lynx.getElementById() && animate(). (#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, 75e5b2f, 569618d, f9f88d6]:

    • @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)

    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)

    • 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)

  • Updated dependencies [bb1f9d8, b6e27da, 3d716d7]:

    • @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)

    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://v8.dev/blog/explicit-compile-hints

  • feat: add new property inject-style-rules for LynxView (#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)

  • Updated dependencies [03a5f64, 6d3d852, 8cdd288, 6d3d852]:

    • @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)

    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)

    now we support

    • main-thread:bindtouchstart
    • main-thread:bindtouchend
    • main-thread:bindtouchmove
    • main-thread:bindtouchcancel
  • feat: add SystemInfo.screenWidth and SystemInfo.screenHeight (#641)

  • Updated dependencies [c9ccad6, 9ad394e, f4cfb70, c9ccad6, 839d61c]:

    • @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)

    Never assign SystemInfo on worker's self object.

  • feat: support thread strategy all-on-ui (#625)

    <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)

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

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

  • Updated dependencies [4ee0465, 74b5bd1, 06bb78a, 5a3d9af, 5269cab, 74b5bd1, 2b069f8]:

    • @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)

    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)

    lynxView.customTemplateLoader = (url) => {
      return (await (await fetch(url, {
        method: 'GET',
      })).json());
    };
  • feat: support mts event with target methods (#564)

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

  • fix: crash on removing a id attribute (#582)

  • Updated dependencies [f1ca29b]:

    • @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)

    refactor some internal logic

    • __OnLifeCycleEvent
    • __OnNativeAppReady

Patch Changes

  • feat: support mts event handler (1/n) (#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)

    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)

  • Updated dependencies [ea42e62, a0f5ca4]:

    • @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)

    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)

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

  • Updated dependencies [1af3b60]:

    • @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)

    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)

    Now we moved the timing system to the background thread.

  • feat: support defaultOverflowVisible config (#406)

  • fix(web): rsbuild will bundle 2 exactly same chunk for two same new Worker stmt (#372)

    the bundle size will be optimized about 28.2KB

  • fix: inline style will be removed for value number 0 (#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)

  • fix: publicComponentEvent args order (#401)

  • Updated dependencies [3a8dabd, a521759, 890c6c5]:

    • @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)

    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)

    "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:

    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)

    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)

  • refactor: clean the decodeOperations implementation (#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)

  • refactor: remove customelement defined detecting logic (#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)

  • Updated dependencies [5b5e090, b844e75, 53230f0, 6f16827, d2d55ef]:

    • @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)

    • 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)

    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)

    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)

  • Improve LynxView resize observer cleanup (#124)

  • feat: add two prop of lynx-view about napiLoader: (#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:

    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,
    };
    1. 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
    lynxView.onNapiModulesCall = (name, data, moduleName) => {
      if (name === 'getColor' && moduleName === 'color_methods') {
        return data.color;
      }
    };
  • Updated dependencies [eab1328, e9e8370, ec4e1ce, f0a717c]:

    • @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)

  • fix: some valus should be updateable by global scope (#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)

    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)

  • Updated dependencies [c617453, 2044571, 7da7601]:

    • @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.
    export type NativeModuleHandlerContext = {
      nativeModulesCall: (name: string, data: Cloneable) => Promise<Cloneable>;
    };

    a simple case:

    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' },
      ),
    );
    1. 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:

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

    Now you should use it like this:

    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:

    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

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

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

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

    What we actually want is

    .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

    <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:

    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 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

    <lynx-view
      url="https://path/to/main-thread.js"
      rawData="{}"
      globalProps="{}"
      style="height:300px;width:300px"
    >
    </lynx-view>
    • React 19 Example
    <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

    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