Problem/Motivation

Back in 2007, the very first iPhone was released, the last Harry Potter book was published, and Britney Spears had an extra tough year. Also, Drupal 5 shipped with the jQuery JavaScript library.

Over ten years later, while Drupal's JavaScript has seen some great advancement since those days—for example, adopting AirBnB standards, and introducing a JavaScript build process, and upgrading to the most recent versions of jQuery and jQuery UI in 8.5—there still remains a lot of legacy JavaScript code in core from "back in the day" that makes it sub-optimal to maintain.

Additionally, modern JavaScript frameworks such as React, Angular, and Vue have gained a lot of popularity as tool kits that remove a lot of the pain around building rich, dynamic, "app-like" interactions. Drupal's current administrative UI feels very much like something that was invented in the mid-00s and has been stuck there since: basic and plain-looking forms, slow server round-trips required to make any changes, the lack of expected visual niceties from other solutions, such as live previews and drag and drop.

Therefore, our plan of attack is three-fold:

  1. Simplify. Craft a redesigned, modern administrative experience for Drupal with the aim to make it more approachable for site builders and content authors, using a JavaScript framework (React) to build it out as a single-page application. In so doing, "dog food" Drupal's REST API, which will lead to a much better developer experience for all decoupled builds, regardless of chosen framework. The intent is to create a standalone decoupled application, *not* to change anything about the Drupal theme and render layers.
  2. Modernize. Work on efforts around Drupal core's JavaScript developer experience to bring it into the 21st century. For example, modernizing the code base to ensure consistency and adherence with best practices, adding native tools for testing JavaScript with JavaScript. Our aim here is to help build a community of JavaScript-savvy Drupalist core developers and happy, energized JavaScript maintainers.
  3. Embrace. Throughout, embrace the workflows, tools, and practices familiar to existing JavaScript developers, with the aim to bring more of these developers into the Drupal community, both as users and as contributors. This means primarily developing and reviewing code related to the admin UI on GitHub (where the JavaScript community is centralized), using standard tools like create-react-app which JS developers are already familiar with, and moving code and discussion to Drupal.org only when chunks of work are ready for review. (For issues that impact "upstream" Drupal core code, those discussions will take place on Drupal.org.)

Proposed resolution

This initiative will focus on two main areas - reducing the maintenance pain for our current codebase (as this will be with us for some time still), and creating a new, alternative admin experience for Drupal.

  1. Remove architectural blockers to decoupled builds by dogfooding Drupal’s API in Drupal.
  2. Create an alternative admin experience for Drupal as a single-page React application.
  3. Create a JavaScript-based automated test suite for JavaScript
  4. Unify (and automate) JavaScript coding standards

New Admin Experience

Remove architectural blockers to decoupled builds (Target: 8.6)
While Drupal has supported "headless" builds since even the good ol' vintage Flash days of the '00s, there's always more that could be done to better support decoupled front-ends and make Drupal more enjoyable to work with for JavaScript developers. This sub-initiative covers these items.

These issues are places we need additional input to help develop a firm implementation plan on each of the following areas. These issues generally benefit not only React, but other frameworks as well.

Work with the API-First team to accomplish:

Create an alternative admin experience for Drupal as a single-page React application (Target: 8.7)

Work for this part of the initiative is happening at https://github.com/jsdrupal/drupal-admin-ui

  • Designs and specs for the redesigned admin experience: #2902399: Redesign the Admin UI
  • Prototype phase: Work together with UX team to create a better experience around the permissions page as an initial MVP (there is work currently in progress to build out a skeleton version of the permissions page to figure out the architecture https://github.com/jsdrupal/drupal-admin-ui/issues/7)
  • Progressively build out additional pages, starting with self-contained forms, then to basic configuration forms, then onto very complex pages.
  • As we build pages, extract reusable pieces into a generic component library for both general and Drupal-specific UI patterns, e.g. dropbutton, table select, drag and drop, file upload widget, etc. in the Seven style guide.

Existing Codebase

These set of issues tackle improvements to the existing code base, to make our JavaScript more approachable to new developers and more maintainable for core.

Create a JavaScript-based automated test suite for JavaScript (Target: 8.6)
While the PHP side of our code base is kickin' strong thanks to tools like PHPUnit, we're currently using PHP to also test our JavaScript code, which is suboptimal. (Testing is hard enough as it is, and JavaScript developers would vastly prefer to write tests in their "native tongue." :))

This sub-initiative aims to replace phantomjs (which is no longer needed nor maintained), with native headless Chrome provided by nightwatch. Completing this work is essential to ensuring we do not introduce regressions as we proceed with the other items in the roadmap.

Work is tracked under the JavaScriptTest issue tag.

Unify (and automate) JavaScript coding standards. (Target: 8.6)

This sub-initiative is about documenting and enforcing a consistent set of coding standards to help make JavaScript code in Drupal easier to approach, debug, and maintain. We use the ESLint utility to enforce JavaScript coding standards in our code base.

Note: this is a great place for contributors who are new to the core JavaScript initiative to get their start!

Get involved!

Interested in teaming up? Come meet with us in #javascript on Drupal Slack. In addition to general chat, we hold a weekly text-only meeting on Mondays at 17:30 UTC (what is that in my timezone?) Follow @jsdrupal on Twitter for updates, and you can find an overview of our work and its current status at https://trello.com/b/P06ukajf/drupal-javascript-initiative (we’ll be moving this to a GitHub project board in the near future).

We especially are in need of folks to help review/unblock issues tagged with "JavaScript", particularly in any of the above areas.

