There is excitement in WordPress community about upcoming REST API. It represents an opportunity to build JavaScript driven sites on top of WordPress. Unfortunately the trend seems to ignore progressive enhancement principles.
If you build a content site which needs JavaScript to work — what you have is a broken site.
Broken site plus JS
[update] this section was amended to remove negative example of specific site in favor of generic description of the issue.
From the materials and WordCamp talks I saw REST API currently goes hand in hand with such JavaScript frameworks as React.
The major oversight is that those frameworks go hand in hand with Node.js server–side. Facility, which PHP–powered WordPress core simply doesn’t have.
This creates a rift in templating between server and client. Rift which developers tend to ignore in favor of building site that only receives data via API and is templated client–side.
And it is broken.
If your content website breaks down from JavaScript issue — it is broken.
That this considered to be acceptable future of WordPress sites is terrifying.
Not everyone has JS
JavaScript goes through a surge of popularity due to the lure of availability. There is no alternative languages to use for client–side code in browsers.
But people confuse availability with reliability. Hard JavaScript dependency is a fallacy and a foundation of sand.
Everyone has Javascript, right? site explains that well. Unfortunately people shrug that off, because JS sites is what they want.
But you can make JS sites that still work without JS.
Site that works plus JS
Composer in WordPress is a JS site I had built while back with pjax (and other buzzwords). It features that desirable app–like experience with blazing fast content navigation, without page reload.
When JavaScript is unavailable or fails for any reason at all — it just works as a “normal” boring site.
Progressive enhancement — make site that works first, then make it better with JavaScript.
Progressive enhancement, please
Please make content sites that work for everyone. You don’t have to discard fancy JS toys for that, only learn how to use them better.
Please do not reinvent content, images, forms, scrollbars, and so on with JavaScript. They work just fine in first place, just sprinkle them with bits of improved experience here and there.
Otherwise you are just paving a road to a more shitty web.
Responses
- Progressive Enhancement by Joe Hoyle
- Progressive Enhancement—Ain’t Nobody Got Time for that by Caspar Hübinger
- Thoughts on Progressive Enhancement and Accessibility by Mike Little
More on topic
- Where to start? by Jeremy Keith
- Interaction Is an Enhancement by Aaron Gustafson
Caspar Hübinger #
Joe Hoyle #
Andrey “Rarst” Savchenko #
Noel Tock #
Andrey “Rarst” Savchenko #
Leho Kraav @lkraav #
Andrey “Rarst” Savchenko #
Francis Kim #
Mike Little #
Andrey “Rarst” Savchenko #