-
Notifications
You must be signed in to change notification settings - Fork 50
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
[Question] Are there ways to integrate with hyperscript interfaces? #72
Comments
Great question — and fundamentally the answer is no, but with all things — it depends. Some important things to note:
To be fair these points are not very well spelled out, and the currently published code base is "experimental" in that its a first pass at the concept so some of the benefits (performance) of this approach are not yet realized (has moderate performance rather than blazing fast performance 😂). That said, it would be possible to decompose |
Hey @justin-schroeder, thanks for your prompt reply. The motivation here is to see if
I'm not sure how this would entirely work, but one might provide the possible values of
I want to stress I'm not proposing any changes to Example of how it "may" work? import { configure } from 'arrow-js';
configure({h: document.createElement}); // no need to configure but stating as an example
configure({
h: React.createElement,
mapHtmlProps,
}); // provide a custom createElement and `mapProps`
const mapHtmlProps = { // gives a chance to map from the consumer interface to arrow-js/lit's `html`
click: 'onClick',
class: 'className',
}
html`<button @click="${() => console.log('clicked')}"` // evaluates to React.createElement('button', { onClick: () => console.log('clicked') }); etcMotivation for this question comes from my personal exploration on creating framework-agnostic style/theming libraries i.e. |
I'll take a jab at this idea and see if it can be made configurable and maybe share some ideas back later! I see potential in https://github.com/justin-schroeder/arrow-js/blob/master/src/html.ts#L400 as a way to override I don't think this is simple to do, and not suggesting any changes. Mostly just curious if such a configuration makes sense, which may enable adoption in the JS community via:
|
For my part, it's that editing normal functions is much easier than editing embedded string literals. Arrow is so stripped down (which is great) that it seems like an odd requirement for me to find custom IDE tooling to get autocomplete, shortcuts, linting, etc. |
Love the ideas and approach of
arrow-js
. I believe this tiny thing is going to be the next big thing for many developers who are interested in committing to JS and away from JS frameworks.I have a question if
arrow-js
orhtml
templates have possible integration points with hyperscript'sh
interface. Sinceh
is the underlying interface for many other JS frameworks e.g.React.createElement
,Vue.h
,Mithril.m
, and is also agnostic, being able to integrate/map withhtml
in some ways would open up adoption paths toarrow-js
from other frameworks.If this should live outside of
arrow-js
, is there a general direction howarrow-js.html
can be mapped toh
?Thank you for your time.
The text was updated successfully, but these errors were encountered: