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

[devops] Consider using Rollup to replace Webpack #741

Closed
WenheLI opened this issue Dec 8, 2019 · 11 comments
Closed

[devops] Consider using Rollup to replace Webpack #741

WenheLI opened this issue Dec 8, 2019 · 11 comments
Labels

Comments

@WenheLI
Copy link
Member

WenheLI commented Dec 8, 2019

Currently, the ml5 development process uses Webpack as the default building tool which is redundant. It would be better if we can use a relatively easy-to-use development tool like parcel. I have used it for a while and it is easy to set up and use.

We may use this thread to discuss the development/building tools as well as other DevOps agendas?

@joeyklee
Copy link
Contributor

joeyklee commented Dec 9, 2019

@WenheLI - Thanks a bunch for bring this up. Yes! I would love your help with figuring out best practices for devOps.

On my devOps agenda:

Happy to hear any suggestions!

@WenheLI
Copy link
Member Author

WenheLI commented Dec 9, 2019

@joeyklee - Great! I will do some experiments with Parcel first!

@oveddan
Copy link
Contributor

oveddan commented Dec 9, 2019

@WenheLI @joeyklee switching from webpack would be great.

I would suggest using rollup instead of parcel. Parcel is ideal for when you have an actual web application with html/javascript/css and want to have an easy bundler for all of those things.

rollup is more ideal for making packages that other can import. It's what tensorflow.js uses for bundling its packages and models.

They use parcel for the demo pages.

Check out their sample rollup config files:
in tfjs-core:
https://github.com/tensorflow/tfjs/blob/master/tfjs-core/rollup.config.js

and posenet:
https://github.com/tensorflow/tfjs-models/blob/master/posenet/rollup.config.js

@oveddan
Copy link
Contributor

oveddan commented Dec 9, 2019

Also rollup comes with treeshaking, which removes code from the bundles that isn't used.

@joeyklee joeyklee changed the title [devops] Consider using Parcel to replace Webpack [devops] Consider using Rollup to replace Webpack Dec 12, 2019
@joeyklee
Copy link
Contributor

Just making a note that i've changed the name of the issue based on Dan's points on Rollup. We should try to go this direction.

(aside: Parcel looks awesome for other things! looking forward to trying it)

@WenheLI WenheLI mentioned this issue Dec 15, 2019
@benbot
Copy link

benbot commented Jan 7, 2020

Just out of curiosity, what does Rollup add that webpack doesn't have?
Webpack also has tree shaking built in and supports node with a target: node config option.

I don't really think there's much of a value add for that extra work.

@david0178418
Copy link

Just an outsiders perspective: I'm spinning up a new project for work and was defaulting to webpack. I'm pausing for a moment to see how rollup and parcel have been coming along after all this time and see what they might bring to the table over webpack and have stumbled across this thread.

The only concrete point I see that's been brought up was in regards to the potential bonus of tree shaking. But as @benbot pointed out, webpack already supports.

Considering I'm also looking for the potential value-add to justify the cost of deviating (which includes both technical bonuses as well as the churn among other team members), I'll be interested to see what other points others might have to make.

@benbot
Copy link

benbot commented Jan 27, 2020

@david0178418 1 other point i've come across in other work i've been doing is how much simpler rollup is. It's not crazy simple, but it's simpler
Not really a technical value add, and if you're already comfortable with webpack not really a value add at all, but it's a thing. The configs tend to be a little simpler.

Still for this project I don't understand the value add of rollup.

@oveddan
Copy link
Contributor

oveddan commented Jan 27, 2020

@nsthorat care to chime in on this?

@nsthorat
Copy link
Contributor

It's really up to you. I agree rollup is simpler, but much of the world uses webpack and seems to have more documentation / support / examples. At the same time, TensorFlow.js uses rollup right now so you could rip our configurations.

FWIW, one day TensorFlow.js will move to webpack. Typically new stuff comes to WebPack faster than rollup, e.g. rollup/rollup#2099.

@bomanimc
Copy link
Member

bomanimc commented Apr 8, 2021

Going to close this out for now, as it seems we discussion here has slowed! We can always return to this question in the future, though!

@bomanimc bomanimc closed this as completed Apr 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants