Skip to content

chore(tinyest-for-wgsl): remove the deprecated transpileFn and transpileNode - #3038

Open
dchaudhari7177 wants to merge 1 commit into
software-mansion:mainfrom
dchaudhari7177:chore/3002-remove-legacy-transpile
Open

dchaudhari7177 wants to merge 1 commit into
software-mansion:mainfrom
dchaudhari7177:chore/3002-remove-legacy-transpile

Conversation

@dchaudhari7177

Copy link
Copy Markdown

Description

Closes #3002. transpileFn and transpileNode were the legacy parser's entry points, kept behind a @deprecated tag after transpileAcornFn / transpileBabelFn (and their Node variants) replaced them. This removes them, and with them:

  • createLegacyTraspilers(), whose only job was to merge the acorn and babel object-expression handling so one parser could take either node kind;
  • the 'legacy' kind of createParser, and the lazily built legacyParser it was for;
  • the now-unused transpileAcornProperty / transpileBabelObjectProperty imports in parsers.ts (they are still used by the acorn and babel transpilers themselves, in transpilers.ts).

packages/tinyest-for-wgsl/src/index.ts stops re-exporting the two names.

The legacy transpileFn describe block was the only caller left in the repo. Its four tests are real coverage — object keys of every kind, computed properties, and the spread / object-method rejections — so instead of deleting them they now run through dualTest, which exercises the acorn and babel parsers. Every inline snapshot is unchanged, i.e. both parsers already produce exactly what the legacy one did for these inputs.

Testing

$ npx vitest run --project='!browser' packages/tinyest-for-wgsl
26 passed (26)
$ npx vitest run --project='!browser' packages/tinyest-for-wgsl packages/typegpu
2470 passed (2470)
$ pnpm --filter tinyest-for-wgsl test:types
clean
$ npx oxlint -c oxlint.config.ts --max-warnings=0 packages/tinyest-for-wgsl
Found 0 warnings and 0 errors.
$ oxfmt --check   (on LF copies of the three changed files; on this Windows checkout oxfmt
                   flags every CRLF file, including ones this PR does not touch)
All matched files use the correct format.

pnpm test:unit also reports 4 failures in tgpu-gen's outputPathCompiler.test.ts and the docs probability example. Those reproduce identically on main with this branch stashed, so they are not from this change.

I did not add a changeset, since tinyest-for-wgsl's deprecated surface is internal tooling rather than the documented typegpu API — happy to add one if you'd rather record it.

…ileNode

Both were the legacy parser's entry points, kept behind a @deprecated tag
after transpileAcornFn/transpileBabelFn (and their Node variants) replaced
them. Removing them also removes createLegacyTraspilers, whose only job was
to merge the acorn and babel object-expression handling for the combined
parser, and the 'legacy' kind of createParser.

The four object-expression tests that only ran through the legacy parser now
run through dualTest, so both parsers are covered and every inline snapshot
is unchanged.
Copilot AI lite review requested due to automatic review settings September 17, 2026 18:18

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@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

  • Removed the deprecated transpileFn / transpileNode — dropped from src/index.ts and src/parsers.ts, along with createLegacyTraspilers(), the 'legacy' parser kind, and the lazy legacyParser singleton.
  • Simplified createParser — its kind parameter is now 'acorn' | 'babel'; the now-unused transpileAcornProperty / transpileBabelObjectProperty imports were dropped (they remain in use inside transpilers.ts).
  • Migrated the legacy tests to dualTest — the four object-expression cases (identifier/literal keys, computed props, spread rejection, object-method rejection) now run through both transpileBabelFn and transpileAcornFn with unchanged inline snapshots, so the coverage is strictly wider than before.

I ran the package's unit tests (26 passed) and test:types (clean), and confirmed no in-repo consumer imports the removed names — unplugin-typegpu uses transpileBabelFn, and no legacy/Legacy references remain.

ℹ️ On the missing changeset

The repo has no changeset tooling — there is no .changeset/ directory, and the root pnpm changes script (tgpu-dev-cli changes) only lists changed packages between release and main to help write release notes. Version bumps are done manually at release time per CONTRIBUTING.md, so no changeset file is expected here. The breaking removal is intentional and already tracked by #3002's breaking change label.

Pullfrog  | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

@cieplypolar

Copy link
Copy Markdown
Collaborator

Thank you, but it has to wait for typegpu@0.14.0

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.

chore: Remove legacy transpileFn and transpileNode

3 participants