DEV Community

Discussion on: Component Libraries with Stencil.js - About Stencil

Collapse
 
johnbwoodruff profile image
John Woodruff

Thanks Donald! I appreciate your comment, I'm glad it's helpful. I'll attempt to answer you questions as best I can:

  1. You're right, I'm only including two files in the index, but those other files are chunks that are lazy loaded on demand, so yes those are all necessary.

  2. Integration with various frameworks is actually for the most part trivial. You can see their Framework Integration docs to know how to use the components. Specifically for Angular, you can use this page.

  3. a. Stencil components become "hydrated" upon loading them in the DOM, and that class is added when they're ready to be used. (for example, calling the methods on the component from outside) You don't need to do anything for that to take place, that's built in.

  4. b. That getCssClassMap() method is simply a little helper function I wrote to return an object with class names and whether or not to add those to the element where I'm using it. It's very simple in the button file because I'm always adding them, but it can be more complex if I have, for example, ternary statements determining whether or not to add classes. That's just a matter of preference and you're welcome to do it however you want. :)

  5. a. There is a great GitHub repository with a bunch of Stencil resouces, awesome-stenciljs, including existing component libraries. Your guess is as good as mine for how reliable it would be. ¯_(ツ)_/¯

  6. b. Haha, maybe one day! Who knows?

Collapse
 
donaldleblanc profile image
Donald LeBlanc

Thanks a lot for your response,
I was looking at your github for easy-calendar.
I cannot see it in the browser, gives errors when build.
Is it supposed to work when I do a npm install and npm start?
github.com/johnbwoodruff/easy-cale...

Thread Thread
 
johnbwoodruff profile image
John Woodruff

Unfortunately that's a project that has languished into sadness. :( Haha. I've not touched it in nearly two years so I would imagine it definitely wouldn't work, and it wasn't near being ready anyway. I should probably archive that.

Thread Thread
 
johnbwoodruff profile image
John Woodruff

Good grief there are a bunch of things I should be archiving. 🤦‍♂️

Thread Thread
 
donaldleblanc profile image
Donald LeBlanc

I guess it should be name not-so-easy-calendar. ha ha

Thread Thread
 
donaldleblanc profile image
Donald LeBlanc

for item 4, getCssClassMap(), this you can do this as you are using JSX right?