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

[Suggestion] Web Components #24

Closed
equinusocio opened this issue Oct 17, 2017 · 16 comments
Closed

[Suggestion] Web Components #24

equinusocio opened this issue Oct 17, 2017 · 16 comments
Labels

Comments

@equinusocio
Copy link

Hi, i suggest you to switch the entire library to web components... no dependencies, framework agnostic, maintainable, css encapsulation, native and responsive design blocks ready to be used in your web or mobile apps for real.

@stefanneculai
Copy link
Contributor

stefanneculai commented Oct 17, 2017

@equinusocio that's an interesting suggestion that would definitely worth exploring. Can you see any drawbacks of switching this to web components?

@stefanneculai stefanneculai changed the title Web Components [Suggestion] Web Components Oct 17, 2017
@equinusocio
Copy link
Author

equinusocio commented Oct 17, 2017

The only thing is the shadow dom compatibility. There are polyfills called webcomponents.js that should be included by the end users.

Chrome (even mobile), safari (even mobile), every webkit browser and Edge 16 supports the shadow dom v1 spec. Firefox needs the polyfill.

Oldest browser like IE 11 needs polyfills. There are some differents between shadow dom (native) and shady dom (polyfill).

Take a look at google developers articles about web components and libraries like hyperHTML.

To use a web component you can just link its js to the html page or import it as module inside webpack. The most used bundler.

@equinusocio
Copy link
Author

I suggest to stick with polymer 3 instead of react. So you can provide just a js file for component.

@hetmann
Copy link

hetmann commented Oct 25, 2017

Anyone with basic frontend development knowledge can create web components on any library or framework (Polymer, Angular, React, Vue, etc). This guys did a CSS/SCSS styling for basic web elements and this can be implemented into any Web UI Kit.

@stefanneculai
Copy link
Contributor

@hetmann We want to move the design blocks from simple HTML to Web Components / Polyer because this way they can be easily used in front-end frameworks without having to reinvent the wheel again. We're still discussing about which would be the best approach and should have a decision in the following days.

@equinusocio
Copy link
Author

equinusocio commented Oct 25, 2017

@stefanneculai note that if we use polymer you will make polymer elements that works only with polymer. The only way to make them works with any frameworks is by using pure custom elements.

@stefanneculai
Copy link
Contributor

@equinusocio yes, I'm aware of that. Most likely we're going to use Custom Elements without using the Shadow DOM. We still have to make some checks and a POC before starting all the conversion. I'll post here more details shortly.

@equinusocio
Copy link
Author

equinusocio commented Oct 25, 2017

@stefanneculai Will you consider also removing bootstrap?

@stefanneculai
Copy link
Contributor

stefanneculai commented Oct 25, 2017

Yep, we're taking into consideration to keep only a few things from Bootstrap, like the grid and some helper classes.

@equinusocio
Copy link
Author

equinusocio commented Oct 25, 2017

In my opinion, you don't need bootstrap at all. Consider each component as indipendent building-block, If you need to use a grid, you can use the CSS Grid Layout (widely supported) just inside the component. Without have to make extra markup or extra CSS class. Each component have its own grid defined inside.

@victorheringer
Copy link

Using Stencil may be a better option than Polymer or React, it compiles to standards custom elements.

@equinusocio
Copy link
Author

@victorhwringer but you need stencil anyway

@victorheringer
Copy link

@equinusocio Actually you don't. Stencil produces Vanilla JS, so you can distribute the components without any dependency. Yeah it adds one-way data binding, lazy-loading, etc but all goes together when you compile and there is no need to do such a thing as import Stencil as a dependency.

But anyway, is just an idea. Since it's new, things can change very quickly and may be more interesting use something more stable.

@equinusocio
Copy link
Author

equinusocio commented Nov 6, 2017

@victorheringer It is not true, you can take a look at this [sample project] (https://github.com/coryrylan/stencil-demos). It build a bundle.js file that include some core files and it does not support Shadow DOM at this moment. This is an example of vanilla no-dependencies web component https://github.com/contactlab/ikonograph/blob/master/src/ikonograph.js.

As you said, i think it is better going with something more stable..

@stefanneculai
Copy link
Contributor

@victorheringer thanks for the suggestion, however, we'd prefer to go with something more stable. We're going to post more details in the following days.

@nice2meu
Copy link

nice2meu commented Oct 11, 2023 via email

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

No branches or pull requests

5 participants