digitalevidencetoolkit / deptoolkit

The Toolkit API, app, and browser extension. Start preserving now.
https://digitalevidencetoolkit.org
Other
45 stars 4 forks source link

Rewrite browser extension: TS, no Webpack #40

Open basilesimon opened 2 years ago

edsu commented 2 years ago

Sorry for the interruption: does using TyoeScript mean you no longer need Webpack to bundle for the browser?

basilesimon commented 2 years ago

Hey Ed, thanks for stopping by 👋

I'd love to do away with Webpack, if I'm honest. Doesn't really feel right to be installing 800+ packages for a browser extension...

This part of the plumbing, so to speak, isn't really my cup of tea, hence the help wanted tag 🙂

Would you happen to have thoughts or knowledge of these things, by any chance?

basilesimon commented 2 years ago

There's this rather feature-full template, which includes TypeScript (yay) but also React (uh), Babel (er), and Webpack (ah...). That's about 1,500 packages to install to run it...

edsu commented 2 years ago

I totally understand, and is exactly why I was asking :-) I've been meaning to switch over to using TypeScript and was wondering if it made some of the Webpack bloat go away.

I think one approach to doing away with Webpack while still using components is to use the browser's native support for custom elements. I think libraries like lit-element help with that. Packaging with Webpack or Rollup sneak back into the picture once you need to import another module. But if your browser extension doesn't really have any dependencies that need to be bundled along with it maybe this approach would work?

basilesimon commented 2 years ago

But if your browser extension doesn't really have any dependencies that need to be bundled along with it maybe this approach would work?

I know, it's tragic isn't it! A big reason for adding Webpack support was to offer a nicer dev experience, which quite frankly benefits from in-browser hot reloading without having to re-import your manifest into the browser...