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

Web components as first class citizens in BioJS #144

Open
wilzbach opened this issue Feb 2, 2015 · 5 comments
Open

Web components as first class citizens in BioJS #144

wilzbach opened this issue Feb 2, 2015 · 5 comments

Comments

@wilzbach
Copy link
Member

wilzbach commented Feb 2, 2015

Started by @emepyc

For me, web components are about web standards to solve some of the same
problems that biojs try to solve. You may or may not like polymer or
x-tags but the web standards behind them are very relevant to biojs.
I anticipate an increasing number of web components being
developed in the bio world as the web components technology matures (I
know some of them being developed now).
I agree that biojs supporting web-components examples are a good first
step, but for the long run, it would be better if web components become
first class citizens in biojs, or even if biojs is based on web-components
only. And I'm afraid you can't achieve that level of compatibility just
using configuration files.

This is an issue absolutely open for discussion :)
I will start this by stating my opinion:

  • the Shadow DOM is amazing - it enforces someone to write reusable widgets (and not mess up with other components or create "single-instance-only" components)
  • Combining different component might bit be more difficult, because one can only listen to events (one can argue that this is a good abstraction)
  • Considering all the different web component libraries, this brings us to a similar issue as we had with the event system - do we want to give everyone the freedom to pick his own framework and just be a fancy registry or do we want to give more features (documentation, file i/o, ..) (see the discussion about an BioJS core)
@emepyc
Copy link

emepyc commented Mar 3, 2015

My opinion on this after having some hands-on work with web-components/polymer for some time now

Combining different component might bit be more difficult, because one can only listen to events

Combining different components is amazingly powerful (and easy) using polymer's (2-way) data-binding. It is true that this requires to have all the components driven by a parent web component, but this makes sense for me and leads to very powerful components. You can alternatively use object.observe or plain events anyway which is not different from what we currently have.

Considering all the different web component libraries, this brings us to a similar issue as we had with the event system - do we want to give everyone the freedom to pick his own framework and just be a fancy registry or do we want to give more features (documentation, file i/o, ..) (see the discussion about an BioJS core)
Yes, I agree with this, and this is the same problem we have now anyway, so it is true that web components wouldn't fix this, but it wouldn't put biojs in a much worse position anyway.

I would also mention "templates" as another benefit of web components. This allows the developer to write html where they need html and javascript where they need javascript (the same for css).
Also "imports", (which are far from perfect) would help to biojs (from the standards).

I agree that web components are not mature enough for being adopted by biojs, but we should keep an eye on them and how they evolve in the near future.

@thisisui
Copy link

For WebComponents there is one big issue - [support](http://caniuse.com/#search=web%20components).
Only browsers based on Blink can show something here.

Using Web Components as first class citizens is very good approach to keep consistent code across components but for now only apps based on Polymer should be recommended. Without Polymer iOS and FF users can wait for a long time for implementation that into their browsers.

@wilzbach
Copy link
Member Author

for now only apps based on Polymer should be recommended.

I am sorry, but I can't follow at all. Polymer also only uses a polyfill, so there's no reason why one needs to depend on Polymer. Moreover web components are a soon to be W3C standard and support for Edge and FF is under heavy development and will come soon.

@wilzbach
Copy link
Member Author

Update: All browser vendors reached consensus on many pressing matters about Custom Elements.

https://groups.google.com/a/chromium.org/forum/m/#!topic/blink-dev/EDxhDZ-bPkQ

@thisisui
Copy link

Wow, I really needed that link :D Thanks for it. Now it is clear. I was based on caniuse.com updates which made me belive that polyfills for now will be the only solution. But as I see now the solution is round the corner.

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

3 participants