@lynx-js/template-webpack-plugin-canary 0.10.0 → 0.10.1-canary-20251225-cd89bf9e

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @lynx-js/template-webpack-plugin
2
2
 
3
+ ## 0.10.1-canary-20251225070735-cd89bf9e3fc8ed4658dfb6c983584376416d620f
4
+
5
+ ### Patch Changes
6
+
7
+ - fix: pass updated css from encodeData to resolvedEncodeOptions ([#2053](https://github.com/lynx-family/lynx-stack/pull/2053))
8
+
9
+ Previously, the initial CSS was used in resolvedEncodeOptions instead of the potentially updated CSS from encodeData after the beforeEncode hook. This fix ensures resolvedEncodeOptions receives the latest CSS data.
10
+
3
11
  ## 0.10.0
4
12
 
5
13
  ### Minor Changes
@@ -98,16 +106,16 @@
98
106
  type InlineChunkConfig =
99
107
  | boolean
100
108
  | InlineChunkTest
101
- | { enable?: boolean | 'auto'; test: InlineChunkTest };
109
+ | { enable?: boolean | "auto"; test: InlineChunkTest };
102
110
  ```
103
111
 
104
112
  ```ts
105
- import { defineConfig } from '@lynx-js/rspeedy';
113
+ import { defineConfig } from "@lynx-js/rspeedy";
106
114
 
107
115
  export default defineConfig({
108
116
  output: {
109
117
  inlineScripts: ({ name, size }) => {
110
- return name.includes('foo') && size < 1000;
118
+ return name.includes("foo") && size < 1000;
111
119
  },
112
120
  },
113
121
  });
@@ -157,7 +165,7 @@
157
165
  example:
158
166
 
159
167
  ```js
160
- import { defineConfig } from '@lynx-js/rspeedy';
168
+ import { defineConfig } from "@lynx-js/rspeedy";
161
169
 
162
170
  export default defineConfig({
163
171
  output: {
@@ -252,7 +260,7 @@
252
260
  - Add `defaultOverflowVisible` option to `LynxTemplatePlugin`. ([#78](https://github.com/lynx-family/lynx-stack/pull/78))
253
261
 
254
262
  ```js
255
- import { LynxTemplatePlugin } from '@lynx-js/template-webpack-plugin';
263
+ import { LynxTemplatePlugin } from "@lynx-js/template-webpack-plugin";
256
264
 
257
265
  new LynxTemplatePlugin({
258
266
  defaultOverflowVisible: false,
@@ -271,10 +279,10 @@
271
279
  - 1abf8f0: Add `entryNames` parameter to `beforeEncode` hook.
272
280
 
273
281
  ```js
274
- import { LynxTemplatePlugin } from '@lynx-js/template-webpack-plugin';
282
+ import { LynxTemplatePlugin } from "@lynx-js/template-webpack-plugin";
275
283
 
276
284
  const hooks = LynxTemplatePlugin.getLynxTemplatePluginHooks(compilation);
277
- hooks.beforeEncode.tap('MyPlugin', ({ entryNames }) => {
285
+ hooks.beforeEncode.tap("MyPlugin", ({ entryNames }) => {
278
286
  console.log(entryNames);
279
287
  });
280
288
  ```
@@ -266,7 +266,7 @@ class LynxTemplatePluginImpl {
266
266
  const { customCSSInheritanceList, debugInfoOutside, defaultDisplayLinear, enableA11y, enableAccessibilityElement, enableCSSInheritance, enableCSSInvalidation, enableCSSSelector, enableNewGesture, enableRemoveCSSScope, removeDescendantSelectorScope, targetSdkVersion, defaultOverflowVisible, dsl, cssPlugins, } = this.#options;
267
267
  const isDev = process.env['NODE_ENV'] === 'development'
268
268
  || compiler.options.mode === 'development';
269
- const css = cssChunksToMap(assetsInfoByGroups.css
269
+ const initialCSS = cssChunksToMap(assetsInfoByGroups.css
270
270
  .map(chunk => compilation.getAsset(chunk.name))
271
271
  .filter((v) => !!v)
272
272
  .map(asset => asset.source.source().toString()), cssPlugins, enableCSSSelector);
@@ -303,7 +303,7 @@ class LynxTemplatePluginImpl {
303
303
  },
304
304
  },
305
305
  css: {
306
- ...css,
306
+ ...initialCSS,
307
307
  chunks: assetsInfoByGroups.css,
308
308
  },
309
309
  lepusCode: {
@@ -329,7 +329,7 @@ class LynxTemplatePluginImpl {
329
329
  filenameTemplate,
330
330
  entryNames,
331
331
  });
332
- const { lepusCode } = encodeData;
332
+ const { lepusCode, css } = encodeData;
333
333
  const resolvedEncodeOptions = {
334
334
  ...encodeData,
335
335
  css: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lynx-js/template-webpack-plugin-canary",
3
- "version": "0.10.0",
3
+ "version": "0.10.1-canary-20251225-cd89bf9e",
4
4
  "description": "Simplifies creation of Lynx template files to serve your webpack bundles",
5
5
  "keywords": [
6
6
  "webpack",
@@ -40,7 +40,7 @@
40
40
  "object.groupby": "^1.0.3"
41
41
  },
42
42
  "devDependencies": {
43
- "@microsoft/api-extractor": "7.52.15",
43
+ "@microsoft/api-extractor": "7.55.2",
44
44
  "@types/css-tree": "^2.3.11",
45
45
  "@types/object.groupby": "^1.0.4",
46
46
  "css-loader": "^7.1.2",