forem / forem-browser-extension

The Forem browser extension which allows users to seamlessly navigate between communities.
GNU Affero General Public License v3.0
28 stars 9 forks source link

Add parcel to the project #17

Open nickytonline opened 4 years ago

nickytonline commented 4 years ago

Parcel is web application bundler that out of the box has zero configuration.

Although we use webpack in the forem code base, it would be nice to consider a different more modern bundler. The main reason we use webpack in the Forem code base is because of it's integration with Rails via webpacker. It also ships with Rails 6.

In browser extension land, we do not have this constraint.

I have a proof of concept that I will post sometime this week as a draft PR to show how it all comes together.

Some benefits of adding a bundler to the extension code base:

Let us know what you think about using Parcel.

benhalpern commented 4 years ago

hot reloading

Do we get to make use of this in a browser extension context?

nickytonline commented 4 years ago

hot reloading

Do we get to make use of this in a browser extension context?

We should be able to. I've done this in the past with webpack. It's not a deal breaker if we can't though. The other two benefits are already a good enough reason to go with it.

rhymes commented 4 years ago

I'm conflicted about this but also don't feel strongly about either choice.

I wonder if uniformity here wouldn't help us regarding code contribution and collaboration in the long run.

By having two sets of bundlers we require contributors to learn both Webpack and Parcel. It also true that the people contributing to Forem's server might not be the same set of people contributing to the browser extension and being nimble on JS bundle configuration might help us in the long run.

So, +1 on either choice.

citizen428 commented 4 years ago

By having two sets of bundlers we require contributors to learn both Webpack and Parcel.

The good thing about Parcel is that there's basically nothing to learn, which is part of the appeal. But you do make a good point re uniformity. I'm fine either way.

Rafi993 commented 4 years ago

hot reloading

Do we get to make use of this in a browser extension context?

I think to auto reload chrome extension during development you might want to use something like this https://chrome.google.com/webstore/detail/extensions-reloader/fimgfedafeadlieiabdeeaodndnlbhid

nickytonline commented 4 years ago

You can actually use parcel's watch to handle this. There is an example of this in https://github.com/ceoimon/react-parcel-ts-extension-boilerplate/blob/master/package.json

I'll have a proof of concept up tomorrow latest Friday.

Rafi993 commented 4 years ago

You can actually use parcel's watch to handle this. There is an example of this in https://github.com/ceoimon/react-parcel-ts-extension-boilerplate/blob/master/package.json

I'll have a proof of concept up tomorrow latest Friday.

Awesome