@gravity-ui/app-builder 0.24.1-beta.1 → 0.25.0

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.
@@ -95,22 +95,9 @@ async function buildDevServer(config) {
95
95
  }));
96
96
  }
97
97
  }
98
- // Rspack multicompiler dont work with lazy compilation.
99
- // Pass a single config to avoid multicompiler when SSR disabled.
100
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
101
- const compiler = bundler === 'rspack'
102
- ? (0, core_1.rspack)(isSsr ? rspackConfigs : rspackConfigs[0])
103
- : (0, webpack_1.default)(webpackConfigs);
104
98
  const staticFolder = path.resolve(paths_1.default.appDist, 'public');
105
99
  const options = {
106
100
  static: staticFolder,
107
- setupMiddlewares(middlewares) {
108
- if (config.client.lazyCompilation && bundler === 'rspack') {
109
- const lazyCompilationMiddleware = core_1.rspack.experiments.lazyCompilationMiddleware(compiler, rspackConfigs[0]?.experiments?.lazyCompilation);
110
- return [lazyCompilationMiddleware, ...middlewares];
111
- }
112
- return middlewares;
113
- },
114
101
  devMiddleware: {
115
102
  publicPath,
116
103
  stats: 'errors-warnings',
@@ -185,9 +172,14 @@ async function buildDevServer(config) {
185
172
  options.proxy = proxy;
186
173
  let server;
187
174
  if (bundler === 'rspack') {
175
+ // Rspack multicompiler dont work with lazy compilation.
176
+ // Pass a single config to avoid multicompiler when SSR disabled.
177
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
178
+ const compiler = (0, core_1.rspack)(isSsr ? rspackConfigs : rspackConfigs[0]);
188
179
  server = new dev_server_1.RspackDevServer(options, compiler);
189
180
  }
190
181
  else {
182
+ const compiler = (0, webpack_1.default)(webpackConfigs);
191
183
  server = new webpack_dev_server_1.default(options, compiler);
192
184
  }
193
185
  try {
@@ -288,14 +288,26 @@ function configureRspackExperiments(options) {
288
288
  return undefined;
289
289
  }
290
290
  let lazyCompilation;
291
+ let port;
291
292
  if (config.lazyCompilation) {
293
+ if (typeof config.lazyCompilation === 'object') {
294
+ port = config.lazyCompilation.port;
295
+ }
292
296
  lazyCompilation = {
293
297
  // Lazy compilation works without problems only with lazy imports
294
298
  // See https://github.com/web-infra-dev/rspack/issues/8503
295
299
  entries: false,
296
300
  imports: true,
297
- serverUrl: `http://localhost:${config.lazyCompilation.port}`,
298
- client: require.resolve('./lazy-client.js'),
301
+ backend: {
302
+ client: require.resolve('./lazy-client.js'),
303
+ ...(port
304
+ ? {
305
+ listen: {
306
+ port,
307
+ },
308
+ }
309
+ : {}),
310
+ },
299
311
  test(module) {
300
312
  // make sure that lazy-client.js won't be lazy compiled)
301
313
  return !module.nameForCondition()?.endsWith('lazy-client.js');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gravity-ui/app-builder",
3
- "version": "0.24.1-beta.1",
3
+ "version": "0.25.0",
4
4
  "description": "Develop and build your React client-server projects, powered by typescript and webpack",
5
5
  "license": "MIT",
6
6
  "type": "commonjs",
@@ -70,11 +70,11 @@
70
70
  "@babel/runtime": "^7.26.0",
71
71
  "@okikio/sharedworker": "^1.0.7",
72
72
  "@pmmmwh/react-refresh-webpack-plugin": "^0.5.15",
73
- "@rsdoctor/rspack-plugin": "^1.0.1",
74
- "@rsdoctor/webpack-plugin": "^1.0.1",
75
- "@rspack/core": "1.3.4",
76
- "@rspack/dev-server": "^1.1.1",
77
- "@rspack/plugin-react-refresh": "^1.2.0",
73
+ "@rsdoctor/rspack-plugin": "^0.4.13",
74
+ "@rsdoctor/webpack-plugin": "^0.4.13",
75
+ "@rspack/core": "1.2.8",
76
+ "@rspack/dev-server": "^1.0.10",
77
+ "@rspack/plugin-react-refresh": "^1.0.1",
78
78
  "@statoscope/webpack-plugin": "^5.29.0",
79
79
  "@statoscope/stats": "^5.28.1",
80
80
  "@statoscope/stats-extension-compressed": "^5.28.1",