dropseed / django-importmap Goto Github PK
View Code? Open in Web Editor NEWJavaScript import maps for Django
License: MIT License
JavaScript import maps for Django
License: MIT License
Hi there,
I found the package schema a bit confusing when adding multiple packages.
Currently, I'd have to do something like this:
[[packages]]
name = "htmx.org"
source = "[email protected]"
[[packages]]
lit = "lit"
source = "[email protected]"
Yet, from Pipenv or Poetry I am more used to something like this:
[[packages]]
htmx.org = "1.9.8"
lit = "3.0.2"
Maybe this is worth a consideration. I know it's a backwards incompatible change, but since this package is in its early days, this could be the perfect time to do such alterations.
Cheers!
Joe
Hey, first, awesome work!
I saw your todo list and would also like some kind of watch mode that keeps running and just rebuilds the .lock file in case of file changes (see e.g. here: https://stackoverflow.com/questions/6271719/reusing-django-code-auto-reload-functionality-for-custom-management-commands)
An alternative could be to have the template tag to refresh the .lock file IF in DEBUG mode (or any other flag set).
What do you think of that?
(I would love to do a PR for this)
Hi there ๐,
Just wanted to share some love โค๏ธ
I wanted to upgrade to ESM loading in the browser instead of bundled development for a while now.
This is a great step towards such a future in the Django world.
Please let me know if you have a donation link. I'd love to support this project.
I'd also be happy to contribute. My main interest would be adding support for JS unit tests.
Thanks for working on such a project.
Cheers!
Joe
I want to add application specific entries to the importmap (e.g. static/some/file.js
in development and {{ STATIC_URL }}some/file-[hash].js
in production) and not only jspm.io libraries. Since browsers seems to only support a single importmap, I believe I have to inject my entries into the importmap JSON data generated by django-importmap before rendering it in a template.
Is there any plan/interest in having django-importmap support local files? If not, maybe there should be a documented way to extend the importmap?
I believe importmap-rails has support for something like this (though I guess Rails is less "frontend agnostic" than Django, so it might be hard to come up with a good general solution).
The parameter cannot be overriden in the importmap.toml
(IIRC the marshmallow here: https://github.com/dropseed/django-importmap/blob/master/importmap/core.py#L26)
The only solution I can see is to have a custom ImportMap
class, but currently we can't customize that via a const in settings.py
. (Or I'm missing something)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.