Live data from Hacker News

Show HN: Cami.js – A no build, web component based reactive framework

github.com

21–30 of 36 posts

Re: Show HN: Cami.js – A no build, web component based reactive framework

#21

What's the advantage of not having any build steps? For me personally, it's an instant turn-off, as I'll never use an untyped library.

No-build doesn't mean untyped.

You can typecheck pure js files using JSDoc.

https://www.typescriptlang.org/docs/handbook/jsdoc-supported...

Re: Show HN: Cami.js – A no build, web component based reactive framework

#22
This seems like a great candidate for the few instances in my HTMX projects when it'd be a pain in the ass to write endpoints that enumerate every possible client-side state. I would love to see somebody put the two together and report on how they get along.

Re: Show HN: Cami.js – A no build, web component based reactive framework

#24

this seems pretty cool - I love me some `lit-html`. How do you feel about Cami versus straight up Lit?

I use pure no-build lit for the "interactive islands" the repo describes. Nice to see others have the same idea even if we're not taking the same approach.

Re: Show HN: Cami.js – A no build, web component based reactive framework

#25
post #7

this seems pretty cool - I love me some `lit-html`. How do you feel about Cami versus straight up Lit?

You can consider Cami as the light dom sibling of Lit (which uses shadow dom). Cami loses out on slots & style encapsulation, but you can style Cami components with normal / global css like it’s part of the normal dom. And since there’s no shadow dom overhead, it’s more performant and there is no FOUC if you load CSS in .

I just nope out of the Shadow dom in lit to get external css using createRenderRoot. Mentioned here https://stackoverflow.com/questions/55400222/how-do-you-use-...

Re: Show HN: Cami.js – A no build, web component based reactive framework

#26
Great to see the interest growing around native Web Components. I've been working on a no-code (markup only) platform which is also based on web components.

https://saasufy.com/

I built a whole chat app with authentication, blockchain and GitHub login with just 120 lines of HTML markup no front end or backend code (all the logic is abstracted away via generic, easy-to-use components provided by the platform).

You can also build apps which display filtered views by category or with text search with custom parameters and it does so efficiently with indexing and all updates in real time. Real time updates are delivered efficiently only to relevant components. Components automatically subscribe and unsubscribe to and from realtime changefeeds in an efficient way. Access control can be specified at the object/model level or on individual fields.

Re: Show HN: Cami.js – A no build, web component based reactive framework

#27
Nice work! I have a no-dependencies project with somewhat similar goals in frameable/el[0], which takes more inspiration from Vue in its interface.

WebComponents give us so much, but just not quite enough to be usable on their own without a little bit more on top. Reactivity with observable store and templating with event binding are the big missing pieces.

[0]: https://github.com/frameable/el

Re: Show HN: Cami.js – A no build, web component based reactive framework

#28

lit-html author here. I'm glad the template library is useful for you! Question regarding interop with other web components: I don't see how to create reactive properties on elements. Can they receive data from parents via property bindings? Ie, could a Lit element pass data to a Cami element?

[deleted]

Re: Show HN: Cami.js – A no build, web component based reactive framework

#29
post #8
post #3

Looks good! FWIW I always felt the observable pattern much more intuitive than the redux/reducer style. Something like https://mobx.js.org/ Things get hairy in both, but redux pattern feels so ridiculously ceremonial all to effectively manage a huge global state object with a false sense of "purity". Observables otoh say "fuck it, I'm mutating everything, do what you want with it".

Thanks! Cami is technically a combination of both. I like the intuitiveness of observables so that’s used: ``` // define observable this.count = this.observable(0); // getting this.count.value; // setting this.count.update(value => value + 1); ``` But it also has a redux-like pattern where you can dispatch actions and register reducers with far less ceremony: ``` // define store const todoStore = createStore({ todos:…

> this.dispatch("add", newTodo);

Will the V8 JIT optimize the hash based function table loop into a constant integer array lookup?

Post reply on HN