From eb6038a084e1a35103f22357e3531758adbbae6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nacho=20Codo=C3=B1er?= Date: Mon, 8 Sep 2025 22:25:00 +0200 Subject: [PATCH 1/4] ignore core-runtime from externalHelpers --- packages/babel-compiler/babel-compiler.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/babel-compiler/babel-compiler.js b/packages/babel-compiler/babel-compiler.js index 7bfceb32d1..a33dc79a96 100644 --- a/packages/babel-compiler/babel-compiler.js +++ b/packages/babel-compiler/babel-compiler.js @@ -358,7 +358,7 @@ BCp.processOneFileForTarget = function (inputFile, source) { ...(hasSwcHelpersAvailable && !isNodeTarget && (packageName == null || - !['modules-runtime'].includes(packageName)) && { + !['core-runtime', 'modules-runtime'].includes(packageName)) && { externalHelpers: true, }), }, From 18e976b3170810f9c3842fbfbfacfdf258e030fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nacho=20Codo=C3=B1er?= Date: Tue, 9 Sep 2025 09:51:08 +0200 Subject: [PATCH 2/4] add a fallback on detect rspack builds and attempt to fix a published Meteor version --- packages/babel-compiler/babel-compiler.js | 28 +++++++++++++++++++---- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/packages/babel-compiler/babel-compiler.js b/packages/babel-compiler/babel-compiler.js index a33dc79a96..31f754c5ed 100644 --- a/packages/babel-compiler/babel-compiler.js +++ b/packages/babel-compiler/babel-compiler.js @@ -246,7 +246,10 @@ BCp.processOneFileForTarget = function (inputFile, source) { // Check if the file is a Rspack output file // If it is, bypass SWC/Babel and just read the file and its map file // as the contents are already transpiled by Rspack. - if (Plugin?.rspackHelpers?.isRspackOutputFile(inputFilePath)) { +if (process.env.METEOR_SKIP_OUTPUT_FILE_PROCESSING !== 'true' && + (Plugin?.rspackHelpers?.isRspackOutputFile(inputFilePath) || + inputFilePath.includes('-rspack.js')) + ) { try { // Get the full path to the file const fullPath = inputFile.getPathInPackage(); @@ -260,6 +263,17 @@ BCp.processOneFileForTarget = function (inputFile, source) { toBeAdded.sourceMap = JSON.parse(mapContent); } + if (this.isVerbose()) { + const arch = inputFile.getArch(); + logTranspilation({ + usedRspack: true, + inputFilePath, + packageName, + cacheHit: true, + arch, + }); + } + return toBeAdded; } catch (e) { // If there's an error reading the file or map, log it and continue with normal processing @@ -358,7 +372,9 @@ BCp.processOneFileForTarget = function (inputFile, source) { ...(hasSwcHelpersAvailable && !isNodeTarget && (packageName == null || - !['core-runtime', 'modules-runtime'].includes(packageName)) && { + !['core-runtime', 'modules', 'modules-runtime'].includes( + packageName, + )) && { externalHelpers: true, }), }, @@ -1123,14 +1139,16 @@ function logTranspilation({ packageName, inputFilePath, usedSwc, + usedRspack, cacheHit, isNodeModulesCode, arch, errorMessage = '', tip = '', }) { - const transpiler = usedSwc ? 'SWC' : 'Babel'; - const transpilerColor = usedSwc ? 32 : 33; + let transpiler = usedSwc ? 'SWC' : 'Babel'; + transpiler = usedRspack ? 'Rspack' : transpiler; + const transpilerColor = usedSwc || usedRspack ? 32 : 33; const label = color('[Transpiler]', 36); const transpilerPart = `${label} Used ${color( transpiler, @@ -1153,7 +1171,7 @@ function logTranspilation({ : color(originPaddedRaw, 35); const cacheStatus = errorMessage ? color('āš ļø Fallback', 33) - : usedSwc + : usedSwc || usedRspack ? cacheHit ? color('🟢 Cache hit', 32) : color('šŸ”“ Cache miss', 31) From c47d3caa8f8283436e073756ce4739268a34d45a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nacho=20Codo=C3=B1er?= Date: Tue, 9 Sep 2025 10:35:50 +0200 Subject: [PATCH 3/4] fix command to be properly copied and used --- packages/rspack/lib/dependencies.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/rspack/lib/dependencies.js b/packages/rspack/lib/dependencies.js index df9bdebf11..60867007c2 100644 --- a/packages/rspack/lib/dependencies.js +++ b/packages/rspack/lib/dependencies.js @@ -113,8 +113,8 @@ async function ensureDependenciesInstalled(dependencies, globalStateKey, package if (!success) { const isYarnProj = process.env.YARN_ENABLED === 'true'; const installCommand = isYarnProj - ? `yarn add --dev ${joinWithAnd(dependencyStrings)}` - : `meteor npm install -D ${joinWithAnd(dependencyStrings)}`; + ? `yarn add --dev ${dependencyStrings.join(' ').trim()}` + : `meteor npm install -D ${dependencyStrings.join(' ').trim()}`; logError(`\nā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€`); logError(`│ āŒ ${packageName} Installation Failed`); From b5890e36391d1519b21aacc24b9cf2a02c12a42c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nacho=20Codo=C3=B1er?= Date: Tue, 9 Sep 2025 11:24:12 +0200 Subject: [PATCH 4/4] temporary verbose babel process --- packages/babel-compiler/babel-compiler.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/babel-compiler/babel-compiler.js b/packages/babel-compiler/babel-compiler.js index 31f754c5ed..42ede06d3e 100644 --- a/packages/babel-compiler/babel-compiler.js +++ b/packages/babel-compiler/babel-compiler.js @@ -243,6 +243,13 @@ BCp.processOneFileForTarget = function (inputFile, source) { bare: !! fileOptions.bare }; + if (process.env.METEOR_VERBOSE === 'true') { + console.log('inputFilePath', inputFilePath, inputFile.getPathInPackage()); + console.log('Plugin?.rspackHelpers?.isRspackOutputFile', Plugin?.rspackHelpers?.isRspackOutputFile); + console.log('Plugin?.rspackHelpers?.rspackFilePattern', Plugin?.rspackHelpers?.rspackFilePattern); + console.log('Plugin?.rspackHelpers?.isRspackOutputFile(inputFilePath)', Plugin?.rspackHelpers?.isRspackOutputFile(inputFilePath)); + } + // Check if the file is a Rspack output file // If it is, bypass SWC/Babel and just read the file and its map file // as the contents are already transpiled by Rspack.