sveltejs / component-template

A base for building shareable Svelte components
559 stars 74 forks source link

ES5 transpiling ? #6

Closed thollander closed 5 years ago

thollander commented 5 years ago

Thank you for the template @Rich-Harris !

I see that there is no Babel/Buble plugged to this template.

Do you think it should be done (for consumers who will use index.[m]js) ? Or should they implement it in their consumer stack ?

If you think it should be done in this repo, how would you define the supported browsers ?

TheBosZ commented 5 years ago

The official line is that support for ES5 is going to come from the project, not the component. Here's where the discussion is.

Conduitry commented 5 years ago

If people are consuming a component written with this project in a Svelte app, they'll be consuming the original .svelte source files, and compiling them within their app, and so they'll be responsible for setting up whatever transpiling they need.

Transpiling within this project would only matter if someone were directly consuming the compiled js from this module in a non-Svelte project, then it'd be up to you, the consumable component author, to decide whether you wanted them to have to transpile (or, from the other side, whether you want to force transpiled code even on people who don't need it).

In either case, I don't think transpiling is something that belongs in the official template, but you can of course introduce it in components made from this template.

thollander commented 5 years ago

Very clear, thanks for the answer @Conduitry !