UNPKG

@lynx-js/template-webpack-plugin

Version:

Simplifies creation of Lynx template files to serve your webpack bundles

350 lines (212 loc) 10.2 kB
# @lynx-js/template-webpack-plugin ## 0.8.5 ### Patch Changes - Always inline the background script that contains rspack runtime module. ([#1582](https://github.com/lynx-family/lynx-stack/pull/1582)) - Updated dependencies [[`aaca8f9`](https://github.com/lynx-family/lynx-stack/commit/aaca8f91d177061c7b0430cc5cb21a3602897534)]: - @lynx-js/webpack-runtime-globals@0.0.6 ## 0.8.4 ### Patch Changes - Fix invalid `module.exports=;` syntax in app-service.js. ([#1501](https://github.com/lynx-family/lynx-stack/pull/1501)) ## 0.8.3 ### Patch Changes - feat: support elementTemplate for web ([#1374](https://github.com/lynx-family/lynx-stack/pull/1374)) ## 0.8.2 ### Patch Changes - Fix the `Syntax Error: expecting ';'` error of chunk splitting ([#1279](https://github.com/lynx-family/lynx-stack/pull/1279)) ## 0.8.1 ### Patch Changes - feat: `::placeholder` will be compiled to `part(input)::placeholder`, which means you can use pseudo-element CSS to add placeholder styles to input and textarea. ([#1158](https://github.com/lynx-family/lynx-stack/pull/1158)) ``` // before <input placeholder-color='red' placeholder-font-weight='bold' placeholder-font-size='20px'> // after <input> input::placeholder { color: red; font-weight: bold; font-size: 20px; } ``` - Enable fine-grained control for `output.inlineScripts` ([#883](https://github.com/lynx-family/lynx-stack/pull/883)) ```ts type InlineChunkTestFunction = (params: { size: number; name: string; }) => boolean; type InlineChunkTest = RegExp | InlineChunkTestFunction; type InlineChunkConfig = | boolean | InlineChunkTest | { enable?: boolean | 'auto'; test: InlineChunkTest }; ``` ```ts import { defineConfig } from '@lynx-js/rspeedy'; export default defineConfig({ output: { inlineScripts: ({ name, size }) => { return name.includes('foo') && size < 1000; }, }, }); ``` ## 0.8.0 ### Minor Changes - Remove `EncodeCSSOptions` and `encodeCSS` to ensure consistent encoding options are used across CSS HMR updates and the main template. ([#1033](https://github.com/lynx-family/lynx-stack/pull/1033)) ### Patch Changes - Avoid generating lazy bundles when there are no chunk name. ([#1090](https://github.com/lynx-family/lynx-stack/pull/1090)) E.g.: using `import.meta.webpackContext`. ## 0.7.2 ### Patch Changes - Updated dependencies [[`ccb4254`](https://github.com/lynx-family/lynx-stack/commit/ccb4254cf4008362e2536a473660c4e3453e5a64)]: - @lynx-js/css-serializer@0.1.3 ## 0.7.1 ### Patch Changes - feat: Merge the absent configurations for `.web.bundle`. ([#884](https://github.com/lynx-family/lynx-stack/pull/884)) Before this change, the configuration of pageConfig in `.web.bundle` was `compilerOptions`. After this commit, pageConfig will be a combination of `compilerOptions` and `sourceContent.config`. ## 0.7.0 ### Minor Changes - Rename `lepus` to `mainThreadAssets` in `beforeEmit` hook. ([#901](https://github.com/lynx-family/lynx-stack/pull/901)) - Remove the unused `encodeBinary` option of `LynxEncodePlugin`. ([#880](https://github.com/lynx-family/lynx-stack/pull/880)) ### Patch Changes - Support `output.inlineScripts`, which controls whether to inline scripts into Lynx bundle (`.lynx.bundle`). ([#874](https://github.com/lynx-family/lynx-stack/pull/874)) Only background thread scripts can remain non-inlined, whereas the main thread script is always inlined. example: ```js import { defineConfig } from '@lynx-js/rspeedy'; export default defineConfig({ output: { inlineScripts: false, }, }); ``` - 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) - Add `WebEncodePlugin`. ([#904](https://github.com/lynx-family/lynx-stack/pull/904)) This is previously known as `WebWebpackPlugin` from `@lynx-js/web-webpack-plugin`. - Fix a bug that the `lepus` arg of `beforeEmit` hook does not contains the `root` main chunk of the main thread. ([#898](https://github.com/lynx-family/lynx-stack/pull/898)) ## 0.6.11 ### Patch Changes - Be compatible with rspack-manifest-plugin. ([#812](https://github.com/lynx-family/lynx-stack/pull/812)) Now only the `[name].lynx.bundle` and `[name].web.bundle` would exist in `manifest.json`. See [lynx-family/lynx-stack#763](https://github.com/lynx-family/lynx-stack/issues/763) for details. - Avoid CSS encode crash on Web platform. ([#814](https://github.com/lynx-family/lynx-stack/pull/814)) ## 0.6.10 ### Patch Changes - Fix CSS import order when `enableCSSSelector` is false. ([#609](https://github.com/lynx-family/lynx-stack/pull/609)) When the `enableCSSSelector` option is set to false, style rule priority is inversely related to `@import` order(Lynx CSS engine has the incorrect behavior). Reversing the import order to maintain correct priority is required. For example: ```css @import "0.css"; @import "1.css"; ``` will convert to: ```css @import "1.css"; @import "0.css"; ``` ## 0.6.9 ### Patch Changes - Fix incorrect hash of `background.[contenthash].js` in `.lynx.bundle` files. ([#498](https://github.com/lynx-family/lynx-stack/pull/498)) ## 0.6.8 ### Patch Changes - fix: add enableCSSInvalidation for encodeCSS of css HMR, this will fix pseudo-class (such as `:active`) not working in HMR. ([#435](https://github.com/lynx-family/lynx-stack/pull/435)) ## 0.6.7 ### Patch Changes - fix: merge different chunk groups for same output filename ([#371](https://github.com/lynx-family/lynx-stack/pull/371)) ## 0.6.6 ### Patch Changes - expose main.lynx.bundle to compiler ([#231](https://github.com/lynx-family/lynx-stack/pull/231)) ## 0.6.5 ### Patch Changes - The code of lazy bundle should be minimized. ([#177](https://github.com/lynx-family/lynx-stack/pull/177)) ## 0.6.4 ### Patch Changes - Support NPM provenance. ([#30](https://github.com/lynx-family/lynx-stack/pull/30)) - Use WASM when NAPI is not available. ([#138](https://github.com/lynx-family/lynx-stack/pull/138)) - Add `defaultOverflowVisible` option to `LynxTemplatePlugin`. ([#78](https://github.com/lynx-family/lynx-stack/pull/78)) ```js import { LynxTemplatePlugin } from '@lynx-js/template-webpack-plugin'; new LynxTemplatePlugin({ defaultOverflowVisible: false, }); ``` - Updated dependencies [[`c617453`](https://github.com/lynx-family/lynx-stack/commit/c617453aea967aba702967deb2916b5c883f03bb)]: - @lynx-js/webpack-runtime-globals@0.0.5 - @lynx-js/css-serializer@0.1.2 ## 0.6.3 ### Patch Changes - 1abf8f0: Set the default value of `enableNativeList` to `true`. - 1abf8f0: Add `entryNames` parameter to `beforeEncode` hook. ```js import { LynxTemplatePlugin } from '@lynx-js/template-webpack-plugin'; const hooks = LynxTemplatePlugin.getLynxTemplatePluginHooks(compilation); hooks.beforeEncode.tap('MyPlugin', ({ entryNames }) => { console.log(entryNames); }); ``` - 1abf8f0: Set the default `targetSdkVersion` to 3.2. ## 0.6.2 ### Patch Changes - 1472918: Change the lazy bundle filename to `async/[name].[fullhash].bundle`. ## 0.6.1 ### Patch Changes - ad49fb1: Support CSS HMR for ReactLynx - 1407bac: Avoid special chunk id (e.g. "@scope/some-pkg-react:main-thread") to corrupt main-thread.js ## 0.6.0 ### Minor Changes - a217b02: **BREAKING CHANGE**: Require `@lynx-js/css-extract-webpack-plugin` v0.4.0. - 0d3b44c: **BREAKING CHANGE**: Move `beforeEmit` and `afterEmit` hooks from `LynxEncodePlugin` to `LynxTemplatePlugin`. Use `LynxTemplatePlugin.getLynxTemplatePluginHooks` instead. ```diff - const hooks = LynxEncodePlugin.getLynxEncodePluginHooks() + const hooks = LynxTemplatePlugin.getLynxTemplatePluginHooks() ``` ### Patch Changes - 227823b: Use `async/[name]/template.[fullhash].js` for lazy template. ## 0.5.7 ### Patch Changes - d156485: feat: add the type of `sourceContent` field - 3ca4c67: Add `enableICU` to the options of pluginReactLynx, and change the default value to `false`. - Updated dependencies [1f791a3] - @lynx-js/css-serializer@0.1.1 ## 0.5.6 ### Patch Changes - 39efd7c: Change `enableRemoveCSSScope` defaults from `undefined` to `true`, now `enableRemoveCSSScope` can be: - `true` (by default): All CSS files are treated as global CSS. - `false`: All CSS files are treated as scoped CSS, and only take effect in the component that explicitly imports it. - `undefined`: Only use scoped CSS for CSS Modules, and treat other CSS files as global CSS. Scoped CSS is faster than global CSS, thus you can use CSS Modules to speedy up your CSS if there are performance issues. - a2f8bad: Avoid extra `loadScript` calls. - f1d6095: Add `pipelineSchedulerConfig` option. - Updated dependencies [3bf5830] - @lynx-js/webpack-runtime-globals@0.0.4 ## 0.5.5 ### Patch Changes - 8dd6cca: Revert "perf(webpack/template): make `generatingTemplate` async"([#493](https://github.com/lynx-wg/lynx-stack/pull/493)). ## 0.5.4 ### Patch Changes - 89248b7: Delay the generation of templates in development rebuild. - bf9ec8c: Delete `main-thread.js` in production. ## 0.5.3 ### Patch Changes - 36f8e4c: Add `enableA11y` and `enableAccessibilityElement`. - 84cbdfe: Integrate with `@lynx-js/tasm`. ## 0.5.2 ### Patch Changes - Updated dependencies [f5913e5] - @lynx-js/webpack-runtime-globals@0.0.3 ## 0.1.1 ### Patch Changes - 36e140f: Add missing `enableReuseContext` flag ## 0.1.0 ### Minor Changes - 84e49f5: update @lynx-js/template-webpack-plugin - d05e60b: chore: add more exports of template-webpack-plugin ### Patch Changes - f1ddb5a: fix: return the correct entry chunk of background compilation - Updated dependencies [6c31ddd] - Updated dependencies [51d94d0] - Updated dependencies [36e5ddb] - Updated dependencies [6d05c70] - @lynx-js/css-serializer@0.1.0 - @lynx-js/webpack-runtime-globals@0.0.2