Skip to content

fix(angular): remove dangling sourceMappingURL from published bundle - #6690

Open
riccardoperra wants to merge 3 commits into
mainfrom
fix/table-issue-6686
Open

riccardoperra wants to merge 3 commits into
mainfrom
fix/table-issue-6686

Conversation

@riccardoperra

@riccardoperra riccardoperra commented Dec 2, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #6686

🎯 Changes

The published dist/fesm2022/tanstack-angular-table.mjs ends with //# sourceMappingURL=tanstack-angular-table.mjs.map, but the package ships no .map files. Tools that follow the comment fail to load the map. The Vite dev server, for example, logs an ENOENT stack trace on every start.

ng-packagr always emits source maps for the FESM bundles. It passes sourcemap: true to rolldown, and neither ng-package.json nor the tsconfig can turn that off (checked on 22.2.6, 22.3.0, and main). The build already deleted the .map files, as decided in #6427, but it left the comment in place. The other two entry points only re-export from table-core, so they never got a map or a comment.

This PR replaces the shell cleanup after ng-packagr with packages/angular-table/scripts/postbuild.js. The script:

  • removes the package.json that ng-packagr writes to dist (this replaces rimraf ./dist/package.json),
  • deletes the .map files,
  • strips the trailing sourceMappingURL comment from the .mjs bundles.

The package still ships no source maps. scripts/ is not in files, so the script is not published.

Verified on a packed tarball: it contains no .map files and no sourceMappingURL comments. publint --strict, sherif, and knip pass.

✅ Checklist

  • I have followed the steps in the Contributing guide.
  • I have tested code changes locally with pnpm test and pnpm test:e2e, or these tests do not apply to this pull request.
  • I fully understand the code in this pull request, including any code generated with AI assistance.

🚀 Release Impact

  • This change affects published code, and I have generated a changeset.
  • This change is docs/CI/dev-only (no release).

Summary by CodeRabbit

Chores

  • Updated the Angular Table package’s published build output to omit source-map files and embedded source-map references. This is a packaging change only: the package’s public API, runtime functionality, and table configuration remain unchanged. No new user-facing features or behavior changes are included in this release.

ng-packagr always emits source maps for FESM bundles. The build deleted the
.map files but left the sourceMappingURL comment in tanstack-angular-table.mjs,
so tools like the Vite dev server failed to load the missing map.

Closes #6686
@riccardoperra
riccardoperra requested a review from a team as a code owner December 2, 2026 07:31
@changeset-bot

changeset-bot Bot commented Dec 2, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 396383c

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@tanstack/angular-table Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai

coderabbitai Bot commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The Angular Table build now runs a postbuild script that removes dist/package.json, deletes .map files, and removes matching trailing source-mapping comments from .mjs bundles. A changeset records a patch release.

Changes: Angular Table source map cleanup

Layer / File(s) Summary
Distribution cleanup
packages/angular-table/scripts/postbuild.js, packages/angular-table/package.json, .changeset/angular-table-no-source-map-comment.md
The build runs a postbuild script after ng-packagr. The script recursively lists dist, removes package.json and .map files, and removes matching trailing source-mapping comments from .mjs bundles. The changeset records a patch release.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Low

Suggested reviewers: kevinvandy

Merge Risk: Minimal · up to 39638

The change removes the dangling source map comment from the published Angular Table bundle while still shipping no source maps. No merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: removing the dangling sourceMappingURL comment from the published Angular table bundle. The raw summary confirms a postbuild script strips that comment from the .mjs b…
Description check Passed The description follows the template. It has the Changes section explaining the dangling sourceMappingURL comment, the cause in ng-packagr, and the postbuild.js replacement. It links issue #6686, mark…
Linked Issues check Passed Issue #6686 requires either publishing tanstack-angular-table.mjs.map or building the published main entry without the dangling sourceMappingURL comment. The PR keeps maps unpublished and removes the …
Out of Scope Changes check Passed All changed files relate to issue #6686. The changeset .changeset/angular-table-no-source-map-comment.md documents a patch release that removes the sourceMappingURL comment. The packages/angular-table…
Full details: Title check

Explanation

The title names the main change: removing the dangling sourceMappingURL comment from the published Angular table bundle. The raw summary confirms a postbuild script strips that comment from the .mjs bundle, so the title matches the changeset.

Full details: Description check

Explanation

The description follows the template. It has the Changes section explaining the dangling sourceMappingURL comment, the cause in ng-packagr, and the postbuild.js replacement. It links issue #6686, marks the checklist, and marks the changeset box as published-code impact. Test boxes stay unchecked, but the description says the tarball was verified and publint, sherif, and knip pass. It does not say pnpm test or pnpm test:e2e ran.

