-
Notifications
You must be signed in to change notification settings - Fork 27
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
Setting inline style? #29
Comments
I think what you're reporting is a bug in the types. They are too restrictive somehow. I will look into it.
That depends a bit on what you mean with "work with". A Turbine This means that a Turbine component works only with plain DOM. It should be possible to wrap our components so that they can be used in other frameworks. We only require that the framework can give access to raw DOM elements and provides some basic lifecycle hooks (most frameworks satisfy this). These wrapper-functions would have to return framework specific components. Inside they will just run the Turbine components they wrap. We have specifically thought about creating such wrappers for Angular 1 and React. Doing it for Snabbdom would definitely be possible. The API could look a bit like this: const snabbdomComponent = convertToSnabbdom(turbineComponent); So what I'm talking about is some "adapter" function that converts Turbine components to other frameworks component format. Is that would you where thinking about? I think Turbine is specifically well suited to this sort of wrapping because they can be completely self-contained. |
I see. But if these are just types, is it perhaps possible to compile and run without typechecks, then those errors would go away?
I see what you mean, I still would like to understand why you said you prefer dealing with DOM directly rather than with vdom.
That would be really great and very useful! It is very similar with what I am attempting in With your adapters, it would make the components truly "inter-frameworkable", but of course, there is the extra cost of writing and maintaining the corresponding adapters.
const snabbdomComponent = convertToSnabbdom(turbineComponent);
Yes, pretty much. Also I'd find it useful to have them both ways. For instance, I really like the Mithril's hyperscript flavor that I find slightly less verbose, so I would prefer to use it when writing the vnodes e.g. with
Sounds great ;) |
Yes! I have not forgotten you asked about this. I just need the time to provide a proper answer 😅 |
The bug reported here turned out to be a problem with the types in Jabz. I've fixed it in Jabz and the problem should go away once Jabz is updated. |
I have tried to set
{style: {color: 'blue'}}
inline in the simple example:which worked but generated some errors in the console:
Despite of the last statement, the color was actually changed (after the necessary manual reload).
On a more general note, you seem to be using the new custom element library. Would it work with
snabbdom
and other libraries?On even more general note, I wonder what be your opinion on https://github.com/uzujs/uzu/issues/2
The text was updated successfully, but these errors were encountered: