[Django] #34100: Support js import statement with ManifestStaticFilesStorage

11 views
Skip to first unread message

Django

unread,
Oct 15, 2022, 12:35:26 PM10/15/22
to django-...@googlegroups.com
#34100: Support js import statement with ManifestStaticFilesStorage
-----------------------------------------------+------------------------
Reporter: blighj | Owner: nobody
Type: New feature | Status: new
Component: contrib.staticfiles | Version: 4.1
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 |
-----------------------------------------------+------------------------
Browsers now have good support for the import statement of javascript
https://developer.mozilla.org/en-
US/docs/Web/JavaScript/Reference/Statements/import#syntax
Which is in the form
{{{
import defaultExport from "module-name.js";
import "../module-name2.js";
}}}
Something like the below added to the js patterns of HashedFilesMixin
should cover both use cases
{{{
(
r"""(?P<matched>import(?P<from>[\s\{].*?from)\s*?['"](?P<url>[\w\.\/-]*?)["']\s*?;)""",
"""import%(from)s"%(url)s";""",
),
(
r"""(?P<matched>import\s*?['"](?P<url>[\w\.\/-]*?)["']\s*?;)""",
"""import"%(url)s";""",
),
}}}

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

Django

unread,
Oct 15, 2022, 12:36:18 PM10/15/22
to django-...@googlegroups.com
#34100: Support js import statement with ManifestStaticFilesStorage
-------------------------------------+-------------------------------------

Reporter: blighj | Owner: nobody
Type: New feature | Status: new
Component: contrib.staticfiles | Version: dev
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
-------------------------------------+-------------------------------------
Changes (by blighj):

* version: 4.1 => dev


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

Django

unread,
Oct 15, 2022, 2:01:57 PM10/15/22
to django-...@googlegroups.com
#34100: Support js import statement with ManifestStaticFilesStorage
-------------------------------------+-------------------------------------
Reporter: blighj | Owner: nobody
Type: New feature | Status: new
Component: contrib.staticfiles | Version: dev
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
-------------------------------------+-------------------------------------

Comment (by Keryn Knight):

Possibly this is a duplicate of #32319, which had an implementation, but
had to be reverted due to #33253.

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

Django

unread,
Oct 15, 2022, 3:27:07 PM10/15/22
to django-...@googlegroups.com
#34100: Support js import statement with ManifestStaticFilesStorage
-------------------------------------+-------------------------------------
Reporter: blighj | Owner: nobody
Type: New feature | Status: closed
Component: contrib.staticfiles | Version: dev
Severity: Normal | Resolution: duplicate

Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by blighj):

* status: new => closed
* resolution: => duplicate


Comment:

Yes it's a duplicate, closing this ticket.

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

Django

unread,
Dec 30, 2022, 7:30:21 AM12/30/22
to django-...@googlegroups.com
#34100: Support js import statement with ManifestStaticFilesStorage
-------------------------------------+-------------------------------------
Reporter: blighj | Owner: nobody
Type: New feature | Status: closed
Component: contrib.staticfiles | Version: dev
Severity: Normal | Resolution: duplicate
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

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

In [changeset:"c179ad9fe7e82dcb80261aa016f2fe18c8fcc181" c179ad9f]:
{{{
#!CommitTicketReference repository=""
revision="c179ad9fe7e82dcb80261aa016f2fe18c8fcc181"
Refs #34100 -- Made file upload tests use Storage.exists() where
appropriate.
}}}

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

Reply all
Reply to author
Forward
0 new messages