6 ms·
Mithril was doing this exact thing before React became big - it's what we're moving away from (with JSX), not where we're heading.
by raziel2p 6y ago
Mithril was doing this exact thing before React became big - it's what we're moving away from (with JSX), not where we're heading.
- pjmlp 6y agoGoing back to PHP and ASP you mean.
- jrwr 6y agoHay! There is some power in being able to bang out a page with <h1>Hello <?php echo "World"; ?></h1>
- pjmlp 6y agoAgreed, the problem is when that page gets to a book size.
- cercatrova 6y agoThat's why there are components that you put together, so that no one component is very large.
- lyjackal 6y ago*improving on PHP and ASP
- mhd 6y agoWith thing like GraphQL, I get a definite ColdFusion vibe, too.
- runawaybottle 6y agoWe are definitely in ColdFusion territory: https://github.com/seancoyne/awesome-coldfusion#application-frameworks https://github.com/seancoyne/awesome-coldfusion#application-...
- bdcravens 6y agoWorth noting that ColdFusion actually did components before it was cool :-) (I don't mean ColdFusion components which are really just classes in .cfc files, but custom tags which let you write custom markup) <cf_menu position="left"> <cf_menu_item current="true" label="Home" url="/"/> <cf_menu_item label="Accounts" url="/accounts" /> </cf_menu>
- deleted 6y ago[deleted]
- marcosdumay 6y agoText templates are the technology for web development. They are so much better than anything else that there's no comparison. There are some bad templates implementation, and some good ones. The original PHP and ASP are bad. But that doesn't mean templates are bad.
- pjmlp 6y agoText templates are a good idea, placing them into the middle of JavaScript code, not really.
- enobrev 6y agoI absolutely disagree, but I also feel it's unfortunate that HTML, CSS, and SQL aren't first-class citizens in most languages. It's strange to treat things backed by entire standards bodies and with fully developed ASTs as plain-text. It seems unnecessarily limiting, and I'm not sure why; For the sake of history? "Division of Concerns"? How is it that using libraries meant for string manipulation upon a standardized format not a concern in and of itself? The reason JSX, Mithril, PHP's template tags, ASP, Mustache, Twig, etc, exist is because we want to generate HTML - a language that has been standardized for decades - so why are we still playing around with string manipulation tools?
- pjmlp 6y agoWe aren't, only those that keep fighting against MVC, HTML Templates and Web Components are.
- marcosdumay 6y agoIt's an evolutionary constraint. Text templates are initially much more useful than HTML and CSS ones, so people adopt the first, despite a bigger potential usefulness of the later. The tendency for SQL is even weirder, it's for replacing it with languages that are much less useful for querying data.
- marcosdumay 6y agoI do agree with that. But on the case of JSX, it is located inside JS code, but is completely self-contained, thus, it's not as bad. The original PHP and ASP are really singular beasts, people aren't creating things like those anymore.
- keb_ 6y agoMany projects still predominantly use Hyperscript with the option to use JSX (including Mithril and Hyperapp, and others like RE:DOM, snabbdom to name a few). Even React has an option to use it if you want to skip the JSX compile-step. So I wouldn't say we're necessarily moving away from it. Personally, I prefer Hyperscript. It took maybe a day for me to get over its perceived ugliness and actually appreciate that it's plain, valid JavaScript.
- lhorie 6y agoI wouldn't necessarily say we're moving one way or another. React technically released before Mithril. It just so happens React became more popular and JSX is idiomatic in React. But hyperscript is usually compatible w/ JSX (in fact, in Mithril you can choose whether you want to use JSX or hyperscript) Personally, I think indentation w/ hyperscript tends to look more natural for large sets of props, e.g. h('div', { id: 'hello', title: 'hello' onclick: () => { console.log('hello') }, }, [ // hi 'hello' ]) // vs <div id="hello" title="hello" onclick={() => { console.log('hello') }} > {/*hi*/} hello </div> With Mithril's variety of hyperscript in particular there are also some other neat features, such as the ability to pass css selectors as the first argument, e.g. `h('input[type=password].password')` or `const TailwindComponent = '.rounded-lg.md:w-56'; const element = <TailwindComponent />`.