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

Bundler #43

Closed
9 of 20 tasks
kdy1 opened this issue Nov 3, 2018 · 13 comments · Fixed by #825
Closed
9 of 20 tasks

Bundler #43

kdy1 opened this issue Nov 3, 2018 · 13 comments · Fixed by #825
Assignees
Labels

Comments

@kdy1
Copy link
Member

kdy1 commented Nov 3, 2018

Status

  • Bundling of es6 modules.
    • normal import
    • aliased import
    • namespaced import
      • de-globing (& tree shaking)
      • namespaced import with dynamic key
  • Tree shaking.
  • Resolve / Load` trait for extensibility
  • Chunking
  • Dynamic imports
    • Loading
  • swc integration
    • Simple optimizations
    • Transform
    • Optimize helpers (remove duplicate)
    • .swcrc integration
  • "esnext" in package.json
  • spack.config.js

This is a very hard part. I'm considering moving the source code of node-swc to this repository.

  • codegen: Multiple SourceFile

This is required to create the correct source map.

  • Bundling of non-js assets

Need to determine plugin api.

@kdy1 kdy1 modified the milestones: 0.1 - compilers, v0.1 - backend, v1.0 - end to end, v0.2 - last step of the build Nov 3, 2018
@TheLarkInn
Copy link

Maybe we can work to take the most time intensive pieces of existing bundlers and avoid overlapping work :) <3 webpack team :)

@ForsakenHarmony
Copy link
Contributor

yeah I'd say this should be more like webpack :^)

@kdy1 kdy1 self-assigned this Feb 9, 2019
@anru
Copy link

anru commented Feb 10, 2019

@kdy1 btw, there is https://pax.js.org/ for that purpose

@kdy1
Copy link
Member Author

kdy1 commented Feb 10, 2019

@anru I were porting it, but I stuck at api design.

At now, I don't have a clear idea about plugin api.

@LuoZijun
Copy link

@kdy1

Note: The pax work with --es-syntax-everywhere option should be define process.env object.

px --es-syntax-everywhere in.js out.js

@kdy1 kdy1 mentioned this issue Feb 14, 2019
@kdy1 kdy1 modified the milestones: v1.1.0, v1.2.0 Feb 25, 2019
@TheLarkInn
Copy link

@kdy1 if you have intention to make a bundler, our team would be happy to share our learnings and design from webpack if you find it valuable. Feel free and reach out!!!!

@kdy1 kdy1 changed the title Bundler, just like browserify Bundler Jan 31, 2020
@kdy1 kdy1 pinned this issue Jan 31, 2020
@kdy1 kdy1 unpinned this issue Jan 31, 2020
@kdy1 kdy1 removed this from the v1.2.0 milestone Feb 13, 2020
@kdy1
Copy link
Member Author

kdy1 commented Feb 13, 2020

I used (and tried) many build tools, but I doubt that there is a clear winner. So I want to hear various opinions about the bundlers.

I want to determine the plugin api. Interop with javascript from rust is a very hard task, so I want to write it once.


Can anyone here help me determining api related to the plugins? Any opinion is welcome.

I think important parts of plugin api are

  • When to run

I'm considering something like a loader from webpack.

  • What should a plugin responsible for

I have no idea.

@nick-at-hawkfish
Copy link

In my opinion, Rollup's plugin architecture and ease-of-use is much better than Webpack. I'd suggest using Rollup as inspiration on how to write a solid plugin system. See https://rollupjs.org/guide/en/#plugins-overview

@wldcordeiro
Copy link

In my opinion, Rollup's plugin architecture and ease-of-use is much better than Webpack. I'd suggest using Rollup as inspiration on how to write a solid plugin system. See https://rollupjs.org/guide/en/#plugins-overview

I like this suggestion as well! I do think the two serve slightly different usecases (basically libraries vs apps) primarily so perhaps building a tool that is able to work in the two modes maybe hard. I do find rollup to be an easier tool to configure and use though with its architecture so totally a better inspiration there!

@kdy1
Copy link
Member Author

kdy1 commented Feb 20, 2020

@nick-at-hawkfish @wldcordeiro Thank you guys for opinions. I really need some, but it is very hard to hear from real users.

@wldcordeiro
Copy link

This could be a fun learning opportunity contributing for Rust. Thanks for the responsiveness. I'm testing this tool out with some projects and see lots of potential. 😄

@kdy1 kdy1 added the E-hard label Mar 30, 2020
@kdy1 kdy1 mentioned this issue Jun 8, 2020
27 tasks
@jrop
Copy link

jrop commented Jun 11, 2020

@kdy1 You really should take @TheLarkInn up on his offer to share learnings 😄 He is on the Webpack core team, after all!

@swc-bot
Copy link
Collaborator

swc-bot commented Oct 27, 2022

This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@swc-project swc-project locked as resolved and limited conversation to collaborators Oct 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

Successfully merging a pull request may close this issue.

9 participants