Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate from tsimp to swc #555

Merged
merged 3 commits into from
Jan 6, 2025
Merged

Migrate from tsimp to swc #555

merged 3 commits into from
Jan 6, 2025

Conversation

mattdean-digicatapult
Copy link
Contributor

Pull Request

Checklist

  • Have you read Digital Catapult's Code of Conduct?
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have made corresponding changes to the documentation.
  • My changes generate no new warnings.
  • I have added tests that prove my fix is effective or that my feature works.
  • New and existing unit tests pass locally with my changes.

PR Type

Please delete options that are irrelevant.

  • Bug Fix
  • Chore
  • Feature
  • Documentation Update
  • Code style update (formatting, local variables)
  • Breaking Change (fix or feature that would cause existing functionality to change)

Linked tickets

https://digicatapult.atlassian.net/browse/SQNC-20

High level description

Migrate from using tsimp as our typescript runtime compiler to using swc

Detailed description

Similar to digicatapult/veritable-ui#172.

Note there's a known bug with swc-node where node_modules imports with a package ending in .js fails (see swc-project/swc-node#865). We hit this as polkadot.js uses bn.js internally. The workaround here involves implementing our own shim that bypasses swc-node in this particular case.

Note I've additionally tested brining this up in a built container and it all works

Describe alternatives you've considered

Not upgrading until swc-node fixes this. Note though that this bug has been reported for several weeks with no sign of it being fixed. Hence I'm putting this forward as an alternative so we can move away from tsimp which is just not production ready.

Operational impact

None

Additional context

N/A

@mattdean-digicatapult mattdean-digicatapult added the v:patch Change requires a semver patch version change label Jan 6, 2025
@mattdean-digicatapult mattdean-digicatapult marked this pull request as ready for review January 6, 2025 14:57
@mattdean-digicatapult mattdean-digicatapult requested a review from a team as a code owner January 6, 2025 14:57
@mattdean-digicatapult mattdean-digicatapult merged commit f79af40 into main Jan 6, 2025
9 checks passed
@mattdean-digicatapult mattdean-digicatapult deleted the chore/tsimp-to-swc branch January 6, 2025 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
v:patch Change requires a semver patch version change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants