#36969: collectstatic post-processing with support_js_module_import_aggregation
breaks on certain javascript files
------------------------+-----------------------------------------------
Reporter: blighj | Type: Bug
Status: new | Component: contrib.staticfiles
Version: 6.0 | Severity: Normal
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
------------------------+-----------------------------------------------
The regular expressions to find import/export statements in javascript can
work in common cases but still have plenty of failure modes. A lot of the
failures were in comments, which were getting tracked in #21080. But there
will always remain others, the complexity space of javascript is more than
the regexs can handle. Any code with import like statements in strings
will break it for sure.
- https://code.djangoproject.com/ticket/21080#comment:26
- https://code.djangoproject.com/ticket/35371
- https://code.djangoproject.com/ticket/34322#comment:17
- https://code.djangoproject.com/ticket/32849
To my mind this is a bug, where potentially the only viable solution is a
lexer/parser as proposed by Adam in the thrid ticket linked. Which could
merit a DEP for a bug!
Or it might just need some sort of update to the docs to articulate
Carlton's point in this comment
https://code.djangoproject.com/ticket/32319#comment:21
It's not clear the [regex approach] covers all usages, but it looks OK
for common cases.
I think we need to be prepared to say where we're **not** going to try
more complex solutions.
But let's see... 😬
In either case I think it is usefull to have one ticket that tracs all
these regex failures in one place, rather than having multiple tickets
that are sort of duplicates of this 'regex not working' issue..
There is the package django-manifeststaticfiles-enhanced which provides
the lexer solution.
--
Ticket URL: <https://code.djangoproject.com/ticket/36969>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/django-updates/0107019cbaed811a-69588c83-7659-4089-af88-c9e578e75cee-000000%40eu-central-1.amazonses.com.