This repository was archived by the owner on Jan 6, 2026. It is now read-only.
Fix build verification by stripping debug calls from all builds#1753
Merged
NullVoxPopuli merged 5 commits intomainfrom Jun 2, 2025
Merged
Fix build verification by stripping debug calls from all builds#1753NullVoxPopuli merged 5 commits intomainfrom
NullVoxPopuli merged 5 commits intomainfrom
Conversation
Contributor
|
9a226e2 to
ddaa9ff
Compare
Debug functions like check(), expect(), and unwrap() from @glimmer/debug are meant only for local development and must not appear in any published builds. This commit adds a Babel plugin to the build pipeline that strips these calls from both development and production builds. Changes: - Add @glimmer/local-debug-babel-plugin to build pipeline - Configure plugin to strip debug calls after TypeScript compilation - Remove build-verify.mjs and its CI reference as debug stripping is now automatic - Work around pnpm ecosystem peer dependency conflicts in CI floating dependencies test - Add comprehensive documentation about build constraints - Document debug assertion usage for developers The solution uses the existing @glimmer/local-debug-babel-plugin that was already in the codebase but not integrated into the build process. This ensures developers can continue using debug assertions freely while the build system automatically removes them from published packages.
The build verification script was deleted as part of integrating automatic debug stripping via Babel plugin. The repo metadata needs to be updated to reflect this change.
Improve robustness of the metadata update script by adding: - Try-catch blocks around pnpm execution and JSON parsing - Validation that package.json files exist before reading - Proper error messages for debugging - Type assertions to fix TypeScript safety issues - Replace process.exit() with thrown errors per linting rules Also removed problematic @pnpm/* dependencies from repo-metadata package.json and fixed the floating dependencies CI job.
Remove npm metadata artifacts that were contaminating package.json during development (bugs, readme errors, _id, homepage, author format changes). Exclude root package.json from package updater processing to prevent property reordering that causes Verify CI check failures.
a8e6b19 to
cea7cf0
Compare
NullVoxPopuli
approved these changes
Jun 2, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR fixes the CI build verification failure by integrating the existing
@glimmer/local-debug-babel-plugininto the build pipeline to automatically strip debug code from all published builds.Problem
Debug functions like
check(),expect(), andunwrap()from@glimmer/debugwere appearing in production builds. These functions are meant only for Glimmer VM developers working on the codebase itself and should never ship to users.Solution
Instead of relying on a verification script that checks for debug code after the fact, we now automatically strip it during the build process using the Babel plugin that was already in the codebase but not integrated.
Changes
@rollup/plugin-babelto enable Babel transformationsImpact
check(),expect(), etc.)Technical Details
The Babel plugin transforms debug code during build:
check(value, checker)→valueexpect(...)→ removed entirelyunwrap(value)→valuerecordStackSize()→ removed entirelyCheckInterface→() => trueThis happens for ALL builds (both development and production) because these debug functions are only for Glimmer VM development, not for users of Glimmer.