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

[WIP] new bundler #7826

Closed
wants to merge 5 commits into from
Closed

[WIP] new bundler #7826

wants to merge 5 commits into from

Conversation

kitsonk
Copy link
Contributor

@kitsonk kitsonk commented Oct 5, 2020

This PR is the WIP for the way of bundling. It does the following:

  • Builds on the new module graph that was introduced.
  • Uses swc_bundler to emit the bundle.
  • Uses a refactoring of tsc called ts_checker which does a type check only.

Like currently, deno bundle does a type check, but it now supports the incremental build for bundles, which make subsequent type checks faster. It also supports deno bundle --no-check as well. In all cases it uses swc_bundler which emits a single file "flat" ES module.

Things going on:

  • This builds on [WIP] feat(cli): bundling using swc #7669, but I would like to land [WIP] feat(cli): bundling using swc #7669 separately when we get the majority of the bugs addressed, and then use this PR to replace the the emit from deno bundle with swc.
  • swc leaves dynamic imports untouched. This is a significant change in behaviour from deno bundle, where if a dynamic import could be statically identified, it would be included in the bundle. This isn't a big deal with absolute URLs, but if users are importing something relative and locally, then this becomes a bit of an issue, as it doesn't make the bundle very portable. We might want to consider ways of dealing with this (like maybe warning on dynamic import). Also, this is a significant change in behaviour, and some could argue a breaking change.
  • This is a net add of ~1100 lines... I am not totally happy about that, but again, this is a transition period... Not all of the lines could be dropped in tsc because of the other dependent capabilities. I believe at the end of this journey we will drop a lot of code and have a set of code that is a lot more maintainable.

@kitsonk kitsonk marked this pull request as draft October 5, 2020 10:29
@kitsonk
Copy link
Contributor Author

kitsonk commented Oct 7, 2020

Reworking a few things. Closing without merging.

@kitsonk kitsonk closed this Oct 7, 2020
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.

None yet

1 participant