Full details: Linked Issues check

Explanation

Issue #6686 requires either publishing tanstack-angular-table.mjs.map or building the published main entry without the dangling sourceMappingURL comment. The PR keeps maps unpublished and removes the comment. At head, packages/angular-table/scripts/postbuild.js runs after ng-packagr. It removes dist/package.json, deletes every .map file under dist, and applies the regex /\s*//# sourceMappingURL=\S+.map\s*$/ to each .mjs file, replacing the match with a newline and writing the file only when the content changed. The regex matches the trailing comment that ng-packagr emits. The other two FESM entries have no comment, so they are left unchanged. The package.json build script change is shown only in the AI summary (+1/-1, replacing rimraf and find with node ./scripts/postbuild.js). The diff text for that file was not readable, so the wiring relies on the summary. No automated test was added. The issue does not request one, and the PR checklist does not report test runs. These points do not change the coding-requirement result.

Full details: Out of Scope Changes check

Explanation

All changed files relate to issue #6686. The changeset .changeset/angular-table-no-source-map-comment.md documents a patch release that removes the sourceMappingURL comment. The packages/angular-table/package.json change routes the build cleanup through the new script. The postbuild.js script performs the deletion of dist/package.json, the .map files, and the comment removal. The script's file-listing and removal logic serves only the dist cleanup. The summary reports no changes to exported or public declarations. The packages/angular-table/scripts/ directory is not in files, so the script is not published. The package.json diff text was not readable, so this result relies on the AI summary for that file.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between fa70e6c and 396383c.

Files selected for processing: 2

  • packages/angular-table/package.json
  • packages/angular-table/scripts/postbuild.js

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

@nx-cloud

nx-cloud Bot commented Dec 2, 2026 •

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit 396383c

Command Status Duration Result
nx affected --targets=test:eslint,test:sherif,t... ✅ Succeeded 2m 4s View ↗
nx run-many --targets=build --exclude=examples/** ✅ Succeeded 29s View ↗

💡 With Ultracache enabled, Nx Cloud learns each task's file inputs in CI and uses them on later runs. Turn on Ultracache in workspace settings ↗ · Read docs ↗


☁️ Nx Cloud last updated this comment at 2026-12-02 07:39:19 UTC

@github-actions

github-actions Bot commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

🚀 Changeset Version Preview

1 package(s) bumped directly, 0 bumped as dependents.

🟩 Patch bumps

Package Version Reason
@tanstack/angular-table 9.3.2 → 9.3.3 Changeset

@pkg-pr-new

pkg-pr-new Bot commented Dec 2, 2026

Copy link
Copy Markdown
More templates

@tanstack/alpine-table

npm i https://pkg.pr.new/@tanstack/alpine-table@6690

@tanstack/angular-table

npm i https://pkg.pr.new/@tanstack/angular-table@6690

@tanstack/angular-table-devtools

npm i https://pkg.pr.new/@tanstack/angular-table-devtools@6690

@tanstack/ember-table

npm i https://pkg.pr.new/@tanstack/ember-table@6690

@tanstack/lit-table

npm i https://pkg.pr.new/@tanstack/lit-table@6690

@tanstack/match-sorter-utils

npm i https://pkg.pr.new/@tanstack/match-sorter-utils@6690

@tanstack/octane-table

npm i https://pkg.pr.new/@tanstack/octane-table@6690

@tanstack/preact-table

npm i https://pkg.pr.new/@tanstack/preact-table@6690

@tanstack/preact-table-devtools

npm i https://pkg.pr.new/@tanstack/preact-table-devtools@6690

@tanstack/react-table

npm i https://pkg.pr.new/@tanstack/react-table@6690

@tanstack/react-table-devtools

npm i https://pkg.pr.new/@tanstack/react-table-devtools@6690

@tanstack/solid-table

npm i https://pkg.pr.new/@tanstack/solid-table@6690

@tanstack/solid-table-devtools

npm i https://pkg.pr.new/@tanstack/solid-table-devtools@6690

@tanstack/svelte-table

npm i https://pkg.pr.new/@tanstack/svelte-table@6690

@tanstack/table-core

npm i https://pkg.pr.new/@tanstack/table-core@6690

@tanstack/table-devtools

npm i https://pkg.pr.new/@tanstack/table-devtools@6690

@tanstack/vue-table

npm i https://pkg.pr.new/@tanstack/vue-table@6690

@tanstack/vue-table-devtools

npm i https://pkg.pr.new/@tanstack/vue-table-devtools@6690

commit: 396383c

@riccardoperra riccardoperra self-assigned this Dec 2, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

angular-table: published tanstack-angular-table.mjs references a .map file that is not in the package

1 participant