Addendum (things we aren’t focusing on right now, but are keeping in mind):
https://github.com/jsdrupal/drupal-admin-ui/issues?q=is%3Aopen+is%3Aissu...
#2920196: Which capabilities should modules have in a new JS based admin UI: Discusses whether or not we maintain support for things like form alters, themeable content, and so on, in a decoupled world.
#2913372: Allow forms to be defined in three segments: schema, UI, data: Essential to any form rendering to the client side.
Providing auto-generation of simple config, content + config entity forms based on config schema data: #2949888: Enhance config schema for richer default experiences

Comments

webchick created an issue. See original summary.

xjm’s picture

Issue summary: View changes

 

dubcanada’s picture

There are two options, we either build our own JSON API/REST API or we use a combination of JSON API & internal REST API.

So if #2836165: New experimental module: JSON API is postponed we need to figure out a game plan.

What are we thinking?

We also need to figure out if we want to piecemeal this (replace small parts (say the module install/uninstall page and reports) to start with) or do the entire thing over again.

Also probably want to redo the styleguide to adjust for a more modern reactive admin experience.

Basically...

  1. Figure out game plan for JSON API/REST
  2. Figure out game plan, do we replace or redo.
  3. Figure out game plan for styleguide and adjust as needed
  4. Build an auth area and get React + Redux (or what ever) + Router setup
  5. Then build out small parts of the admin area, handling CRUD for Entities last
  6. Figure out how to let people hook into components
  7. Then figure out how to handle CRUD for Entities... that is probably the most complex part
GrandmaGlassesRopeMan’s picture

Issue summary: View changes
GrandmaGlassesRopeMan’s picture

Some updates,

- We've started work on the component library, progress is here, https://github.com/jsdrupal/drupal-react-components
- A new release for the React powered DB Log UI was just created, https://www.drupal.org/project/react_admin

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.0-alpha1 will be released the week of January 17, 2018, which means new developments and disruptive changes should now be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

tedbow’s picture

webchick’s picture

Ok, here is a pretty massive update to our issue summary, laying out the plans laid down at DrupalCamp Florida a couple of weeks ago.

TL;DR:

  1. Remove architectural blockers to decoupled builds by dogfooding Drupal’s API in Drupal.
  2. Create an alternative admin experience for Drupal as a single-page React application
  3. Create a JavaScript-based automated test suite for JavaScript
  4. Unify (and automate) JavaScript coding standards

This plan was run past the core committers on last week's meeting, and there were some outstanding concerns, so adding the various "Needs * manager review" tags to signal that this plan hasn't yet been formally approved, though it is what the JS Modernization team is currently working on, so this provides some visibility into that.

effulgentsia’s picture

mgifford’s picture

Issue summary: View changes
tedbow’s picture

I have heard through the grapevine that there has been a lot of progress and some changes in direction in this initiative especially at Frontend United at the beginning of June and then also at Dev Days at the beginning of July.

@webchick or someone can we get an update on this issue? or is there somewhere else this is being tracked?
Thanks

Version: 8.6.x-dev » 8.7.x-dev

Drupal 8.6.0-alpha1 will be released the week of July 16, 2018, which means new developments and disruptive changes should now be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

colan’s picture

I just watched the Driesnote video, and the demo in there mentioned that drag & dropping files was done, but I've seen no updates to #2113931: File Field design update: Upload field. lately. Was this done in another issue (that I can't find), or has that one simply not been updated yet?

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

kwadz’s picture

Issue tags: -JavaScript +JavaScript

I see this issue is "Major" while the last update was 2 years ago. Was there a change in the plans? If so, could someone add a link to the new direction?

anruether’s picture

shaal’s picture

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

ambient.impact’s picture

Apologies if this has been covered elsewhere, or has been discussed to death somewhere and I've missed it, but I haven't really seen any talk about resilience and what steps are being taken to ensure a new JavaScript-based admin UI handles situations where JavaScript fails to correctly run, either because of an error (it being much more brittle compared to HTML and CSS) or something to do with the network, i.e. a company firewall altering/blocking certain things. If there's no fallback in those edge cases, users may end up with broken or incomplete UI. This might seem like a very unlikely scenario, but it does happen and more often than one might think, as devs from the BBC explain in this thread, and BuzzFeed statistics seem to indicate.

To be clear: I'm very much for this initiative, and I advocate for JavaScript quite often, but something that's meant to be deployed as widely as Drupal needs to have an admin UI that's resilient and works under almost any conditions.

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

andypost’s picture

itamair’s picture

Question: is this initiative still going on?
I don't see where most recent activity is happening around here.
Last commit on https://github.com/jsdrupal/drupal-admin-ui is dated 1 Jun 2019 ...

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

bnjmnm’s picture

There are many efforts described in this issue, but I presume most questions regarding the status of things are specific to the React admin UI. While it's certainly possible that this could be revitalized by motivated Drupal contributors, there's little to suggest anyone is interested in picking up that baton. It's reasonably safe to categorize the React admin UI as "not happening". There are many great improvements happening in Drupal's admin UI, but they aim to improve specific features vs rearchitecting the entire thing.

I believe it is time mourn this specific feature, if you have not done so already. I also urge everyone to keep a space in your heart to honor the heated discourse that this unrealized feature generated during it's brief-yet-bright lifespan.

ambient.impact’s picture

Personally, I'd prefer to see effort put towards a framework that can be applied not just to the administration area but a site as a whole, and especially one that puts progressive enhancement front and centre like Hotwire Turbo and Symfony UX Turbo do. That's what we have planned in #3294430: RefreshLess 2.x roadmap

bnjmnm’s picture

Status: Active » Closed (outdated)