Skip to content

Provide integration with importmaps #48349

Closed
@nicolas-grekas

Description

@nicolas-grekas

Import maps let you import JavaScript modules using logical names that map to versioned/digested files – directly from the browser.

Rails 7 supports them out of the box and I think it would be great to enable this experience in Symfony also, especially with the UX packages.

Importmaps enable building modern JavaScript applications using JavaScript libraries made for ES modules (ESM) without the need for transpiling or bundling. This frees you from needing Webpack, Yarn, npm, or any other part of the JavaScript toolchain.

That would be a great DX improvement for Symfony apps too!

Here is the gem that provides this to Rails 7, its README is a gem ;) : https://github.com/rails/importmap-rails/
And another article that gives some more hints about how this works internally: https://blog.appsignal.com/2022/03/02/import-maps-under-the-hood-in-rails-7.html

TL;DR, it looks like we "just" need a new command line + twig helper.

Of course, this would go with a few new conventions, that we might already have with the Symfony UX file layout, or that we might need to create.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions