github lynx-family/lynx-stack @lynx-js/web-platform-rsbuild-plugin@0.1.0

latest releases: @lynx-js/offscreen-document@0.1.4, @lynx-js/cache-events-webpack-plugin@0.0.2, @lynx-js/web-constants@0.16.0...
4 months ago

Minor Changes

  • feat: add new parameter nativeModulesPath to pluginWebPlatform({}). (#668)

    After this commit, you can use nativeModulesPath to package custom nativeModules directly into the worker, and no longer need to pass nativeModulesMap to lynx-view.

    Here is an example:

    • native-modules.ts:
    // index.native-modules.ts
    export default {
      CustomModule: function(NativeModules, NativeModulesCall) {
        return {
          async getColor(data, callback) {
            const color = await NativeModulesCall('getColor', data);
            callback(color);
          },
        };
      },
    };
    • plugin config:
    // rsbuild.config.ts
    import { pluginWebPlatform } from '@lynx-js/web-platform-rsbuild-plugin';
    import { defineConfig } from '@rsbuild/core';
    
    export default defineConfig({
      plugins: [
        pluginWebPlatform({
          // replace with your actual native-modules file path
          nativeModulesPath: path.resolve(__dirname, './index.native-modules.ts'),
        }),
      ],
    });
  • feat: Provides Rsbuild plugin for Web projects in Lynx Web Platform, currently supports polyfill about lynx. (#606)

Don't miss a new lynx-stack release

NewReleases is sending notifications on new releases.