Skip to content
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

Use import maps #2031

Open
niklasmohrin opened this issue Oct 9, 2023 · 0 comments
Open

Use import maps #2031

niklasmohrin opened this issue Oct 9, 2023 · 0 comments
Labels
Attempt This might turn out to be not (easily) implementable. In this case we'll probably close the issue. [C] Infrastructure Infrastructural work around the main EvaP project [T] Refactoring Existing parts should become faster, more readable, or in any other way better.

Comments

@niklasmohrin
Copy link
Member

Javascript / Typescript imports are a bit weird sometimes, for example you have to import from .js files when in a .ts file. Additionally, we currently use the support_js_module_import_aggregation option of Django's ManifestStaticFilesStorage to change the imports of javascript files we serve so that they use a filename with a hash in it (this avoids fetching a cached, outdated file).

However, there is also a builtin feature: Import maps. This way, we could switch out utils.js for utils and also ensure that we are using the same version of a file everywhere.

A nice bonus: Currently, all files including foo.js need to be updated when the hash of foo.js changes and therefore also get a new hash and will not be cached anymore. This will not happen anymore with import maps.

@niklasmohrin niklasmohrin added [C] Infrastructure Infrastructural work around the main EvaP project [T] Refactoring Existing parts should become faster, more readable, or in any other way better. Attempt This might turn out to be not (easily) implementable. In this case we'll probably close the issue. labels Oct 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Attempt This might turn out to be not (easily) implementable. In this case we'll probably close the issue. [C] Infrastructure Infrastructural work around the main EvaP project [T] Refactoring Existing parts should become faster, more readable, or in any other way better.
Development

Successfully merging a pull request may close this issue.

1 participant