Hasn't this been extensively discussed already?

The topic of Vue+Drupal has been discussed, but they had to do with choosing a framework for the Decoupled Admin UI component of Drupal's Admin UI & JavaScript Modernisation initiative.
This discussion is regarding the addition of Vue to improve existing core JavaScript, not to create an entirely new decoupled admin UI.

(It's also worth noting that progress on the Decoupled Admin UI stopped ~2 years ago (as of Spring 2021) and it is unlikely to resume)

For reference, those prior not-directly-relevant discussions can be found here #2913628: Proposal to use Vue.js for building Drupal’s administrative UIs, and here: #2913321: Proposal to experiment with React for building Drupal’s administrative UIs.

Problem/Motivation

I recently discovered that Vue works very nicely with Core Javascript.

I explored Vue as a possible replacement for Backbone, a library that needs to be removed from Core. #3145958: [META] Re-evaluate use of Backbone.js in core. I built prototypes for replacing Contextual's use of Backbone in Vanilla JS and Vue. The Vue prototype was easy and pleasant to build! It did an excellent job cooperating with preexisting JavaScript. Vue seemed like an option that could be gracefully added to Drupal without requiring the massive changes of the now-dormant Decoupled Admin UI.

However, the Vanilla option did its job well enough that it couldn't justify the addition of a large library like Vue. I liked the Vue version better, but Vanilla was good enough 🤷‍♂️.

The experience got me very interested in the possibility of Vue in core. I want to know if there are examples beyond by Backbone-replacement one.

What should be happening in THIS issue?

This is to get feedback regarding the ways that the community feels adding Vue could benefit core. For example, I discovered that Vue is a great replacement for Backbone - great benefit, but not great enough to justify core inclusion.

There seems to be sufficient information regarding why Vue itself is good, so this will focus on how Vue would be used to improve Drupal.

Full disclosure: this issue summary was written by someone enthusiastic about Vue. It's also an acknowledgement that there needs to be concrete justification for why it should be included. This issue could just as easily demonstrate that there is not enough incentive to add it as a library

Comments

bnjmnm created an issue. See original summary.

bnjmnm’s picture

Issue summary: View changes

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.

soul88’s picture

It seems like @nod_'s comment here: https://www.drupal.org/project/drupal/issues/3145958#comment-14151987

While I'm still on the vanilla-js boat, something that might be of interest: https://www.npmjs.com/package/petite-vue

Can at least partially address this statement:

However, the Vanilla option did its job well enough that it couldn't justify the addition of a large library like Vue. I liked the Vue version better, but Vanilla was good enough 🤷‍♂️.

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.

luksak’s picture

I know a lot has been talked about this... I'd opt for Vue, since I develop Vue apps and it would be beneficial to the Drupal ecosystem because. Here are my toughts:

Here are my pros:

  • Our communities work in a similar fashion (eg. there is on module for the job)
  • The two communities operate independent (Vue can't be droppped by a big corpoaration)
  • It has proven to be consistent (there are few BC and if so they are handled gracefully)
  • Vue keeps on innovating consistently based on community feedback
  • Vue has a community that keeps evolving the project

Opposed to that there are a few clear cons:

  • We could simply code everything in vanilla JS an be good for ever while having to maintain all those libraries we create (we could do that, but we'd need a lot of frontend people to do that, while we need to do that anyway)
  • Why would we go down the road again of integrating a JS library that we all know might be outdated completely ten years from now? (Yes, that is the time frame that we need to assess on when make this decision)

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.

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

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

anybody’s picture

Issue tags: -JavaScript +JavaScript

+1 for #6! Nothing to add, perfect!

So from my perspective, the bottom-up community from Vue is a super important point for Vue (and against React) but how can we find out, if it's really worth the dependency in core and if it will help us or become the next jQuery?

Perhaps this would need its own initiative or a Drupalcon workshop to find out? How should we proceed here?

freelock’s picture

Issue tags: -JavaScript +JavaScript

We've done a dozen Vue projects, mostly using Drupal as a back end. I'm a big fan of Vue. But I'm struggling to see what benefit this would have getting added to core, and if it was added, how it might be used by contrib modules...

In our most recent projects, we're building Vue with our code using Vite. This creates a directory of assets that browsers load directly. We treat these apps as a complete standalone module built all at once, and bootstrapped into the browser all at once.

So if this is for a decoupled admin UI, I would think this would be built for, and within, a single admin theme, or encapsulated by a single module -- making this a module- or theme- specific library, not something directly in core.

If this were added to core, how could contrib benefit from it? What does the build process look like? What if a contrib module is depending on Vue functionality from an older, or newer, version than is in core?

catch’s picture

Status: Active » Postponed (maintainer needs more info)

Going to move this to 'postponed, needs more info' until there's a use-case in mind. More recently project browser is using Svelte.

bnjmnm’s picture

Status: Postponed (maintainer needs more info) » Closed (outdated)

If we ever have to discuss again lets just open a new issue instead of looking at graying tumbleweeds.