From c18486a55bdf7b8ffbb347161c665447a53f12a4 Mon Sep 17 00:00:00 2001 From: zodern Date: Wed, 13 Apr 2022 15:59:50 -0500 Subject: [PATCH 1/5] Add _dataUsed property to prelink resources The bundler expects this property to know if it should watch the resource. --- tools/isobuild/unibuild.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tools/isobuild/unibuild.js b/tools/isobuild/unibuild.js index 77c9410b2f..e1e1fbf38f 100644 --- a/tools/isobuild/unibuild.js +++ b/tools/isobuild/unibuild.js @@ -120,6 +120,10 @@ export class Unibuild { _.each(unibuildJson.resources, function (resource) { rejectBadPath(resource.file); + if (resource.type === 'head') { + console.dir(resource); + } + const data = files.readBufferWithLengthAndOffset( files.pathJoin(unibuildBasePath, resource.file), resource.length, @@ -153,7 +157,10 @@ export class Unibuild { usesDefaultSourceProcessor: true, legacyPrelink: { packageVariables: unibuildJson.packageVariables || [] - } + }, + // Only published packages still use prelink resources, + // so there is no need to mark this file to be watched + _dataUsed: false }; if (resource.sourceMap) { From a541c5042789f2a2abe580048687710010280f82 Mon Sep 17 00:00:00 2001 From: zodern Date: Wed, 13 Apr 2022 16:03:02 -0500 Subject: [PATCH 2/5] Improve error messages from readBufferWithLengthAndOffset --- tools/fs/files.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/fs/files.ts b/tools/fs/files.ts index d259204052..432b210def 100644 --- a/tools/fs/files.ts +++ b/tools/fs/files.ts @@ -1432,6 +1432,9 @@ export function readBufferWithLengthAndOffset( if (count !== length) { throw new Error("couldn't read entire resource"); } + } catch (err: any) { + err.message = `Error while reading ${filename}: ` + err.message; + throw err; } finally { close(fd); } From 4d66a8d36f21aae569f7236d12e363f6e1fa0328 Mon Sep 17 00:00:00 2001 From: zodern Date: Wed, 13 Apr 2022 16:09:13 -0500 Subject: [PATCH 3/5] Remove extra log --- tools/isobuild/unibuild.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/tools/isobuild/unibuild.js b/tools/isobuild/unibuild.js index e1e1fbf38f..fafb7a8543 100644 --- a/tools/isobuild/unibuild.js +++ b/tools/isobuild/unibuild.js @@ -120,10 +120,6 @@ export class Unibuild { _.each(unibuildJson.resources, function (resource) { rejectBadPath(resource.file); - if (resource.type === 'head') { - console.dir(resource); - } - const data = files.readBufferWithLengthAndOffset( files.pathJoin(unibuildBasePath, resource.file), resource.length, From 40842143ae65a944eb04870d5c90f7d97c00c177 Mon Sep 17 00:00:00 2001 From: zodern Date: Wed, 13 Apr 2022 16:10:40 -0500 Subject: [PATCH 4/5] Remove outdated comment on warehouse path --- tools/packaging/tropohouse.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/tools/packaging/tropohouse.js b/tools/packaging/tropohouse.js index 65c3af4c08..f63e3e30aa 100644 --- a/tools/packaging/tropohouse.js +++ b/tools/packaging/tropohouse.js @@ -29,9 +29,6 @@ var defaultWarehouseDir = function () { var warehouseBase = files.inCheckout() ? files.getCurrentToolsDir() : files.getHomeDir(); - // XXX This will be `.meteor` soon, once we've written the code to make the - // tropohouse and warehouse live together in harmony (eg, allowing tropohouse - // tools to springboard to warehouse tools). return files.pathJoin(warehouseBase, ".meteor"); }; From 8f4644fb7ccea1f7e86288fa74981846654d3a33 Mon Sep 17 00:00:00 2001 From: zodern Date: Wed, 13 Apr 2022 16:11:12 -0500 Subject: [PATCH 5/5] Remove unnecessary comment --- packages/hot-module-replacement/server.js | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/hot-module-replacement/server.js b/packages/hot-module-replacement/server.js index a6d7d5122a..2f3b8462e2 100644 --- a/packages/hot-module-replacement/server.js +++ b/packages/hot-module-replacement/server.js @@ -1,4 +1,3 @@ -// METEOR_PARENT_PID if (process.env.METEOR_HMR_SECRET) { __meteor_runtime_config__._hmrSecret = process.env.METEOR_HMR_SECRET; } else if (process.env.METEOR_PARENT_PID) {