@zohodesk/client_build_tool 0.0.20 → 0.0.22-exp.1

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,16 @@
1
1
  # Changelog and Release Notes
2
2
 
3
+ # v0.0.22 (17-01-2026)
4
+
5
+ **Fix:-**
6
+ - The decodeUnicodeEscapes function was removed from the i18n file emit stage and moved to the getPropertiesAsJSON function.
7
+ - We changed the function invocation location because an additional / was appearing in the i18n output when generating i18n files using numeric indexing.
8
+
9
+ # v0.0.21 (10-01-2026)
10
+
11
+ **Feature:-**
12
+ - Added InjectChunkGraphPlugin and added plc and pfc function new flow
13
+
3
14
  # v0.0.20 (04-02-2026)
4
15
 
5
16
  **Feature:i18n Numeric Indexing Support-**
package/README.md CHANGED
@@ -475,6 +475,17 @@ First Release
475
475
  - 'templates' command to create es for react library
476
476
  # Changelog and Release Notes
477
477
 
478
+ # v0.0.22 (17-01-2026)
479
+
480
+ **Fix:-**
481
+ - The decodeUnicodeEscapes function was removed from the i18n file emit stage and moved to the getPropertiesAsJSON function.
482
+ - We changed the function invocation location because an additional / was appearing in the i18n output when generating i18n files using numeric indexing.
483
+
484
+ # v0.0.21 (10-01-2026)
485
+
486
+ **Feature:-**
487
+ - Added InjectChunkGraphPlugin and added plc and pfc function new flow
488
+
478
489
  # v0.0.20 (04-02-2026)
479
490
 
480
491
  **Feature:i18n Numeric Indexing Support-**
@@ -328,7 +328,8 @@ var _default = {
328
328
  },
329
329
  customLoaders: [],
330
330
  resourceHints: {
331
- allowPrefetchingMultipleChunks: false
331
+ enable: false,
332
+ PreloadChunkNames: []
332
333
  },
333
334
  devModeContentHashAllowedTypes: null,
334
335
  nameTemplateCustomization: null,
@@ -10,7 +10,6 @@ const {
10
10
  } = require('webpack');
11
11
 
12
12
  const {
13
- decodeUnicodeEscapes,
14
13
  getPropertiesAsJSON
15
14
  } = require('../I18nSplitPlugin/utils/propertiesUtils');
16
15
 
@@ -162,7 +161,7 @@ class I18nNumericIndexPlugin {
162
161
  }
163
162
 
