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

Rewrite browser extension: TS, no Webpack #40

Open
basilesimon opened this issue Aug 11, 2021 · 5 comments
Open

Rewrite browser extension: TS, no Webpack #40

basilesimon opened this issue Aug 11, 2021 · 5 comments
Labels
help wanted Extra attention is needed

Comments

@basilesimon
Copy link
Member

No description provided.

@basilesimon basilesimon added the help wanted Extra attention is needed label Aug 11, 2021
@edsu
Copy link

edsu commented Aug 11, 2021

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

@basilesimon
Copy link
Member Author

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
Copy link
Member Author

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
Copy link

edsu commented Aug 13, 2021

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
Copy link
Member Author

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...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants