Comments (5)
lit-html
is still in rapid development. They recently merged core and extended library, changed syntax, etc. In the time when I was creating template engine (from March to May) it was really different, and in my opinion really confusing. They had a lot of issues about how to use it, or that people does not understand why something was not working (like missing the fact of extended version, which had to be used).
The main reason behind creating own implementation was a different public API. The hybrids solution favors using element context as a main argument of event listeners, gives a user full power without need to use additional tools (as directives for class and style introduced lately in lit).
However, as the hybrids is very flexible library, there is nothing to stops you from using lit-html
with the library. The only thing you have to do is a little wrapper over render factory, as the html
method in lit returns TemplateResult, not an update function.
from hybrids.
Is there anything else I can help you with this subject your welcome to ask :). If no, I will close the issue.
from hybrids.
Can you provide an example how lit-html or hyperhtml render can be used instead of default?
from hybrids.
Sure!
https://stackblitz.com/edit/hybrids-lit-html-counter?file=lit-counter.js
Instead of passing directly template result (using the built-in engine), for lit, you simply wrap a function with lit()
function and use html
from lit-html
. For simplicity, it is re-exported in the wrapper file - lit.js
.
I put some comments to explain why something is done in that or another way. Some of the API differences force to not use destructuring and require passing context to the event listener.
from hybrids.
very helpful, thanks for quick response.
from hybrids.
Related Issues (20)
- Add a helper for assigning component properties HOT 3
- Dynamic columns not showing when render a html table HOT 4
- '"hybrids"' has no exported member named 'property'. Did you mean 'Property'? HOT 8
- Add support for "TypeScript v5" HOT 3
- I can't create an arbitrary number of nested forms: HOT 6
- Small Type Inferencing Issue with Property<E, V> HOT 6
- Cannot pass an object to the API via the "list" method HOT 7
- version 8.2.17 backwards compatibility is broken! HOT 9
- Expand the functionality of drafts
- sync() with nested models is broken HOT 4
- Allow storing an object in a component property HOT 4
- Add partial loading of model data HOT 3
- Why do you remove the lastValue? HOT 2
- The store logs a lot of errors HOT 4
- Convert a Whole Component to Web Component HOT 8
- Scoped CSS HOT 6
- lagging update glitch HOT 2
- Component properties cannot be setted until they are observed HOT 2
- `store.set()` is very slow HOT 5
- Store loads items data when iterating the list of items HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hybrids.