Merge with importmap module

Created on 7 November 2023, about 1 year ago

Problem/Motivation

It looks like we had the same idea around the same time: https://www.drupal.org/project/importmap β†’
(I think your module did not exist yet when I looked for existing implementations a few weeks ago.)

Proposed resolution

Your approach seems definitely cleaner.
I am totally OK with archiving my module and redirecting to yours, but they would need to have feature parity before doing this.

Remaining tasks

Here is what I think my module does that yours does not yet:

  • A way to declare imports dynamically (something similar to hook_library_info_build)
  • Support for scoped imports (scopes key in the importmap JSON)
  • Invalidating browser cache when the JS files are upadted (similar to what core does)
  • Optionally generate <link rel="modulepreload"> tags for modules in the importmap (this can help the browser parallelize requests, especially with long import chains)
πŸ“Œ Task
Status

Fixed

Version

1.0

Component

Code

Created by

πŸ‡«πŸ‡·France prudloff Lille

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @prudloff
  • πŸ‡¦πŸ‡ΊAustralia larowlan πŸ‡¦πŸ‡ΊπŸ.au GMT+10

    Thanks for listing the differences.
    FWIW

    A way to declare imports dynamically (something similar to hook_library_info_build)

    , there is a standard alter hook here courtesy of the plugin manager so that is supported.

    But you're correct, the other three aren't supported.

    I think we'd be better to try and get this into core by 10.3 and mark both issues as deprecated?

    I'm not using this module in production anywhere (and there is no tagged release). So I think I'll deprecate it now and update the project page to point to yours and the core issue.

  • πŸ‡¦πŸ‡ΊAustralia larowlan πŸ‡¦πŸ‡ΊπŸ.au GMT+10
  • Status changed to Fixed about 1 year ago
  • πŸ‡¦πŸ‡ΊAustralia larowlan πŸ‡¦πŸ‡ΊπŸ.au GMT+10
  • πŸ‡¦πŸ‡ΊAustralia larowlan πŸ‡¦πŸ‡ΊπŸ.au GMT+10

    Ah I did make an alpha release, I didn't realise. Either way updated the project page to point to your module and added a note about the core issue.

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

Production build 0.71.5 2024