Comments (10)
True, you will no longer import { html }
, which was neat, but on the other hand using hyperx out of the box makes HyperApp opinionated about two things:
- using template functions (HyperApp is neutral, use what you want)
- using the hyperx module (what if someone writes a new html parser template function better than hyperx, should we switch? use both?)
I believe removing the hyperx dependency is a logical move.
Now let's see the biggest positive from this move:
- You can start using Hyperapp in production right now, because we finally have a build setup that works and no longer need to wait for my PR to be merged (assuming it will be ha).
from hyperapp.
I was thought same thing. If we are just elm architecture + virtual dom + JSX, it jsut enough. It looks fancy and everyone seems to use JSX haha.
from hyperapp.
Not "breaking JS" is one of the reasons why I like hyperapp. 👎
from hyperapp.
everyone can include hyperx
and pass our h
to it so he won't break HIS JS for his project :D
I was against JSX, but kinda like it now. Not sure enough, except that it is hard to write because is html :D no matter even if you have some snippets or "lanugage-*" or etc stuff on you editor. :D
it would be cool if they support Jade/Pug :D it will go more crazy :D
from hyperapp.
@dodekeract Extracting hyperx doesn't mean HyperApp can't use template functions. The reason I want to remove hyperx is because of maintenance, hyperxify won't likely ever work with HyperApp out of the box (forcing me to fork the repo or create my own transform and tell everyone to use it).
Extracting hyperx is arguably trueer to the minimalist nature of hyperx.
With regards to breaking JavaScript
I've become ambivalent towards the debate. HyperApp lets you use whichever you like.
from hyperapp.
@tunnckoCore Jade/Pug
Let's write a Jade/Pug parser as a template function, https://www.npmjs.com/package/pugx.
Then you can use it like this:
const { h, app } = require("hyperapp")
/** @pugx h */
app({
model: "Hi.",
view: model => pug`h1 ${model}`
})
Haha.
from hyperapp.
Haha. Interesting and still be a cool thing to have tagged template fn for pugx instead of what hyperx
returns. But i meant instead of writing raw html as JSX, to write raw pug :D, But yea space sensitivity can be awful sometimes.
Something like
/** @pugx h */
const { h } = require('foobar')
const mainView = (model, actions) =>
section.hello
h1 {model.title}
p Hello {model.name}
app({
model: { name: 'Charlike', title: 'Hello World' },
view: mainView
})
edit: The crazy thing and coolest thing is that Pug itself is template engine even language, so it will be able to do some very interesting crazy things.
edit2: Anyway, don't think the time for such thing is came yet :D
edit3: event more crazier with components
const mainView = (model, actions) =>
Foo.hello(src={model.name})
a(href={model.link})
from hyperapp.
agree with removing hyperx.
actually it's wired to use tag template string to build virtual-dom. not easy to write, also not easy to write.
however, jsx is is not bad, at least so many people ar using it, but also not good enough, because it's also kind hard to write. and bearking html with js is not problem for me.
btw, pug is a good idea, i like it for that it's quit easy to write.
from hyperapp.
@liadbiz Hyperx is not wired to use virtual-dom only, you can use it with HyperApp too.
The problem with Hyperx is its tooling, hyperxify is wired in a way that makes it impossible to use it when exporting Hyperx via HyperApp (like we were doing before).
In other words, Hyperx works better when used directly by the consumer, so it was only logical to extract it from core.
from hyperapp.
Closing as this landed in [email protected].
from hyperapp.
Related Issues (20)
- JSX fails if no props are given HOT 6
- A way to insert raw Html HOT 1
- TypeError: can't access property 0, newSubs is null, when setting the state to undefined. HOT 4
- Issue with null-vnodes HOT 1
- prevent rerender node HOT 2
- The dispatch initializer ends in an endless loop on init when dispatching any action HOT 7
- Injected classes gets removed when using object/array to define class props HOT 1
- hyperapp version HOT 3
- Memo Data Gotcha HOT 5
- Confusing doc for actions -> wrapped actions HOT 5
- Passing arguments to init HOT 4
- [Question] Headless mode is still possible? HOT 1
- Destroying a child app HOT 8
- @hyperapp/html: use a Proxy? HOT 9
- Actions returning other Actions HOT 5
- Compile template tag to hyperscript HOT 17
- A challenge to hyperapp community HOT 1
- Has 2.0 been dropped from development? HOT 3
- oldSub[2] is not a function HOT 3
- Cannot read properties of null (reading 'length') HOT 5
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 hyperapp.