164
163
  emitChunk(compilation, filenameTemplate, locale, data, manifest) {
165
- const content = decodeUnicodeEscapes(JSON.stringify(data));
164
+ const content = JSON.stringify(data);
166
165
  const fileContent = `${this.options.jsonpFunc}(${content});`;
167
166
  const contentHash = createHash({
168
167
  outputOptions: compilation.outputOptions,
@@ -36,7 +36,7 @@ function getPropertiesAsJSON(filePath) {
36
36
 
37
37
  const ind = line.indexOf('=');
38
38
  const key = line.slice(0, ind).replace(/\\ /g, ' ');
39
- const value = line.slice(ind + 1);
39
+ const value = decodeUnicodeEscapes(line.slice(ind + 1));
40
40
 
41
41
  if (key && value) {
42
42
  i18nObj[key] = value;
@@ -22,11 +22,8 @@ const pluginName = 'prefetch-preload-chunk-plugin';
22
22
 
23
23
  class ResourceHintsPlugin {
24
24
  constructor({
25
- publicPath,
26
- resourceHints
25
+ publicPath
27
26
  }) {
28
- this.resourceHints = resourceHints;
29
- this.allowPrefetchingMultipleChunks = resourceHints.allowPrefetchingMultipleChunks;
30
27
  this.publicPathsTemplateObj = {
31
28
  js: publicPath,
32
29
  css: publicPath,
@@ -53,7 +50,6 @@ class ResourceHintsPlugin {
53
50
  compilation.addRuntimeModule(entryRuntimeChunk, // eslint-disable-next-line no-use-before-define
54
51
  new ResourceHintsRuntimePlugin(compiler, {
55
52
  chunk: entryRuntimeChunk,
56
- allowPrefetchingMultipleChunks: this.allowPrefetchingMultipleChunks,
57
53
  publicPathsTemplateObj
58
54
  }));
59
55
  };
@@ -69,13 +65,11 @@ exports.default = ResourceHintsPlugin;
69
65
  class ResourceHintsRuntimePlugin extends _webpack.RuntimeModule {
70
66
  constructor(compiler, {
71
67
  chunk,
72
- publicPathsTemplateObj,
73
- allowPrefetchingMultipleChunks
68
+ publicPathsTemplateObj
74
69
  }) {
75
70
  super('ResourceHintsRuntimePlugin loading', 10);
76
71
  this.compiler = compiler;
77
72
  this.publicPathsTemplateObj = publicPathsTemplateObj;
78
- this.allowPrefetchingMultipleChunks = allowPrefetchingMultipleChunks;
79
73
  this.chunk = chunk;
80
74
  }
81
75
 
@@ -85,7 +79,7 @@ class ResourceHintsRuntimePlugin extends _webpack.RuntimeModule {
85
79
  } = this;
86
80
  const idNameMap = chunk.getChunkMaps().name;
87
81
  const nameIdMap = {};
88
- let needsMap = this.allowPrefetchingMultipleChunks;
82
+ let needsMap = false;
89
83
  Object.keys(idNameMap).forEach(key => {
90
84
  const value = idNameMap[key];
91
85
  nameIdMap[value] = key;
@@ -111,7 +105,7 @@ class ResourceHintsRuntimePlugin extends _webpack.RuntimeModule {
111
105
  */
112
106
 
113
107
  return _webpack.Template.asString([`const ntc = ${JSON.stringify(needsMap ? nameIdMap : {})};
114
- const cns = Object.keys(ntc);
108
+ // const cns = Object.keys(ntc);
115
109
 
116
110
  function clt(href, rel) {
117
111
  let link = document.createElement("link");
@@ -129,8 +123,8 @@ class ResourceHintsRuntimePlugin extends _webpack.RuntimeModule {
129
123
  //return !url.includes(".undefined.");
130
124
  return url.indexOf(".undefined") === -1;
131
125
  }
132
- function lpp(_chunkId, rel) {
133
- let chunkId = ${_webpack.RuntimeGlobals.require}.getChunkId(_chunkId);
126
+ function lpp(chunkId, rel) {
127
+ // let chunkId = ${_webpack.RuntimeGlobals.require}.getChunkId(_chunkId);
134
128
  // ${_webpack.RuntimeGlobals.require}.e(chunkId);
135
129
  if(__webpack_require__.O.j(chunkId)) {
136
130
  return;
@@ -145,33 +139,29 @@ class ResourceHintsRuntimePlugin extends _webpack.RuntimeModule {
145
139
  }
146
140
  }
147
141
 
148
- ${_webpack.RuntimeGlobals.require}.getChunkId = function getChunkId(chunkId) {
149
- ${needsMap ? 'chunkId = ntc[chunkId]||chunkId;' : ''}
150
- return chunkId;
142
+ ${_webpack.RuntimeGlobals.require}.getChunkId = function getChunkId(chunkName) {
143
+ return ntc[chunkName]||chunkName;
151
144
  }
152
- ${_webpack.RuntimeGlobals.require}.getChunkIds = function getChunkIds(chunkId) {
153
- ${// eslint-disable-next-line no-nested-ternary
154
- this.allowPrefetchingMultipleChunks ? `
155
- const isRegExAsChunkId = chunkId instanceof RegExp;
156
- if(isRegExAsChunkId) {
157
- return cns.filter(chunkName => chunkId.test(chunkName)).map(chunkName => ntc[chunkName]);
158
- }
159
- return [${_webpack.RuntimeGlobals.require}.getChunkId(chunkId)];
160
- ` : `return [${_webpack.RuntimeGlobals.require}.getChunkId(chunkId)];`}
161
- }
162
- // Prefetch a chunk (${pluginName})
163
- ${_webpack.RuntimeGlobals.require}.pfc = function prefetchChunk(chunkId) {
145
+
146
+ // Preload a chunk (${pluginName})
147
+ ${_webpack.RuntimeGlobals.require}.plc = function preloadChunk(chunkId) {
148
+ const preloadChunkGraph = __PRELOAD_CHUNK_GRAPH__
164
149
  ${`
165
- let chunkIds = ${_webpack.RuntimeGlobals.require}.getChunkIds(chunkId);
166
- chunkIds.forEach(idOfAChunk => {
167
- ${_webpack.RuntimeGlobals.require}.e(idOfAChunk);
168
- })`}
150
+ if (typeof preloadChunkGraph !== 'object' || !preloadChunkGraph) return;
151
+ preloadChunkGraph[chunkId].forEach(idOfAChunk => {
152
+ ${_webpack.RuntimeGlobals.require}.e(idOfAChunk);
153
+ })
154
+ // let idOfAChunk = ${_webpack.RuntimeGlobals.require}.getChunkId(chunkId);
155
+ // chunkIds.forEach(idOfAChunk => {
156
+ // ${_webpack.RuntimeGlobals.require}.e(idOfAChunk);
157
+ // })
158
+ `}
169
159
  };
170
160
 
171
- // Preload a chunk (${pluginName})
172
- ${_webpack.RuntimeGlobals.require}.plc = function preloadChunk(chunkId) {
173
- let idOfAChunk = ${_webpack.RuntimeGlobals.require}.getChunkIds(chunkId)[0];
174
- lpp(idOfAChunk, "preload");
161
+ // Prefetch a chunk (${pluginName})
162
+ ${_webpack.RuntimeGlobals.require}.pfc = function prefetchChunk(chunkId) {
163
+ let idOfAChunk = ${_webpack.RuntimeGlobals.require}.getChunkId(chunkId);
164
+ lpp(idOfAChunk, "prefetch");
175
165
  }
176
166
  ` // `// Prefetch a chunk (${pluginName})`,
177
167
  // `${RuntimeGlobals.require}.pfc = function prefetchChunk(chunkId) {`,
@@ -190,4 +180,17 @@ class ResourceHintsRuntimePlugin extends _webpack.RuntimeModule {
190
180
  ]);
191
181
  }
192
182
 
193
- }
183
+ } // ${RuntimeGlobals.require}.getChunkIds = function getChunkIds(chunkId) {
184
+ // ${
185
+ // // eslint-disable-next-line no-nested-ternary
186
+ // this.allowPrefetchingMultipleChunks
187
+ // ? `
188
+ // const isRegExAsChunkId = chunkId instanceof RegExp;
189
+ // if(isRegExAsChunkId) {
190
+ // return cns.filter(chunkName => chunkId.test(chunkName)).map(chunkName => ntc[chunkName]);
191
+ // }
192
+ // return [${RuntimeGlobals.require}.getChunkId(chunkId)];
193
+ // `
194
+ // : `return [${RuntimeGlobals.require}.getChunkId(chunkId)];`
195
+ // }
196
+ // }
@@ -7,7 +7,7 @@ exports.configHtmlTemplateLoader = configHtmlTemplateLoader;
7
7
 
8
8
  function configHtmlTemplateLoader(options) {
9
9
  return {
10
- test: /\.tmpl$/,
10
+ test: /\.tmpl$|\.html$/,
11
11
  use: [{
12
12
  loader: 'html-loader',
13
13
  options: {
@@ -14,8 +14,12 @@ function configResourceHintsPlugin(options) {
14
14
  publicPath,
15
15
  resourceHints
16
16
  } = options;
17
- return new _ResourceHintsPlugin.default({
18
- resourceHints,
19
- publicPath: JSON.stringify(publicPath)
20
- });
17
+
18
+ if (resourceHints.enable) {
19
+ return new _ResourceHintsPlugin.default({
20
+ publicPath: JSON.stringify(publicPath)
21
+ });
22
+ }
23
+
24
+ return null;
21
25
  }
@@ -63,5 +63,5 @@ function plugins(options) {
63
63
  const {
64
64
  webpackPlugins
65
65
  } = options;
66
- return [(0, _configEnvVariables.configEnvVariables)(options), (0, _configCustomAttributesPlugin.configCustomAttributesPlugin)(options), (0, _configTPHashMappingPlugin.configTPHashMappingPlugin)(options), (0, _configCopyPublicFolders.configCopyPublicFolders)(options), (0, _configIgnorePlugin.configIgnorePlugin)(options), (0, _configMiniCSSExtractPlugin.configMiniCSSExtractPlugin)(options), (0, _configSelectorWeightPlugin.configSelectorWeightPlugin)(options), (0, _configVariableConversionPlugin.configVariableConversionPlugin)(options), (0, _configI18nSplitPlugin.configI18nSplitPlugin)(options), (0, _configRtlCssPlugin.configRtlCssPlugin)(options), (0, _configHtmlWebpackPlugin.configHtmlWebpackPlugin)(options), (0, _configI18nNumericIndexPlugin.configI18nNumericIndexPlugin)(options), (0, _configCustomScriptLoadingStrategyPlugin.configCustomScriptLoadingStrategyPlugin)(options), (0, _configCdnChangePlugin.configCdnChangePlugin)(options), (0, _configServiceWorkerPlugin.configServiceWorkerPlugin)(options), (0, _configEFCTemplatePlugin.configEFCTemplatePlugin)(options), (0, _configResourceHintsPlugin.configResourceHintsPlugin)(options), (0, _configBundleAnalyzer.configBundleAnalyzer)(options), (0, _configManifestJsonPlugin.configManifestJsonPlugin)(options), (0, _configSourceMapPlugin.configSourceMapPlugin)(options), (0, _configProgressPlugin.configProgressPlugin)(options), (0, _configBundleIntegrityReport.configBundleIntegrityReport)(options), (0, _configRuntimeResourceCleanup.configRuntimeResourceCleanup)(options), (0, _configMurphyInjectorPlugin.configMurphyInjectorPlugin)(options), (0, _configCssCustomOrderPlugin.configCssCustomOrderPlugin)(options), (0, _configChunkHierarchyPlugin.configChunkHierarchyPlugin)(options), ...webpackPlugins].filter(Boolean);
66
+ return [(0, _configEnvVariables.configEnvVariables)(options), (0, _configCustomAttributesPlugin.configCustomAttributesPlugin)(options), (0, _configTPHashMappingPlugin.configTPHashMappingPlugin)(options), (0, _configCopyPublicFolders.configCopyPublicFolders)(options), (0, _configIgnorePlugin.configIgnorePlugin)(options), (0, _configMiniCSSExtractPlugin.configMiniCSSExtractPlugin)(options), (0, _configSelectorWeightPlugin.configSelectorWeightPlugin)(options), (0, _configVariableConversionPlugin.configVariableConversionPlugin)(options), (0, _configI18nSplitPlugin.configI18nSplitPlugin)(options), (0, _configRtlCssPlugin.configRtlCssPlugin)(options), (0, _configHtmlWebpackPlugin.configHtmlWebpackPlugin)(options), (0, _configI18nNumericIndexPlugin.configI18nNumericIndexPlugin)(options), (0, _configCustomScriptLoadingStrategyPlugin.configCustomScriptLoadingStrategyPlugin)(options), (0, _configCdnChangePlugin.configCdnChangePlugin)(options), (0, _configServiceWorkerPlugin.configServiceWorkerPlugin)(options), (0, _configEFCTemplatePlugin.configEFCTemplatePlugin)(options), (0, _configResourceHintsPlugin.configResourceHintsPlugin)(options), (0, _configBundleAnalyzer.configBundleAnalyzer)(options), (0, _configManifestJsonPlugin.configManifestJsonPlugin)(options), (0, _configSourceMapPlugin.configSourceMapPlugin)(options), (0, _configProgressPlugin.configProgressPlugin)(options), (0, _configBundleIntegrityReport.configBundleIntegrityReport)(options), (0, _configRuntimeResourceCleanup.configRuntimeResourceCleanup)(options), (0, _configMurphyInjectorPlugin.configMurphyInjectorPlugin)(options), (0, _configCssCustomOrderPlugin.configCssCustomOrderPlugin)(options), (0, _configChunkHierarchyPlugin.configChunkHierarchyPlugin)(options), (0, _configInjectChunkGraphPlugin.configInjectChunkGraphPlugin)(options), ...webpackPlugins].filter(Boolean);
67
67
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zohodesk/client_build_tool",
3
- "version": "0.0.20",
3
+ "version": "0.0.22-exp.1",
4
4
  "description": "A CLI tool to build web applications and client libraries",
5
5
  "main": "lib/index.js",
6
6
  "bin": {