[Django] #33765: ManifestStaticFilesStorage doesn't support trailing whitespace for JS source map references

22 views
Skip to first unread message

Django

unread,
Jun 3, 2022, 6:51:48 AM6/3/22
to django-...@googlegroups.com
#33765: ManifestStaticFilesStorage doesn't support trailing whitespace for JS
source map references
-----------------------------------------------+------------------------
Reporter: Adam Johnson | Owner: nobody
Type: Bug | Status: new
Component: contrib.staticfiles | Version: 4.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 |
-----------------------------------------------+------------------------
#32383 added support for JS source map references, but the regex is
incomplete. Browsers ignore trailing whitespace in source map references,
but the regex we added did not allow for that. Whilst trailing whitespace
is unlikely to be used, since source maps are normally generated by
automated tools that shouldn't add it, we should ignore it to match
browser behaviour.

Spotted during discussion on [this PR
https://github.com/django/django/pull/15475] for a similar fix on CSS
source map references.

(Also as discussed, I tested the inital space being a tab, or more than
one space, and those options are not supported by Firefox.)

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

Django

unread,
Jun 3, 2022, 7:08:05 AM6/3/22
to django-...@googlegroups.com
#33765: ManifestStaticFilesStorage doesn't support trailing whitespace for JS
source map references
-------------------------------------+-------------------------------------

Reporter: Adam Johnson | Owner: nobody
Type: Bug | Status: new
Component: contrib.staticfiles | Version: 4.0
Severity: Normal | Resolution:

Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Description changed by Adam Johnson:

Old description:

> #32383 added support for JS source map references, but the regex is
> incomplete. Browsers ignore trailing whitespace in source map references,
> but the regex we added did not allow for that. Whilst trailing whitespace
> is unlikely to be used, since source maps are normally generated by
> automated tools that shouldn't add it, we should ignore it to match
> browser behaviour.
>
> Spotted during discussion on [this PR
> https://github.com/django/django/pull/15475] for a similar fix on CSS
> source map references.
>
> (Also as discussed, I tested the inital space being a tab, or more than
> one space, and those options are not supported by Firefox.)

New description:

#32383 added support for JS source map references, but the regex is
incomplete. Browsers ignore trailing whitespace in source map references,
but the regex we added did not allow for that. Whilst trailing whitespace
is unlikely to be used, since source maps are normally generated by
automated tools that shouldn't add it, we should ignore it to match
browser behaviour.

Spotted during discussion on [https://github.com/django/django/pull/15475
this PR] for a similar fix on CSS source map references.

(Also as discussed, I tested the inital space being a tab, or more than
one space, and those options are not supported by Firefox.)

--

--
Ticket URL: <https://code.djangoproject.com/ticket/33765#comment:1>

Django

unread,
Jun 3, 2022, 7:09:34 AM6/3/22
to django-...@googlegroups.com
#33765: ManifestStaticFilesStorage doesn't support trailing whitespace for JS
source map references
-------------------------------------+-------------------------------------
Reporter: Adam Johnson | Owner: Adam
| Johnson
Type: Bug | Status: assigned
Component: contrib.staticfiles | Version: 4.0
Severity: Release blocker | 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 Mariusz Felisiak):

* owner: nobody => Adam Johnson
* status: new => assigned
* has_patch: 0 => 1
* severity: Normal => Release blocker
* stage: Unreviewed => Accepted


--
Ticket URL: <https://code.djangoproject.com/ticket/33765#comment:2>

Django

unread,
Jun 3, 2022, 2:08:28 PM6/3/22
to django-...@googlegroups.com
#33765: ManifestStaticFilesStorage doesn't support trailing whitespace for JS
source map references
-------------------------------------+-------------------------------------
Reporter: Adam Johnson | Owner: Adam
| Johnson
Type: Bug | Status: closed
Component: contrib.staticfiles | Version: 4.0
Severity: Normal | Resolution: invalid
Keywords: | Triage Stage:
| Unreviewed

Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* status: assigned => closed
* resolution: => invalid
* severity: Release blocker => Normal
* stage: Accepted => Unreviewed


Comment:

It works without any changes.

--
Ticket URL: <https://code.djangoproject.com/ticket/33765#comment:3>

Django

unread,
Jun 3, 2022, 3:14:26 PM6/3/22
to django-...@googlegroups.com
#33765: ManifestStaticFilesStorage doesn't support trailing whitespace for JS
source map references
-------------------------------------+-------------------------------------
Reporter: Adam Johnson | Owner: Adam
| Johnson
Type: Bug | Status: closed
Component: contrib.staticfiles | Version: 4.0
Severity: Normal | Resolution: invalid
Keywords: | Triage Stage:
| Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"00639dbd6d023aaba20efa5497988cd730923633" 00639db]:
{{{
#!CommitTicketReference repository=""
revision="00639dbd6d023aaba20efa5497988cd730923633"
Refs #33765 -- Added tests for trailing whitespace in JavaScript source
map references.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/33765#comment:4>

Reply all
Reply to author
Forward
0 new messages