mardi 6 mars 2018

Doubts with web components project structure and imports

I'm learning a little bit about web components and I have encountered a problem that I can solve but that I cannot understand.

First is the project structure for a project full made with web components. Most examples I have found are little components that can be reused everywhere (I guess that is one of the major points of web components), but nothing more. A major application has components but it has other things like services for example. I have mostly worked separating controllers and services and I don't know if this is correct for a web component or if it has all that logic inside only one file (let's call it "main.js" for instance);

The second doubt has to do with that separating of concerns that I've talking about. I am used to use imports and exports from es6, but i guess thats not valid for web components if I want to use totally native js. Otherwise I have to transpile to ES5. Is there any problem with that transpilation? Is it valid or is it against the standar?

Correct me with no mercy if I said something wrong :)

Thanks!

Aucun commentaire:

Enregistrer un commentaire