react-on-rails-pro-node-renderer 16.5.0 → 16.6.0-rc.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.
- package/lib/shared/configBuilder.d.ts +3 -1
- package/lib/shared/configBuilder.d.ts.map +1 -1
- package/lib/shared/configBuilder.js +83 -8
- package/lib/shared/configBuilder.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/worker/handleRenderRequest.d.ts +1 -0
- package/lib/worker/handleRenderRequest.d.ts.map +1 -1
- package/lib/worker/handleRenderRequest.js +13 -9
- package/lib/worker/handleRenderRequest.js.map +1 -1
- package/lib/worker.d.ts.map +1 -1
- package/lib/worker.js +57 -70
- package/lib/worker.js.map +1 -1
- package/package.json +3 -3
- package/src/shared/configBuilder.ts +100 -11
- package/src/worker/handleRenderRequest.ts +14 -11
- package/src/worker.ts +70 -85
- package/tests/configBuilder.test.ts +323 -8
- package/tests/uploadRaceCondition.test.ts +9 -9
- package/tests/worker.test.ts +27 -2
package/tests/worker.test.ts
CHANGED
|
@@ -332,7 +332,7 @@ describe('worker', () => {
|
|
|
332
332
|
protocolVersion,
|
|
333
333
|
railsEnv,
|
|
334
334
|
password: 'my_password',
|
|
335
|
-
|
|
335
|
+
[`bundle_${bundleHash}`]: createReadStream(getFixtureBundle()),
|
|
336
336
|
asset1: createReadStream(getFixtureAsset()),
|
|
337
337
|
asset2: createReadStream(getOtherFixtureAsset()),
|
|
338
338
|
});
|
|
@@ -342,6 +342,30 @@ describe('worker', () => {
|
|
|
342
342
|
expect(fs.existsSync(assetPathOther(testName, bundleHash))).toBe(true);
|
|
343
343
|
});
|
|
344
344
|
|
|
345
|
+
test('post /upload-assets ignores targetBundles when bundle_<hash> fields are present (backward compat)', async () => {
|
|
346
|
+
const bundleHash = 'compat-bundle-hash';
|
|
347
|
+
|
|
348
|
+
const app = worker({
|
|
349
|
+
serverBundleCachePath: serverBundleCachePathForTest(),
|
|
350
|
+
password: 'my_password',
|
|
351
|
+
});
|
|
352
|
+
|
|
353
|
+
// Simulates the Ruby client sending both bundle_<hash> (new) and targetBundles (legacy).
|
|
354
|
+
// The endpoint should derive targets from bundle_<hash> and ignore targetBundles.
|
|
355
|
+
const form = formAutoContent({
|
|
356
|
+
gemVersion,
|
|
357
|
+
protocolVersion,
|
|
358
|
+
railsEnv,
|
|
359
|
+
password: 'my_password',
|
|
360
|
+
[`bundle_${bundleHash}`]: createReadStream(getFixtureBundle()),
|
|
361
|
+
targetBundles: [bundleHash],
|
|
362
|
+
asset1: createReadStream(getFixtureAsset()),
|
|
363
|
+
});
|
|
364
|
+
const res = await app.inject().post(`/upload-assets`).payload(form.payload).headers(form.headers).end();
|
|
365
|
+
expect(res.statusCode).toBe(200);
|
|
366
|
+
expect(fs.existsSync(assetPath(testName, bundleHash))).toBe(true);
|
|
367
|
+
});
|
|
368
|
+
|
|
345
369
|
test('post /upload-assets with multiple bundles and assets', async () => {
|
|
346
370
|
const bundleHash = 'some-bundle-hash';
|
|
347
371
|
const bundleHashOther = 'some-other-bundle-hash';
|
|
@@ -356,7 +380,8 @@ describe('worker', () => {
|
|
|
356
380
|
protocolVersion,
|
|
357
381
|
railsEnv,
|
|
358
382
|
password: 'my_password',
|
|
359
|
-
|
|
383
|
+
[`bundle_${bundleHash}`]: createReadStream(getFixtureBundle()),
|
|
384
|
+
[`bundle_${bundleHashOther}`]: createReadStream(getFixtureSecondaryBundle()),
|
|
360
385
|
asset1: createReadStream(getFixtureAsset()),
|
|
361
386
|
asset2: createReadStream(getOtherFixtureAsset()),
|
|
362
387
|
});
|