[Django] #34235: ManifestStaticFilesStorage should expose a "hash" of the manifest file.

29 views
Skip to first unread message

Django

unread,
Dec 29, 2022, 11:15:39 AM12/29/22
to django-...@googlegroups.com
#34235: ManifestStaticFilesStorage should expose a "hash" of the manifest file.
-------------------------------------+-------------------------------------
Reporter: Florian | Owner: nobody
Apolloner |
Type: New | Status: new
feature |
Component: | Version: dev
contrib.staticfiles | Keywords: htmx unpoly hash
Severity: Normal | asset
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
It would be great if `ManifestFilesMixin` could expose a `manifest_hash`
that changes whenever *anything* in the manifest itself changes. This
would allow SPAs (or applications enhanced with htmx/unpoly etc) to send
along a header in responses ala `X-Asset-Hash` and allow them to perform a
full reload if the header changes.

I'll be opening a PR for discussion soon.

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

Django

unread,
Dec 29, 2022, 11:28:11 AM12/29/22
to django-...@googlegroups.com
#34235: ManifestStaticFilesStorage should expose a "hash" of the manifest file.
-------------------------------------+-------------------------------------
Reporter: Florian Apolloner | Owner: nobody
Type: New feature | Status: new
Component: contrib.staticfiles | Version: dev
Severity: Normal | Resolution:
Keywords: htmx unpoly hash | Triage Stage:
asset | Unreviewed
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Florian Apolloner):

* has_patch: 0 => 1


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

Django

unread,
Dec 30, 2022, 12:21:17 AM12/30/22
to django-...@googlegroups.com
#34235: ManifestStaticFilesStorage should expose a "hash" of the manifest file.
-------------------------------------+-------------------------------------
Reporter: Florian Apolloner | Owner: Florian
| Apolloner
Type: New feature | Status: assigned

Component: contrib.staticfiles | Version: dev
Severity: Normal | Resolution:
Keywords: htmx unpoly hash | Triage Stage: Accepted
asset |

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 => Florian Apolloner
* status: new => assigned
* stage: Unreviewed => Accepted


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

Django

unread,
Jan 2, 2023, 3:55:55 AM1/2/23
to django-...@googlegroups.com
#34235: ManifestStaticFilesStorage should expose a "hash" of the manifest file.
-------------------------------------+-------------------------------------
Reporter: Florian Apolloner | Owner: Florian
| Apolloner
Type: New feature | Status: assigned
Component: contrib.staticfiles | Version: dev
Severity: Normal | Resolution:
Keywords: htmx unpoly hash | Triage Stage: Ready for
asset | checkin

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

* stage: Accepted => Ready for checkin


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

Django

unread,
Jan 2, 2023, 6:56:04 AM1/2/23
to django-...@googlegroups.com
#34235: ManifestStaticFilesStorage should expose a "hash" of the manifest file.
-------------------------------------+-------------------------------------
Reporter: Florian Apolloner | Owner: Florian
| Apolloner
Type: New feature | Status: closed
Component: contrib.staticfiles | Version: dev
Severity: Normal | Resolution: fixed

Keywords: htmx unpoly hash | Triage Stage: Ready for
asset | checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak <felisiak.mariusz@…>):

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


Comment:

In [changeset:"afa2e28205fe708334ad463b6d3b0e9960b945a6" afa2e28]:
{{{
#!CommitTicketReference repository=""
revision="afa2e28205fe708334ad463b6d3b0e9960b945a6"
Fixed #34235 -- Added ManifestFilesMixin.manifest_hash attribute.

This adds ManifestFilesMixin.manifest_hash attribute exposing a "hash"
of the full manifest. This allows applications to determine when their
static files have changed.
}}}

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

Django

unread,
Jan 21, 2023, 5:56:12 AM1/21/23
to django-...@googlegroups.com
#34235: ManifestStaticFilesStorage should expose a "hash" of the manifest file.
-------------------------------------+-------------------------------------
Reporter: Florian Apolloner | Owner: Florian
| Apolloner
Type: New feature | Status: closed
Component: contrib.staticfiles | Version: dev
Severity: Normal | Resolution: fixed
Keywords: htmx unpoly hash | Triage Stage: Ready for
asset | checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Adam Johnson):

Nice feature, thanks all!

--
Ticket URL: <https://code.djangoproject.com/ticket/34235#comment:5>

Reply all
Reply to author
Forward
0 new messages