HTML6 proposal for single-page apps without JavaScript
lists.w3.org
lists.w3.org
Here's my HTML6 proposal: There’s a standard design pattern emerging via cascading style sheets, where content is styled directly via CSS. Everyone’s into it because the layout looks so much nicer.
Since this is so common now, can we implement this directly in the browsers via HTML so users can directly style their content without CSS? I propose adding a <font> tag, so people can style their fonts, a <blink> tag so things can blink, and a fun <marquee> tag so content can scroll.
So which is it? A semantic language or a markup (syntax) language?
Why does it have to stay that way? (Even if the proposal is a bad one.)
Making a web standard for single page apps doesn't really seem necessary. Applications are by their nature different than web sites. A web site is a collection of content displayed largely as pages that are designated by a URI. An application is an abstraction over the page model that minimizes the transparent page/resource model with an opaque process flow model. HTML, as it stands, can be the V in MVC in either. Making it take on the M or C gains us little and stands to lose us much.
It might have been designed as a language for web based documents. Though this is not what the web is used for today, consumers want applications not documents. And we are already hacking away on top of those documents to give them that (despite the web not being intended as such).
They want applications and documents, or I do anyway. I spend more of my time online reading stuff than using GMail or whatever.
So, basically watch what you say buddy :)
For the <center>, it is probably not the case here as this is just a text based site but sometimes it is easier to center an image by that tag when your site is partitioned in many margins it is not as easy to center some stuff, or you might just prefer to add a tag.
I also like <br>, it really makes more sense to me and easier to write. It doesn't really break anything either.
I wonder how many there are, like me, think that <center> and <br> are actually really nice things to have?
But the main thing is that this doesn't solve any problem that exists. We can already do everything his proposal would enable; all this does is make it more inflexible.
On the other hand "+1" and "I agree" and "Well said!" clutter the forum.
How do we solve this?
I do believe we have the a similar kind of understanding for when to up-vote. What is a 'nice contribution to the conversation' other than arguments or facts that 'I do agree with' in them being a nice contribution to the conversation.
I fear we would have to have a meta-discussion on the concepts of good and bad and how they are flawed in that there are no montains without valleys^^
The community is in many ways already an echo-chamber; that battle was lost a few years ago. Don't let it bug you.
In either case, both are accepted uses. PG has said as much:
However to me it feels a bit like discouraging alternative opinions, when they are hidden/greyed out.
Is this commonly accepted then?
It makes sense, then, that the upvote button be used for agreement.
This is definitely not the site I'd have in my signature when talking about the emerging trend of single-page apps and proposing a new standard. It's such a non-standard site, and feels clunky and clumsy.
But I imagine the tragic flaw in both the data binding proposal here and how XSLT worked is massively increased complexity for fairly little gain - and I think that's why XSLT has died a gentle death over the past decade.
Still, both ideas appeal to me from the perspective of escaping horrendous chunks of procedural macros being shipped with data just to make it render on the client.
Nowadays, this isn't that different of an approach from using my server-side PHP/python/node/Go to generate JSON, then building my DOM based on client-side templates; since I use ReactJS, my transforms are even still XML. A lot of the best-practices I learned from XSLT transferred over nicely too, e.g. avoiding control logic (<xsl:if>) in favour of <xsl:apply-templates>, since good javascript client-side templates should avoid branching control logic in favour of just Array.prototype.map() wherever you can.
I think the real key isn't about understanding recursion, though you will gradually gain an appreciation for it, but understanding composition. Templating is too often done in the style common among poor developers, where they think about building a whole "page", instead of defining the components of that page. XSLT, in theory, would've been great for that, it's just a pain in the butt to actually implement.
tl;dr if there is a need for this proposal, it would be better met by cleaning out all the cruft from XSLT, and building implementations that don't require such arcane syntax nobody can use it.
I don't really agree that cruft or configuration difficulties were the problem, though. Verbose, sure, fine, but otherwise spare to a fault.
I suspect it's more that it demanded understanding of fairly sophisticated coding concepts to be at all useful, but was too often perceived as "front end" tech, or as just another markup language -- so ended up being dropped in the laps of too many designers-with-a-few-javascript-recipes-under-their-belts who simply weren't equipped to cope with it.
I spent a while running XSLT training sessions for a corporate client; 95% of my trainees would just reel away in disgust and confusion the instant they learned they wouldn't be able to, say, increment a variable. (The remaining handful would be all OMG THIS IS WHAT I HAVE BEEN WAITING FOR MY WHOLE LIFE. It got to be a little game of mine to try to predict ahead of time who would be which.)
Maybe it was just ahead of its time; the average front-end web developer is a lot more sophisticated these days than we were back then. (yes yes get off my lawn I have clouds to shout at)
I wrote transforms for the few cases where I needed straight XML-to-XML conversions, but anything of complexity I retreated to a "real" language. It's obviously a personal choice, but I find working in XSL/XML like running through mud.
The success of JSON is due in part to the low signal-to-noise inherent in XML, and maybe XSL's low popularity is likely due to the necessary complexity of dealing with unnecessarily noisy data. I sometimes daydream about a present where YAML got there first.
Real applications just don't fall neatly into tree transformations. I inherited a financial reporting web app using XSLT as the rendering mechanism. Requirements included things like running totals (state!), suppressing leading values when repeated between rows (also state), alternating row colors, external dependencies such as numeric formatting based on user's locale settings. A stateless tree transformation doesn't express that elegantly, so you end up with fantastically complicated and ugly XPath hacks. A running total would come from something like "sum all my parent's children with an index less than mine". Then that breaks when something comes up to introduce a need for another layer beneath that parent.
XSLT is purely functional. <xsl:if>template</xsl:if> isn't even control logic, it is functional evaluation, the same as Lisp's (if x template nil). <xsl:for-each> also isn't an imperative loop (it's map) even though it looks imperative and most enterprise programmers trained on imperative languages think it is and use it as such. So it's no surprise that XSLT in the wild ends up as a messy ball of mud.
Most templating languages have this problem, including PHP/HTML. The messy nature of real requirements isn't unique to XSLT. But XSLT manifests it most dramatically since it lacks a stateful and imperative framework to fall back on.
<xsl:key name="items-by-order" match="item" use="../@orderid"/>
...snip...
<!-- Union current item node with last item node of the order - if it's the same, the count will be one -->
<xsl:if test="count(. | key('items-by-order', ../@orderid)[last()]) = 1">
<xsl:value-of select="sum(key('items-by-order', ../@orderid))"/>
</xsl:if>
Running totals would be similar, except that your apply-templates for the item group would include a select that restricts the available nodes to the key() function's result, and you would sum current node with preceding nodes.It gave us 90% of our API "for free": On any page you could add an argument to the URL to spit out the XML data for the page, and others to get the items on the page as ATOM or RDF.
The developers hated the constraints it placed on them. But it was exactly because of the things the developers were prone to doing that was the reason for structuring it that way in the first place.
But if you like it, that's cool.
Maybe it is not because that XSLT is complex, but because XML has failed to become a language for the web. JSON has come to be the preferred choice.
Which brings me to JSON and complexity: The complexity of retrieving data has been paved over multiple times using libraries. This has encouraged people to skip XML and go directly to JSON. If retrieval of XML data, or better yet JSON data, were to become simpler, I think more people would structure their webpages to use these types of resources. In the end, it would be a victory for both open Web and open applications.
And that brings me to my last point: Dynamic elements. This web ain't succeeding without variable based dynamics. These pathways for dynamic behaviors have to be baked into browsers from the start. Then let JS abuse that dynamic just like JQuery abuses attributes, styles, and content.
I think there's still a place for an "AWK for the DOM". The XML extensions to gawk are interesting, but not really what I'm talking about; it works at a lower level (more like an "AWK for SAX"). jQuery comes closer to what I'm talking about, but I still wouldn't really call it a clean match.
Edit: In fact, lose the XML completely and go with JSON and JSONPath.
I fully realize this is not what the linked page is proposing, but it is not clear to me that using that wouldn't be a better idea, leaving the selection of templating to the user. Template languages, while smaller than programming languages, share their characteristic that there isn't obvious One Solution That Solves Everything. You can optimize them for different use cases and it is not clear to me that we can or should privilege one over the others. Given how rapidly the web is heading away from an overprivileged programming language being the only choice, this seems like going the wrong direction.
(Also, if your template language is slowing your server down, fix that. That's a problem with your implementation language, not the fundamental concept.)
AJAX stands for Asynchronous JavaScript And XML
It was a crazy time. XHTML was still "inevitable", and people were pretty sloppy with the terms.
It was called "XMLHTTP", created by Microsoft for Outlook Web Access 2000. Mozilla implemented it as XMLHttpRequest JavaScript object in Gecko.
The main reason of XHR/AJAX was XML, but Text and HTML are supported too.
See Wikipedia for the correct history:
http://en.wikipedia.org/wiki/XMLHttpRequest
Microsoft never implemented the XHTML standards in Internet Explorer. IE cannot open files with .xhtml file extension and with .htm(l) extension the page is rendered with HTML quirksmode.
Article that explains the MSDN server backend (1999): https://web.archive.org/web/19990505061257/http://msdn.micro...
Before that relaunch in 2000, the MSDN library used (MS) Java for the left side bar (TOC tree): https://web.archive.org/web/19990423231040/http://msdn.micro...
The DHTML version of MSN library (2000): https://web.archive.org/web/20000510200809/http://msdn.micro... , the 2001 version works: https://web.archive.org/web/20011108064645/http://msdn.micro...
XML toc tree data: https://web.archive.org/web/*/http://msdn.microsoft.com/libr... (sadly not archived)
https://lists.w3.org/Archives/Public/public-whatwg-archive/2...
My opinion too.
1. History is screwed up. You wanted a back button that took you back to the content you were looking at? Sucks to be you. The content you were looking at was dynamically loaded after ten different buttons you clicked, and now that the page is loaded fresh those button clicks are gone. Good luck finding it again. This especially goes for any of those infinite scroll websites: those should die.
2. Tabs don't work. Hey this link looks interesting, I'll open it in a new tab to look at later. Oh wait that was actually a JavaScript link and what often ends up happening is you end up with a blank page, or the same one page app loaded with it's initial content.
3. Save page doesn't work. You can save the page and pull it up and everything works because the JavaScript fetches the content. But there's one problem: I was saving that page to view on the bus where I have spotty internet if any. Sucks to be me.
4. Accessibility is broken. Oh, you're blind? Arthritic and have trouble using a mouse? Well, sorry, we had to size things in a certain way to make the animations work and tab order was too hard to get working, so I guess you can't use my website. Sucks to be you!
5. Security is broken. If you app loads content from a server that isn't yours, you can no longer verify security.
There are solutions to all of these problems but they're very difficult and 90% of one page apps don't solve these problems because they don't care.
I'm not against one page apps on principal, but a one page app standard that doesn't address these concerns is only going to make them worse. Unless we can solve these issues I'm against any one page app standard.
1 & 2 are a basic feature of JS MVC frameworks. I get that some people still probably mess this up, but there's no excuse to do so at this point. 3. Irrelevant/FUD? No normal user 'saves' web-pages, unless it's something like a receipt, which any sane dev would make a separate html page and not part of the app. 4. is totally false as screen-readers support JavaScript. 5. is false/strawman as any half-sane SPA developer still authenticates using a regular back-end framework and I've no idea what 'If you app loads content from a server that isn't yours' has to do with single-page apps.
I'm not sure what it would even mean for this to not be broken in a one-page app. If you're displaying more than one conceptually grouped set of content on one page, you're breaking the web's concept of a page: a page is one conceptually grouped set of content. JS MVC frameworks allow you to back and forward between "pages" within a page using the hashed href trick, but they can't keep your scroll location without rendering the page to determine layout, unless there's some magic I'm not aware of.
> 3. Irrelevant/FUD? No normal user 'saves' web-pages, unless it's something like a receipt, which any sane dev would make a separate html page and not part of the app.
I love when people tell me that nobody does what I do all the time. And it's not just me: a lot of people save pages for later reading, especially in academia.
> 4. is totally false as screen-readers support JavaScript.
Yes, screen readers support JavaScript, but JavaScript rarely supports screen readers. It's clear you've never actually attempted to browse the web using a screen reader.
> 5. is false/strawman as any half-sane SPA developer still authenticates using a regular back-end framework and I've no idea what 'If you app loads content from a server that isn't yours' has to do with single-page apps.
JavaScript security is a fucking joke. I'm not sure what you think authentication does when your JavaScript is running in the same namespace as all the other JavaScript in a page and malicious code needs simply to tell authenticated code what to do to spoof an identity. A server can do nothing to provide security when the requests from a browser are coming from an authenticated user (but are actually made by malicious JavaScript in the page).
Plenty of apps include advertisements from arbitrary sources, hence loading content from a server that isn't yours.
<form action="x" replace="#y"> <!-- .. --> </form>
<div id="y" />
You submit the form, it loads the result in the background and replaces content of Y div with content of whatever has id="y" on the new page.
splice-result-into takes any CSS selector as its parameter, so you can apply this to multiple elements at once.
The entire library is around 100 lines of code with no dependencies. 100% backwards compatible, degradable and easy to add to existing multipage apps. It could easily be implemented as a standard HTML feature.
- Angular seems to provide something similar already with its ng-* attributes and directives.
- JavaServer Faces also do the same thing, where a server-side controller is bound to HTML or UI widgets (and skip writing CSS and JS because they're pre-styled, pre-programmed).
This works for simple stuff, but for much more complex stuff (multiple view interactions, custom views), this becomes a pain to write because you start to create workarounds for things it wasn't prepared to do.
Also, while I'm no expert, but let's just leave HTML, CSS and JS as is. You can always create a framework that provides you that same functionality. In fact, Angular has directives, React has JSX, Ember has components. Several other frameworks do it as well.
Reminds me of E4X, where they tried to bake in XML syntax into JS. This time, it's behavior and logic into the markup. Nope.
An anti-pattern if I've ever seen one.
HTML is the structure, CSS is the look, and JavaScript is the logic. With a strict XHTML style you can further enforce this by removing former standards which don't follow that design (e.g. OnClick="" <b> <i> <font> etc).
HTML5 is alright, but I'd like to see a strict HTML5 which bans a ton of classic HTML4.1 elements completely and also follows XHTML's much more logical <br /> style (and bans things like <br> which make no sense).
I understand why they went the way they did (backwards compatibility mostly), but feel like the web would be in a better place ten years from now if a strict spec for at least HTML was commonly used.
Sure it does, it means it is impossible to mix logic or styling into your HTML inline. That makes HTML more maintainable and teaching it easier (less is always easier to teach than more).
What semantic elements are you worried about them abusing? I cannot think of a semantic element which replaces defunct presentational elements without any CSS (which would makes the entire argument redundant).
<em>
<strong>
<del>
Many elements (even ones that were always, even before HTML5, semantic rather than presentational, e.g., <a href="...">...</a>) have common default presentation effects in most browsers, but that doesn't make them any less semantic.
I suppose you could strictly separating presentation from semantic by requiring conforming user-agents to apply no styling differences to any element other than that that provided by CSS (e.g., every element would have the same default presentation.) But its debatable whether that gets you anything useful other than purity for the sake of abstract theory.
I think it would be good for less ambitious projects, but in the end it would cripple the building of more ambitious ones. If we already have Angular/React/Components/Whatever, shouldn't we just keep working on them and leave the HTML spec unpolluted?
https://html.spec.whatwg.org/multipage/scripting.html#the-te...
http://www.html5rocks.com/en/tutorials/webcomponents/imports...
Reading the comments I felt many people thought this is an official recommendation. It's the mailing list folks, the same place where somebody suggested to replace JavaScript with AS3 because it would solve every problem of mankind.
If he likes this kind of writing his AJAX implementation he can easily do so by doing his own framework.
I think HTML5 is doing pretty, pretty good and it's underestimated in what it can be achieved.
[1] http://www.html5rocks.com/en/tutorials/webcomponents/custome...
EDIT: and most importantly, get multi-threaded javascrip in the browser. Running the UI, events, and logic all on separate threads. Many observe patterns would most likely be used.
Accessibility.
(My project does not require supporting anything below IE 11, it's the greatest blessing, ever.)
<link rel="next" href="details.html">
What I feel like is missing from this equation is a nice transition between pages. How nice would it be to have something like this:
<a href="details.html" transition="slide-left">Details</a>
If the browser prefetched the details and handled the transition, I would see no need for an SPA. We would get the benefits without having to implement a hack.
<META http-equiv="Page-Exit"
CONTENT="progid:DXImageTransform.Microsoft.Slide(Duration=2.500,slidestyle='HIDE')" />That said, I wouldn't go down that road again. Better pre-fetching hints are good and HTML is a good place for a fallback (HTTP 2.0 provides better ways of doing it if you have control of the server), but page transitions are something better left to CSS, to my mind.
[1]: https://msdn.microsoft.com/en-us/library/ms532847%28v=vs.85%...
Maybe if you start with an argument to support your claim, you want to have actual numbers. And those real numbers would tell a different story.
Fortunately, it sounds like it will die an unpopular death.
1. The amount of DOM manipulation required for a relatively advanced single page app is not very efficient, quick or performant.
2. Web apps don't work well without a reasonably up to date javascript engine - users may not even allow Javasacript to be run. This breaks alot of web apps.
3. There isn't an (easy) way to request parts of a resource easily using HTTP.
Luckily these issues have solutions:
1. Invest time in a new successor or radical improvement over the current DOM - think an asynchronous, thread safe API. Fix things that deal with HTML, don't try and make HTML anything more than a markup language.
2. Either make your web apps fallback to HTML + CSS or start convincing people that using Javascript isn't a huge privacy issue. Fallbacks can be easy if you want them to be.
3. I'm sure there are way to request specific parts of a page (indeed, I coded such a way myself in PHP a few years ago), but someone needs to build an awesome abstraction over HTTP to make this easier.
So make two Web apps with the same functionality, basically?
e.g. here's a form that uses the same React component to render on the server, to handle regular form submissions and render redisplay when invalid and to progressively enhance with live validation and ajax form submission when JavaScript is available on the client: https://isomorphic-lab.herokuapp.com/add-thing
The main problem with W3 standards is that they assumed they knew what we'd want to do with them. No one predicted HTML would become the UI layer for complex replacements for desktop applications, so for a long time, it sucked at that job.
Now they're trying to rectify those mistakes, but I think they might be going too far in the other direction.
Instead, web standards need to be as simple, low-level, and generic as possible. The more HTML approaches an opinionated UI framework, the worse off we all are (in my opinion).
What - the - fuck
I would be down to have a nice standard way of providing templates , adding onto html thus keeping it backwards compatible but that's it.
what he's proposing could be could be backwards compatible
Edit: Obviously I understand that XForms isn't a viable option these days, but that is kinda my point. Why isn't XForms an option? Those reasons appear to apply to this proposal too...
"These javascript frameworks are all trying to do this, but none of them do it easily and they’re always being redesigned."
Things are being redesigned because there are flaws and limitations. Making something, and stamping it as "HTML6" doesn't automatically make it perfect. It would simply hinder the development further.
Modern web apps do so much more than what this proposal is trying to solve.
React + Relay/GraphQL is much more likely to be the next real big step forward on the horizon of web/app development.
Or are all the double and triple scrollbars intentional? And the code, the "Editor-In-Chief" seem to be stuck the 1990s, with all CAPS HTML tags and HTML 2 style code.
Why mess with the amazing separation of concern that exists between HTML, JavaScript and CSS.
The author needs to watch this a meditate on why Alan Kay said what he said about the web architecture: http://youtu.be/oKg1hTOQXoY
https://www.polymer-project.org/0.5/docs/elements/core-ajax....
In my judgment this feature is highly redundant and unnecessarily complicated.
WTF?? Please please, just start over!