Re: [Django] #35371: False positive in JS module aggregation export regex when an export declaration precedes an import declaration

27 views
Skip to first unread message

Django

unread,
Sep 23, 2024, 12:19:41 PM9/23/24
to django-...@googlegroups.com
#35371: False positive in JS module aggregation export regex when an export
declaration precedes an import declaration
-------------------------------------+-------------------------------------
Reporter: Michael | Owner: Calvin Vu
Type: Bug | Status: assigned
Component: contrib.staticfiles | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Calvin Vu):

* cc: Calvin Vu (added)
* owner: nobody => Calvin Vu
* status: new => assigned

--
Ticket URL: <https://code.djangoproject.com/ticket/35371#comment:4>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Oct 3, 2024, 2:21:25 PM10/3/24
to django-...@googlegroups.com
#35371: False positive in JS module aggregation export regex when an export
declaration precedes an import declaration
-------------------------------------+-------------------------------------
Reporter: Michael | Owner: Calvin Vu
Type: Bug | Status: assigned
Component: contrib.staticfiles | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Calvin Vu):

An observation: the extra line you add at the beginning of {{{module.js}}}
doesn't even have to be a proper export, if you add even {{{//export}}}
before the imports then it raises the same ValueError
--
Ticket URL: <https://code.djangoproject.com/ticket/35371#comment:5>

Django

unread,
Oct 12, 2024, 2:38:15 PM10/12/24
to django-...@googlegroups.com
#35371: False positive in JS module aggregation export regex when an export
declaration precedes an import declaration
-------------------------------------+-------------------------------------
Reporter: Michael | Owner: Calvin Vu
Type: Bug | Status: assigned
Component: contrib.staticfiles | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Calvin Vu):

* has_patch: 0 => 1

--
Ticket URL: <https://code.djangoproject.com/ticket/35371#comment:6>

Django

unread,
Oct 24, 2024, 5:21:24 AM10/24/24
to django-...@googlegroups.com
#35371: False positive in JS module aggregation export regex when an export
declaration precedes an import declaration
-------------------------------------+-------------------------------------
Reporter: Michael | Owner: Calvin Vu
Type: Bug | Status: assigned
Component: contrib.staticfiles | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Sarah Boyce):

* needs_better_patch: 0 => 1

--
Ticket URL: <https://code.djangoproject.com/ticket/35371#comment:7>

Django

unread,
Jul 25, 2025, 7:15:00 AM7/25/25
to django-...@googlegroups.com
#35371: False positive in JS module aggregation export regex when an export
declaration precedes an import declaration
-------------------------------------+-------------------------------------
Reporter: Michael | Owner: Calvin Vu
Type: Bug | Status: assigned
Component: contrib.staticfiles | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by blighj):

This package I've been working on and hoping to get feedback on, takes
care of this ticket as it is no longer using regex's to parse
import/export statements ​https://github.com/blighj/django-
manifeststaticfiles-enhanced
--
Ticket URL: <https://code.djangoproject.com/ticket/35371#comment:8>

Django

unread,
Aug 18, 2025, 2:18:34 PM8/18/25
to django-...@googlegroups.com
#35371: False positive in JS module aggregation export regex when an export
declaration precedes an import declaration
-------------------------------------+------------------------------------
Reporter: Michael | Owner: blighj
Type: Bug | Status: assigned
Component: contrib.staticfiles | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+------------------------------------
Changes (by blighj):

* owner: Calvin Vu => blighj

Comment:

https://github.com/django/django/pull/19561 Will solve this ticket too.
This ticket can be closed if that is approved
--
Ticket URL: <https://code.djangoproject.com/ticket/35371#comment:9>

Django

unread,
Mar 18, 2026, 5:33:40 PMMar 18
to django-...@googlegroups.com
#35371: False positive in JS module aggregation export regex when an export
declaration precedes an import declaration
-------------------------------------+------------------------------------
Reporter: Michael | Owner: blighj
Type: Bug | Status: assigned
Component: contrib.staticfiles | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+------------------------------------
Comment (by blighj):

New Plan. The approach in that PR has been rejected in favour of improving
the regex approach, but don't be discouraged, the PR associated with
#36969 will resolve this ticket. This ticket can then be closed if that is
approved.
--
Ticket URL: <https://code.djangoproject.com/ticket/35371#comment:10>

Django

unread,
Jun 11, 2026, 1:35:56 PMJun 11
to django-...@googlegroups.com
#35371: False positive in JS module aggregation export regex when an export
declaration precedes an import declaration
-------------------------------------+-------------------------------------
Reporter: Michael | Owner: blighj
Type: Bug | Status: assigned
Component: contrib.staticfiles | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Jacob Walls):

* needs_better_patch: 1 => 0
* stage: Accepted => Ready for checkin

Comment:

Fixed & tested in
[https://github.com/django/django/pull/20942#issuecomment-4683101604 PR].
--
Ticket URL: <https://code.djangoproject.com/ticket/35371#comment:11>

Django

unread,
Jun 11, 2026, 4:26:56 PMJun 11
to django-...@googlegroups.com
#35371: False positive in JS module aggregation export regex when an export
declaration precedes an import declaration
-------------------------------------+-------------------------------------
Reporter: Michael | Owner: blighj
Type: Bug | Status: closed
Component: contrib.staticfiles | Version: dev
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Jacob Walls <jacobtylerwalls@…>):

* resolution: => fixed
* status: assigned => closed

Comment:

In [changeset:"f1440a752ec034277ccdad914995c3f164308e41" f1440a7]:
{{{#!CommitTicketReference repository=""
revision="f1440a752ec034277ccdad914995c3f164308e41"
Fixed #36969, #35371 -- Reduced false positives in strings during
collectstatic.

Thanks Johannes Maron for reviews.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/35371#comment:12>

Django

unread,
Jun 11, 2026, 4:28:01 PMJun 11
to django-...@googlegroups.com
#35371: False positive in JS module aggregation export regex when an export
declaration precedes an import declaration
-------------------------------------+-------------------------------------
Reporter: Michael | Owner: blighj
Type: Bug | Status: closed
Component: contrib.staticfiles | Version: dev
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Jacob Walls <jacobtylerwalls@…>):

In [changeset:"627082c4a267b6922141e36800bdd71589e39a92" 627082c]:
{{{#!CommitTicketReference repository=""
revision="627082c4a267b6922141e36800bdd71589e39a92"
[6.1.x] Fixed #36969, #35371 -- Reduced false positives in strings during
collectstatic.

Thanks Johannes Maron for reviews.

Backport of f1440a752ec034277ccdad914995c3f164308e41 from main.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/35371#comment:13>
Reply all
Reply to author
Forward
0 new messages