Skip to content

feat: Add source mapping option to unplugin - #2942

Open
aleksanderkatan wants to merge 41 commits into
mainfrom
feat/source-mapping
Open

aleksanderkatan wants to merge 41 commits into
mainfrom
feat/source-mapping

Conversation

@aleksanderkatan

@aleksanderkatan aleksanderkatan commented Aug 28, 2026 •

Copy link
Copy Markdown
Member

Many changes relate to combining source maps (so that a correct location is displayed when another plugin fired before typegpu unplugin).
This works natively on Babel, and there is a workaround for rollup implemented. It does not work on webpack and some other plugins (we fall back to node position, this will still work as long as there was no other plugin before).

@github-actions

github-actions Bot commented Aug 28, 2026 •

Copy link
Copy Markdown

pkg.pr.new

packages
Ready to be installed by your favorite package manager ⬇️

https://pkg.pr.new/software-mansion/TypeGPU/tgpu-gen@97917d381467e3a1fc536f07d1b021c5f935b957
https://pkg.pr.new/software-mansion/TypeGPU/typegpu@97917d381467e3a1fc536f07d1b021c5f935b957
https://pkg.pr.new/software-mansion/TypeGPU/@typegpu/cli@97917d381467e3a1fc536f07d1b021c5f935b957
https://pkg.pr.new/software-mansion/TypeGPU/@typegpu/gl@97917d381467e3a1fc536f07d1b021c5f935b957
https://pkg.pr.new/software-mansion/TypeGPU/unplugin-typegpu@97917d381467e3a1fc536f07d1b021c5f935b957

benchmark
view benchmark

commit
view commit

@github-actions

github-actions Bot commented Aug 28, 2026 •

Copy link
Copy Markdown

Bundle size comparison (import * as ... in PR vs import * as ... in target):

🟢 Decreased ➖ Unchanged 🔴 Increased (max 0.03%) ❔ Unknown
0 343 12 0

No notable changes.

If you wish to run a comparison for other, slower bundlers, run the 'Tree-shake test' from the GitHub Actions menu.

@aleksanderkatan aleksanderkatan mentioned this pull request Sep 4, 2026
3 of 9 tasks
@aleksanderkatan aleksanderkatan changed the title [WIP] feat(unplugin-typegpu): Source mapping feat: Source mapping in unplugin Sep 16, 2026
@aleksanderkatan
aleksanderkatan force-pushed the feat/source-mapping branch 2 times, most recently from 251b52d to bf24534 Compare September 16, 2026 11:23
@aleksanderkatan
aleksanderkatan changed the base branch from main to feat/embed-sourcemaps September 16, 2026 11:23
@aleksanderkatan

Copy link
Copy Markdown
Member Author

@pullfrog review

pullfrog[bot]

This comment was marked as outdated.

@pullfrog

This comment was marked as outdated.

@github-actions

github-actions Bot commented Sep 17, 2026 •

Copy link
Copy Markdown

Resolution Time Benchmark

---
config:
  themeVariables:
    xyChart:
      plotColorPalette: "#E63946, #3B82F6, #059669"
---
xychart
  title "Random Branching (🔴 PR | 🔵 main | 🟢 release)"
  x-axis "max depth" [1, 2, 3, 4, 5, 6, 7, 8]
  y-axis "time (ms)"
  line [0.80, 1.80, 3.86, 5.82, 7.32, 12.00, 23.51, 21.86]
  line [0.86, 1.70, 3.54, 5.30, 7.00, 11.09, 21.91, 23.54]
  line [0.85, 1.76, 3.57, 5.56, 6.43, 11.24, 22.19, 23.29]
Loading
---
config:
  themeVariables:
    xyChart:
      plotColorPalette: "#E63946, #3B82F6, #059669"
---
xychart
  title "Linear Recursion (🔴 PR | 🔵 main | 🟢 release)"
  x-axis "max depth" [1, 2, 3, 4, 5, 6, 7, 8]
  y-axis "time (ms)"
  line [0.24, 0.46, 0.62, 0.74, 1.03, 1.03, 1.28, 1.42]
  line [0.28, 0.47, 0.61, 0.73, 1.00, 1.06, 1.30, 1.38]
  line [0.30, 0.47, 0.63, 0.75, 1.05, 1.09, 1.32, 1.39]
Loading
---
config:
  themeVariables:
    xyChart:
      plotColorPalette: "#E63946, #3B82F6, #059669"
---
xychart
  title "Full Tree (🔴 PR | 🔵 main | 🟢 release)"
  x-axis "max depth" [1, 2, 3, 4, 5, 6, 7, 8]
  y-axis "time (ms)"
  line [0.74, 2.01, 3.35, 6.34, 11.50, 23.85, 53.83, 104.15]
  line [0.76, 2.05, 3.32, 6.38, 11.83, 23.13, 52.00, 103.93]
  line [1.05, 2.17, 3.85, 6.91, 11.69, 23.16, 50.70, 103.06]
Loading

@aleksanderkatan

Copy link
Copy Markdown
Member Author

@pullfrog review

pullfrog[bot]

This comment was marked as outdated.

@aleksanderkatan aleksanderkatan changed the title feat: Source mapping in unplugin feat: Add source mapping option to unplugin Sep 18, 2026
@aleksanderkatan
aleksanderkatan marked this pull request as ready for review September 18, 2026 14:52
Copilot AI lite review requested due to automatic review settings September 18, 2026 14:52

This comment was marked as outdated.

Base automatically changed from feat/embed-sourcemaps to main October 15, 2026 08:35

@iwoplaza iwoplaza left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Just take a look at 🐸's comment about the warnings

Comment thread packages/unplugin-typegpu/test/transform.ts Outdated
pullfrog[bot]

This comment was marked as outdated.

@aleksanderkatan

Copy link
Copy Markdown
Member Author

Just take a look at 🐸's comment about the warnings

I made the warning fire only once by adding a module scoped flag.
Multiple warns may still appear when the plugin is run by multiple processes

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes — the single authored commit since the prior pullfrog review (9cbb21d), which fixes the test regression that review flagged.

  • Webpack warning tests isolated — test/sourceMaps.test.ts now calls vi.resetModules() and re-imports webpackTransform before each warning assertion, so the module-global warnAboutSourceMapsOnce flag starts fresh per test.
  • New once-only coverage — a [WEBPACK] warns only once test asserts the guard emits exactly one warning across two transforms.
  • Snapshot refreshed — the fallback-warning snapshot now matches the [unplugin-typegpu] message text.

The prior CAUTION is resolved: pnpm vitest run --project='!browser' packages/unplugin-typegpu/ is green at 3159b8c (12 files, 179 passed). The previously open inline thread on sourceMaps.test.ts was retired.

Pullfrog  | View workflow run | Using deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏

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.

3 participants