BT

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Topics

Choose your language

InfoQ Homepage News Informal HTML6 Proposal for "Single-page Apps Without JavaScript" Attracts Controversy

Informal HTML6 Proposal for "Single-page Apps Without JavaScript" Attracts Controversy

This item in japanese

Bookmarks

An informal "HTML6" proposal has caused controversy after it was shared to W3.org.

Bobby Mozumder, founder of fashion-media startup Future Claw, submitted his HTML6 proposal for single-page apps without JavaScript to the W3.org mailing list.

Mozumder said that its goal was "a high-speed responsive web experience without having to load JavaScript." 

Such an experience could probably be done without JavaScript "by linking anchor elements to JSON/XML (or a new definition) api endpoints, having the browser internally load the data into a new data structure, and the browser then replaces DOM elements with whatever data that was loaded as needed," Mozumder said.

He elaborated:

There’s a standard design pattern emerging via all the front-end JavaScript frameworks where content is loaded dynamically via JSON APIs. This is the single-page app web design pattern. Everyone’s into it because the responsiveness is so much better than loading a full page - 10-50ms with a clean API load vs. 300-1500ms for a full HTML page load.

Since this is so common now, can we implement this directly in the browsers via HTML so users can dynamically run single-page apps without Javascript? The HTML body thus becomes a tempting language, with all the content residing in the fixtures that can be dynamically reloaded without Javascript.

Example web page:
<DOCTYPE html>
<HTML LANG=“en”>
<HEAD>
<FIXTURES lang=“xml”>
	<model class=“MyArticleData”>
		<rsp stat=“ok">
			<article label=“one” id=“1">
				<headline>"Big News!”</headline>
				<body>"<p>This is the first article intro.</p><p>This is the second paragraph.</p>"</body>
			</article>
			<article label=“two” id=“2">
				<headline>"Not so big news"</headline>
				<body>"<p>This is the <em>second</em> article.</p>"</body>
			</article>
		</rsp>
	</model>
	<model class=“MyImageData”>
		<rsp stat=“ok">
			<image label="Square" width="75" height="75" source="https://mycontentserver.com/image_s.jpg" id=“3"/>
			<image label=“Tall" width=“300" height=“200" source="https://mycontentserver.com/image_l.jpg" id=“4"/>
		</rsp>
		<rsp stat=“loading">
			<image label="Square" width="75" height="75" source="https://mycontentserver.com/loading_image_s.jpg" id=“1"/>
		</rsp>
		<rsp stat=“some_error">
			<image label="Square" width="75" height="75" source="https://mycontentserver.com/error_image_s.jpg" id=“2"/>
			<message
		</rsp>
	</model>
</FIXTURES>
</HEAD>
<BODY>
	<MENU class=“controller”>
		<A href=“http://api.mywebsite.com/api/load-new-article” model=“MyArticleData">Click here to replace the articles with different articles.</A>
		<A href=“http://api.mywebsite.com/api/load-new-image” model=“MyImageData">Click here to replace the picture with a different picture.</A>
	</MENU>
	<MAIN class=“viewer”>
		<ARTICLE class=“center">
			<H1 model=“MyArticleData.rsp.article(label=‘one’).headline” />
			<SPAN model="MyArticleData.rsp.article(label=’one’).body” />
		</ARTICLE>
		<ARTICLE class=“sidebar">
			<H1 model=“MyArticleData.rsp.article(label=’two’).headline” />
			<SPAN model=“MyArticleData.rsp.article(label=’two’).body” />
		</ARTICLE>
		<IMG src=“model:MyImageData.rsp.image(label=‘Square’)#source” width=“model:MyImageData.rsp.image(label=‘Square’)#width” height=“model:MyImageData.rsp.image(label=’Square’)#height”>
	</MAIN>
</BODY>
</HTML>

Some people responding to Mozumder's proposal were not convinced about the idea.

Brian Kardell, co-author of JavaScript pollyfill engine HitchJS, replied "We've actually tried a bunch of this before, and you're not using it now so I think we can say that at some level it was unsuccessful."

Kardell went on:

I am going to submit for comment that there are a couple of significant reasons why it failed and why I don't expect we'd have much more success with it if we were to take it up right now... There isn't something close enough to actually emerging that remotely looks ready, and standards bodies are historically terrible at that class of problem.

Despite the disagreement, Mozumder noted that his proposal had "gone viral." Interpreting how widely it was being shared as an endoresement of the idea, Mozumder said "With hundreds or thousands of shares, retweets, upvotes, etc.. it looks like a lot of people want a solution like this. I don’t know how it happened, but I believe this represents peoples wide dissatisfaction with having to use JavaScript frameworks."

A lot of the discussion online around Mozumder's proposal hasn't been positive.

On Hacker News, the discussion relating to the idea had been upvoted more than 180 times, but many comments were not in agreement with the proposal.

User jkoudys said "This proposal is trying to take a common web design pattern, MVC, and make it part of the official spec. HTML is a _markup language_, it's ridiculous to use it as anything but a semantic language."

Similarly, user outsidetheparty said "Lots of very bad ideas here -- backwards-incompatibility with previous versions of HTML is always a good litmus test that a proposal hasn't been thought through. 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."

Not all of the comments were in complete disagreement with Mozumder's proposal, with Milo Mordaunt saying while the idea was "interesting" he thought HTML should be "kept strictly for templating", and that the proposal for single-page apps without JavaScript added an unnecessary amount of logic.

There has been no official comment from the World Wide Web Consortium regarding Mozumder's submission to the W3.org mailing list, and the proposal has not been endorsed by the Consortium.

Rate this Article

Adoption
Style

BT