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

Try replacing tsc with tsup as build tool #1727

Merged
merged 148 commits into from
Apr 5, 2023
Merged

Try replacing tsc with tsup as build tool #1727

merged 148 commits into from
Apr 5, 2023

Conversation

Janpot
Copy link
Member

@Janpot Janpot commented Mar 3, 2023

Running into trouble using modules from toolpad-app/src/** in the cli because they depend on ESM-only modules (execa, node-fetch@3, fractional-indexing, open-editor). The current setup makes it impossible to use these modules in a commonjs context (e.g. like the new CLI). tsc doesn't allow for transpiling dependencies. Proposing in this PR to move to tsup, which allows marking certain modules as noExternal. This can be used to bundle ESM only modules in the CLI.

  • makes it possible to bundle ESM-only modules so we can use them in node.js
  • increased performance
  • Found a few missing dependencies in @mui/toolpad-components

Alternatives considered:

  • do nothing, const { execa } = await import('execa') everywhere: Not always applicable, the burden is on the module consumer, creates a split-brain between different modules, extra overhead
  • microbundle: slower, less batteries-included, less maintained, less popular
  • babel: slow, less batteries-included
  • @vercel/ncc: seems to be mainly focused on creating single file, node.js only focussed
  • ?

https://npmtrends.com/microbundle-vs-tsdx-vs-tsup

@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Mar 23, 2023
@github-actions github-actions bot added PR: out-of-date The pull request has merge conflicts and can't be merged and removed PR: out-of-date The pull request has merge conflicts and can't be merged labels Mar 24, 2023
@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label Mar 28, 2023
@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Mar 28, 2023
@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label Mar 29, 2023
@Janpot Janpot marked this pull request as ready for review March 29, 2023 15:10
@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Mar 30, 2023
@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label Mar 30, 2023
@apedroferreira
Copy link
Member

tsup definitely looks like the standard now, so this looks good!

@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Apr 2, 2023
@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label Apr 5, 2023
@Janpot Janpot merged commit d315e8f into master Apr 5, 2023
@Janpot Janpot deleted the try-tsup branch April 5, 2023 13:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Infrastructure work going on behind the scenes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants