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

ES Modules? #34

Open
Ryuno-Ki opened this issue Apr 8, 2021 · 4 comments
Open

ES Modules? #34

Ryuno-Ki opened this issue Apr 8, 2021 · 4 comments

Comments

@Ryuno-Ki
Copy link
Contributor

Ryuno-Ki commented Apr 8, 2021

As result of #25 I was thinking about splitting the code into ES Modules. Hear me out :)

It has a good support by now: https://caniuse.com/es6-module
You can offer an IIFE version for browsers that don't understand it: https://jakearchibald.com/2017/es-modules-in-browsers/#nomodule-for-backwards-compatibility

Downside is likely the need of a bundler to collect all ES Modules for a single IIFE.

You could use Parcel, esbuild (the new kid on the block) or go with something more tried & tested like rollup here.

I'm a big fan of Rollup, but haven't used esbuild, yet.
Parcel is great - until you want to do things different.

@fluffy-critter
Copy link
Collaborator

I don't really see the point. webmention.js is already largely just running a single function on a single piece of external data and I don't see what this would help with. If this were a react module or something I'd maybe consider it except there's already react-based webmention display implementations and I just want this to stay simple and concise.

@Ryuno-Ki
Copy link
Contributor Author

Ryuno-Ki commented Apr 9, 2021

Hm, but being wrapped inside an IIFE, it's hard to run automated tests against it.
Looking at other open issues, that would make it more challenging to not break anything going forward.

@fluffy-critter
Copy link
Collaborator

Automated testing isn't a high priority for me. I won't turn down work that others do in that regard but this project was just a quick hack for me to add webmention display to my site.

@Ryuno-Ki
Copy link
Contributor Author

Totally slipped my memory :O

I'm currently looking into migrating things over to my own VPS and might pick up contributions here as a consequence.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants