From 607a5283a2c9948454998c6bd9bbea6bcfb72610 Mon Sep 17 00:00:00 2001 From: Thibaud Colas Date: Tue, 19 Dec 2023 10:45:24 +0000 Subject: [PATCH 1/2] Copy template to new draft DEP doc --- draft/0000-rejuvenate-form-media.rst | 104 +++++++++++++++++++++++++++ 1 file changed, 104 insertions(+) create mode 100644 draft/0000-rejuvenate-form-media.rst diff --git a/draft/0000-rejuvenate-form-media.rst b/draft/0000-rejuvenate-form-media.rst new file mode 100644 index 00000000..8e857349 --- /dev/null +++ b/draft/0000-rejuvenate-form-media.rst @@ -0,0 +1,104 @@ +====================== +DEP XXXX: DEP template +====================== + +:DEP: XXXX +:Author: Jacob Kaplan-Moss +:Implementation Team: Jacob Kaplan-Moss +:Shepherd: Andrew Godwin, Carl Meyer +:Status: Draft +:Type: Feature +:Created: 2014-11-16 +:Last-Modified: 2014-11-18 + +.. contents:: Table of Contents + :depth: 3 + :local: + +This DEP provides a sample template for creating your own DEPs. In conjunction +with the content guidelines in `DEP 1 `_, +this should make it easy for you to conform your own DEPs to the format +outlined below. + +Note: if you are reading this DEP via the web, you should first grab `the source +of this DEP `_ in +order to complete the steps below. **DO NOT USE THE HTML FILE AS YOUR +TEMPLATE!** + +To get the source this (or any) DEP, look at the top of the Github page +and click "raw". + +If you're unfamiliar with reStructuredText (the format required of DEPs), +see these resources: + +* `A ReStructuredText Primer`__, a gentle introduction. +* `Quick reStructuredText`__, a users' quick reference. +* `reStructuredText Markup Specification`__, the final authority. + +__ http://docutils.sourceforge.net/docs/rst/quickstart.html +__ http://docutils.sourceforge.net/docs/rst/quickref.html +__ http://docutils.sourceforge.net/spec/rst/reStructuredText.html + +Once you've made a copy of this template, remove this abstract, fill out the +metadata above and the sections below, then submit the DEP. Follow the +guidelines in `DEP 1 `_. + +Abstract +======== + +This should be a short (~200 word) description of the technical issue being +addressed. + +This (and the above metadata) is the only section strictly required to submit a +draft DEP; the following sections can be barebones and fleshed out as you work +through the DEP process. + +Specification +============= + +This section should contain a complete, detailed technical specification should +describe the syntax and semantics of any new feature. The specification should +be detailed enough to allow implementation -- that is, developers other than the +author should (given the right experience) be able to independently implement +the feature, given only the DEP. + +Motivation +========== + +This section should explain *why* this DEP is needed. The motivation is critical +for DEPs that want to add substantial new features or materially refactor +existing ones. It should clearly explain why the existing solutions are +inadequate to address the problem that the DEP solves. DEP submissions without +sufficient motivation may be rejected outright. + +Rationale +========= + +This section should flesh out out the specification by describing what motivated +the specific design and why particular design decisions were made. It +should describe alternate designs that were considered and related work. + +The rationale should provide evidence of consensus within the community and +discuss important objections or concerns raised during discussion. + +Backwards Compatibility +======================= + +If this DEP introduces backwards incompatibilities, you must must include this +section. It should describe these incompatibilities and their severity, and what +mitigation you plan to take to deal with these incompatibilities. + +Reference Implementation +======================== + +If there's an implementation of the feature under discussion in this DEP, +this section should include or link to that implementation and provide any +notes about installing/using/trying out the implementation. + +Copyright +========= + +This document has been placed in the public domain per the Creative Commons +CC0 1.0 Universal license (http://creativecommons.org/publicdomain/zero/1.0/deed). + +(All DEPs must include this exact copyright statement.) From d22fff9194dd5d00a062aa05f1b0927626b485b9 Mon Sep 17 00:00:00 2001 From: Thibaud Colas Date: Tue, 19 Dec 2023 10:58:32 +0000 Subject: [PATCH 2/2] Add first draft content --- draft/0000-rejuvenate-form-media.rst | 107 ++++++++++++--------------- 1 file changed, 49 insertions(+), 58 deletions(-) diff --git a/draft/0000-rejuvenate-form-media.rst b/draft/0000-rejuvenate-form-media.rst index 8e857349..87a7667b 100644 --- a/draft/0000-rejuvenate-form-media.rst +++ b/draft/0000-rejuvenate-form-media.rst @@ -1,75 +1,52 @@ ====================== -DEP XXXX: DEP template +DEP XXXX: Rejuvenate form media ====================== :DEP: XXXX -:Author: Jacob Kaplan-Moss -:Implementation Team: Jacob Kaplan-Moss -:Shepherd: Andrew Godwin, Carl Meyer +:Author: Thibaud Colas +:Implementation Team: You? People in the `forum thread: Rejuvenating vs deprecating Form.Media `_ +:Shepherd: You? :Status: Draft :Type: Feature -:Created: 2014-11-16 -:Last-Modified: 2014-11-18 +:Created: 2023-12-12 +:Last-Modified: 2023-12-19 .. contents:: Table of Contents :depth: 3 :local: -This DEP provides a sample template for creating your own DEPs. In conjunction -with the content guidelines in `DEP 1 `_, -this should make it easy for you to conform your own DEPs to the format -outlined below. - -Note: if you are reading this DEP via the web, you should first grab `the source -of this DEP `_ in -order to complete the steps below. **DO NOT USE THE HTML FILE AS YOUR -TEMPLATE!** - -To get the source this (or any) DEP, look at the top of the Github page -and click "raw". - -If you're unfamiliar with reStructuredText (the format required of DEPs), -see these resources: - -* `A ReStructuredText Primer`__, a gentle introduction. -* `Quick reStructuredText`__, a users' quick reference. -* `reStructuredText Markup Specification`__, the final authority. - -__ http://docutils.sourceforge.net/docs/rst/quickstart.html -__ http://docutils.sourceforge.net/docs/rst/quickref.html -__ http://docutils.sourceforge.net/spec/rst/reStructuredText.html - -Once you've made a copy of this template, remove this abstract, fill out the -metadata above and the sections below, then submit the DEP. Follow the -guidelines in `DEP 1 `_. - Abstract ======== -This should be a short (~200 word) description of the technical issue being -addressed. - -This (and the above metadata) is the only section strictly required to submit a -draft DEP; the following sections can be barebones and fleshed out as you work -through the DEP process. +See `forum thread: Rejuvenating vs deprecating Form.Media `_. +We want `form.Media `_ to catch up with modern web standards, so Django projects can more easily leverage those standards. Specification ============= -This section should contain a complete, detailed technical specification should -describe the syntax and semantics of any new feature. The specification should -be detailed enough to allow implementation -- that is, developers other than the -author should (given the right experience) be able to independently implement -the feature, given only the DEP. +See the `MDN script element documentation `_ and `link element documentation `_. + +Here are requirements which Django could/should better support: + +- ES modules +- Import maps +- Dynamic module imports +- async, defer scripts +- CSPs via nonce attributes +- integrity attribute +- fetchpriority attribute +- nomodule attribute +- Arbitrary script attributes +- Preloading / speculative loading +- Resource ordering (see `capo.js `_) +- Web Components + Motivation ========== -This section should explain *why* this DEP is needed. The motivation is critical -for DEPs that want to add substantial new features or materially refactor -existing ones. It should clearly explain why the existing solutions are -inadequate to address the problem that the DEP solves. DEP submissions without -sufficient motivation may be rejected outright. +`form.Media `_ is a good API to manage a form widget’s dependencies. +Though not all projects need to keep a strict record of each widget’s dependencies Rationale ========= @@ -84,21 +61,35 @@ discuss important objections or concerns raised during discussion. Backwards Compatibility ======================= -If this DEP introduces backwards incompatibilities, you must must include this -section. It should describe these incompatibilities and their severity, and what -mitigation you plan to take to deal with these incompatibilities. +At this stage I wouldn’t expect this to introduce any backwards-incompatible changes. If we did so, it would be with a very gradual deprecation path, likely only in the interest of: + +- Better performance (for example default to more modern script loading techniques) +- Better security (for example default to… more modern script loading techniques) Reference Implementation ======================== -If there's an implementation of the feature under discussion in this DEP, -this section should include or link to that implementation and provide any -notes about installing/using/trying out the implementation. +Here are the most fully-fledged implementations so far: + +- https://github.com/matthiask/django-js-asset/ +- https://github.com/rails/importmap-rails + +Other references: + +- https://github.com/dropseed/django-importmap +- https://github.com/tonysm/importmap-laravel + +TODOs +===== + +- Add more possible requirements +- Review https://github.com/wsvincent/awesome-django for packages with form media-related functionality. +- Review https://djangopackages.org/ for packages with form media-related functionality. +- Update https://github.com/st3v3nmw/awesome-django-performance with existing performance-related Django packages relating to form assets. +- Also update https://github.com/wsvincent/awesome-django with good packages in this category Copyright ========= This document has been placed in the public domain per the Creative Commons CC0 1.0 Universal license (http://creativecommons.org/publicdomain/zero/1.0/deed). - -(All DEPs must include this exact copyright statement.)