Move all JS in modules to a js/ folder

Created on 7 May 2015, over 9 years ago
Updated 14 September 2024, 3 months ago

Problem/Motivation

Just like CSS, we need to move all javascript files to a js subfolder inside modules and update the library information for those modules.

A module that does it well and can be used as reference is the toolbar module.

Steps to reproduce

N/A

Proposed resolution

Move module js files into a js folder and deprecate old paths

Remaining tasks

Check if all files are moved
Review

User interface changes

N/A

Introduced terminology

N/A

API changes

N/A

Data model changes

N/A

Release notes snippet

Possibly but would just reference the CR https://www.drupal.org/node/3471539 β†’

πŸ“Œ Task
Status

Fixed

Version

11.0 πŸ”₯

Component
JavascriptΒ  β†’

Last updated 3 days ago

Created by

πŸ‡«πŸ‡·France nod_ Lille

Live updates comments and jobs are added and updated live.
  • Needs release manager review

    It is used to alert the release manager core committer(s) that an issue significantly affects the overall technical debt or release timeline of Drupal, and their signoff is needed. See the governance policy draft for more information.

Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡¬πŸ‡§United Kingdom catch

    Opened πŸ“Œ Add a deprecation support for library-overrides Active for deprecation/bc support.

  • First commit to issue fork.
  • Merge request !9251Move all JS in modules to a js/ folder β†’ (Closed) created by quietone
  • πŸ‡³πŸ‡ΏNew Zealand quietone

    I converted the latest patch to an MR.
    There were conflicts in the following, but it was a simple conversion.

    • ./core/.eslintignore
    • ./core/modules/system/tests/modules/twig_theme_test/templates/twig_theme_test.file_url.html.twig
    • ./core/modules/filter/filter.libraries.yml
    • ./core/modules/locale/tests/src/Functional/LocaleJavascriptTranslationTest.php
    • ./core/modules/field_ui/field_ui.libraries.yml

    Leaving at Needs work for adding deprecations.

  • Pipeline finished with Failed
    4 months ago
    Total: 615s
    #257993
  • Status changed to Needs review 4 months ago
  • πŸ‡³πŸ‡ΏNew Zealand quietone

    I updated the MR to add the deprecations. This is tagged for tests. What tests are needed?

  • πŸ‡«πŸ‡·France nod_ Lille

    Tests were asked before we had the deprecation process for files, so we're good to go here I think.

  • Status changed to Needs work 4 months ago
  • πŸ‡«πŸ‡·France nod_ Lille

    Thanks for getting this going, comment in the MR

  • Status changed to Needs review 4 months ago
  • πŸ‡³πŸ‡ΏNew Zealand quietone

    Yes, I wasn't sure about the deprecations but went ahead anyway. Using the correct version provided I updated the other instances, and updated the 'How to deprecate' policy.

    There is one failing test, core/modules/layout_builder/tests/src/FunctionalJavascript/BlockFilterTest.php, which often fails for me lately although I don't see it in the list of known random failures, 🌱 [meta] Known intermittent, random, and environment-specific test failures Active

    The CR still needs to be updated.

  • πŸ‡³πŸ‡ΏNew Zealand quietone

    I updated the CR to the current state of the MR.

    Then went hunting for *.js file not in a js directory. This command seems to work for that. They are all in tests except for core/modules/ckeditor5/webpack.config.js.

    $ find core/modules -iname \*.js | sort -u | grep -v Nightwatch | grep -v "/js/"
    core/modules/ckeditor5/webpack.config.js
    core/modules/system/tests/modules/sdc_test/components/my-button/my-button.js
    core/modules/system/tests/modules/sdc_test/components/my-cta/my-cta.js
    core/modules/system/tests/modules/sdc_test_replacements/components/my-button/my-button.js
    core/modules/system/tests/themes/sdc_theme_test/components/lib-overrides/lib-overrides.js

    I am guessing the ones in core/modules/system/tests/modules should be moved.

  • First commit to issue fork.
  • Pipeline finished with Success
    3 months ago
    Total: 1152s
    #280436
  • Status changed to Needs work 3 months ago
  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    Cleaned up the IS some.

    Left 1 comment on the MR.

    Previously rebased just to get the tests to run again and failure before was random, can't re-run manually as MR was opened by a committer.

  • Status changed to Needs review 3 months ago
  • πŸ‡³πŸ‡ΏNew Zealand quietone
  • Status changed to RTBC 3 months ago
  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    Thanks rest looks good!

  • Status changed to Needs work 3 months ago
  • πŸ‡«πŸ‡·France nod_ Lille

    Still an issue with the library names. I updated the change record to make it easier to understand hopefully: https://www.drupal.org/node/3432773 β†’

  • Status changed to Needs review 3 months ago
  • πŸ‡³πŸ‡ΏNew Zealand quietone

    @nod_, thanks for updating the CR.

    Hopefully, these changes are correct.

  • Status changed to RTBC 3 months ago
  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    That's my mistake also I was not aware of that @nod_

    Deprecation seems to be inline with the deprecation example in the CR https://www.drupal.org/project/drupal/issues/3458589 πŸ“Œ Deprecate $variables['page'] for node.html.twig Needs review

  • πŸ‡¬πŸ‡§United Kingdom alexpott πŸ‡ͺπŸ‡ΊπŸŒ

    Committed e9a2e9a and pushed to 11.x. Thanks!

  • Status changed to Fixed 3 months ago
    • alexpott β†’ committed e9a2e9ab on 11.x
      Issue #2484623 by quietone, anavarre, nod_, Manuel Garcia, rteijeiro,...
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024