3 ms·
> Yet again, the RESTful API comes to our rescue. Thanks to its simple JSON output, we’re able to use JavaScript to its full potential, using ReactJS or Angular
by mbesto 11y ago
> Yet again, the RESTful API comes to our rescue. Thanks to its simple JSON output, we’re able to use JavaScript to its full potential, using ReactJS or AngularJS to craft beautiful and fast front end experiences, taking advantage of many of the new HTML5 browser APIs that have become available over the past few years, including localStorage and more recently, service workers. Even better, we don’t have to use jQuery.
Can someone explain to me why using a front-end javascript framework for entirely static content would be a sound idea?
- voltagex_ 11y agoI wish I could just use the same APIs to dump out static pages to host on something like GitHub pages. External JS could take care of the stats (for the few users who don't block it)
- detaro 11y agoBecause that's what the cool kids use. /s I think a good API would be great to have for a CMS (and one could or maybe even should run the normal frontend of it), but not for this reason. EDIT: And if you build non-standard-CMS apps on top of or using data from the CMS, then you could use React or whatever and the API.
- darylteo 11y agoIt's just an example. I would never say anything is never a good idea... there just needs to be specific conditions that would require it. Hypothetically simple scenario could be running WP as user management, and i18n translations, for a single page application. For the most part, I can imagine a node.js application layer that simply interfaces with wordpress api in the back. WP can be upgraded as and when needed, and the frontend application isn't tied down by clumsy php templating. A separate api with oauth and token authorization could be layered on top for mobile applications. This is looking towards making wp more open to developers in other ecosystems (an area which is considerably lacking other places like .Net. Umbraco? Sharepoint? ew)
- wmil 11y agoI used to use a mobile RSS reader that was just a phonegap app. It was useful for downloading reading for my morning subway ride. Cell service on the TTC has been long project filled with fail. In general I expect that it's not the best solution. But look at projects like turbolinks. JS replacement is quicker than a full page reload.