Problem/Motivation

Follow-up for #3306208-24: Deprecate farbtastic in 9.5.x

Proposed resolution

Add the library

Remaining tasks

Wait parent commited, patch, commit, release

User interface changes

API changes

Data model changes

Issue fork color-3306607

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

andypost created an issue. See original summary.

lauriii’s picture

I don't think we should add the library code to the module because that's agains the security team policy: https://www.drupal.org/docs/develop/git/setting-up-git-for-drupal/drupal.... Maybe we could use a CDN or libraries API?

andypost’s picture

Status: Postponed » Active

At least for now it could be a part of color 1.x - when we'll find volunteer to maintain it could be decoupled

catch’s picture

One of the exceptions to the no 3rd party library rules is:

is no longer maintained by the original author;

(per https://www.drupal.org/docs/develop/git/setting-up-git-for-drupal/drupal...)

So... I think it would be OK to include it directly if other options are tricky.

longwave’s picture

Do we even need Farbtastic any more? The reason we used it was because long ago, browsers did not have color pickers. But since IE11 is no more all modern browsers support <input type="color"> - so should we consider refactoring the module to use the native color picker instead?

andypost’s picture

wim leers’s picture

Per @xjm.

wim leers’s picture

So, here too, we need to deal with the whole "how to ship an external asset library" question. For CKEditor 4, an exemption was made because of the vast security implications and extremely painful build process — see #3306909: Get Drupal Security Team approval to commit vendor/ckeditor.js to the drupal/ckeditor project.

That is not true here: https://github.com/mattfarina/farbtastic requires no build process whatsoever.

I think that here too we want to use an approach like https://git.drupalcode.org/project/quickedit/-/merge_requests/13/diffs?c... load https://cdn.jsdelivr.net/gh/mattfarina/farbtastic@1.3u/farbtastic.js from that external CDN.

Also note that Drupal core claims to ship with version 1.2 but according to https://github.com/mattfarina/farbtastic/tags that simply does not exist 🤷

Thoughts?

longwave’s picture

The missing 1.2 release has been an issue for years: https://github.com/mattfarina/farbtastic/issues/27

I don't know what the difference is between that and 1.3u, if anything.

edit: there seems to be no difference, given the output of git log --p --follow core/assets/vendor/farbtastic/farbtastic.js; we added a header and moved the file around, but the code itself was last updated in #623292: Update Farbtastic

I *think* that core.libraries.yml is wrong, and should say we are shipping 1.3u instead.

nod_’s picture

From what I remember that 1.3 is yet another version.

Given that it's way way unmaintained, there is no tag = no CDN version, it could be an exception maybe?

nod_’s picture

huh, yeah the version is wrong. I think I had it confused with joyride. so ignore my comment in #10

So yeah the cdn solution would work +1 to that.

nod_’s picture

Something like this

andypost’s picture

Looks right 👍

Commented nitpick about license abbreviation https://spdx.org/licenses/preview/

wim leers’s picture

Status: Needs review » Needs work

@nod_ the

Drupal\Core\Extension\Exception\UnknownExtensionException: Unknown themes: bartik.

failure means that we need to update the *.info.yml file to add a test-only dependency on the Bartik contrib theme, since https://git.drupalcode.org/project/color/-/blob/2.x/color.info.yml does not yet do that.

Had to do something similar for contrib Quick Edit the other day: https://git.drupalcode.org/project/quickedit/-/commit/00a8710d0796286626...

nod_’s picture

Status: Needs work » Needs review

all right, sweet.

wim leers’s picture

Title: Add farbtastic library deprecated in 9.5 » Add farbtastic library to color module because it was deprecated in core 9.5
Status: Needs review » Reviewed & tested by the community

  • andypost committed a9187f9 on 1.x authored by nod_
    Issue #3306607 by nod_: Add farbtastic library to color module because...

  • andypost committed 03b8c8f on 2.x authored by nod_
    Issue #3306607 by nod_: Add farbtastic library to color module because...
andypost’s picture

Status: Reviewed & tested by the community » Fixed

Thank you! pushed to 1.x and 2.x

Also tagged https://www.drupal.org/project/color/releases/1.0.3

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.