Using existing Js libraries in stencil

#1

hello everyone

I’m just looking into stencil and trying to understand what it can do, one question is about existing libraries.

For example, in one of my projects I’m using vis.js, now would it be possible to wrap that library into a web component using stencil? If so how would I go about doing it?

Mike

#2

Hi Mike!

I just tested this, so it’s simple.
Do it as you would do it for Angular.

#3

Would you like to explain in detail?
which file should I edit?

#4
#5

Hi izio,
is it possible to create a set of web components each one using (potentially) a different ui framework?
I’ve created a webcomponent (with stenciljs 0.11) that imports bootstrap css/js but it does not work if I set shadow dom to true.
In my webcomponent the current imports for bootstrap are:

  • (in scss) @import “…/…/…/node_modules/bootstrap/scss/bootstrap”;
  • (in tsx) import ‘bootstrap’;

I think shadow dom is mandatory if one component uses bootstrap and another one uses, for example, semantic ui, or why not, another version of boostrap.

Thanks