Skip to content

[AssetMapper] generate importmap with remote links #52304

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
tacman opened this issue Oct 26, 2023 · 7 comments
Open

[AssetMapper] generate importmap with remote links #52304

tacman opened this issue Oct 26, 2023 · 7 comments

Comments

@tacman
Copy link
Contributor

tacman commented Oct 26, 2023

Description

On a related note, sometimes I want to share an example with a library developer, and would like the importmap to use the actual esm links to jsdelivr instead of the downloaded files.

Here I was trying to explain to a library developer an issue: https://datatables.net/forums/discussion/77434/typeerror-t-is-not-a-function#latest

Obviously, providing the importmap wasn't useful, as it was a bunch of hashed, downloaded files. I needed to create a jsfiddle that showed the problem, but it was tedious to look up each library.

Example

importmap('app', remote=true) generate something like this:

<script type="importmap">
 "imports": {
   "bootstrap": "https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/+esm",
   "jquery": "https://cdn.jsdelivr.net/npm/jquery@3.7.1/+esm"
}
</script>

So that I could use

<script type="module">
        import bootstrap from "bootstrap"
        import jQuery from "jquery"
</script>

And have the link tags do the same thing. That way, the web page that's created becomes portable.

I would also use this feature to give an HTML page to a web designer, so they could focus on the CSS and HTML without the burden of installing the entire platform. Indeed, I've found it very difficult to find web designers who can install php, node, yarn and the symfony CLI in order to fix some CSS. Thus I love AssetMapper, and this feature would make for really portable pages.

@carsonbot
Copy link

Thank you for this issue.
There has not been a lot of activity here for a while. Has this been resolved?

@tacman
Copy link
Contributor Author

tacman commented Apr 27, 2024

I would still like this feature, for the reasons mentioned above.

@carsonbot
Copy link

Thank you for this suggestion.
There has not been a lot of activity here for a while. Would you still like to see this feature?
Every feature is developed by the community.
Perhaps someone would like to try?
You can read how to contribute to get started.

@tacman
Copy link
Contributor Author

tacman commented Oct 29, 2024

FWIW, I still think this feature would be great.

@carsonbot carsonbot removed the Stalled label Oct 29, 2024
@carsonbot
Copy link

Thank you for this suggestion.
There has not been a lot of activity here for a while. Would you still like to see this feature?
Every feature is developed by the community.
Perhaps someone would like to try?
You can read how to contribute to get started.

@carsonbot
Copy link

Could I get a reply or should I close this?

@tacman
Copy link
Contributor Author

tacman commented May 14, 2025

Perhaps I can make a PR sometime, it does seem to be useful, at least to me.

@carsonbot carsonbot removed the Stalled label May 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants