mammoth-family-48524
12/08/2022, 10:40 PMmammoth-family-48524
12/08/2022, 10:53 PMmysterious-toddler-20573
12/09/2022, 12:32 AMgreen-activity-6102
12/09/2022, 1:22 AM?v=2
to the end of my paths, and just increment the number when i make changes to the static filerefined-waiter-90422
12/09/2022, 6:16 AMrefined-waiter-90422
12/09/2022, 6:30 AMnpm
becomes part of your projectmammoth-family-48524
12/09/2022, 6:44 AMmammoth-family-48524
12/09/2022, 6:45 AMmammoth-family-48524
12/09/2022, 6:47 AMgreen-activity-6102
12/09/2022, 4:39 PMrefined-waiter-90422
12/09/2022, 9:31 PMrefined-waiter-90422
12/09/2022, 9:32 PMwhite-motorcycle-95262
12/10/2022, 3:07 PMVary: HX-Request
headers is something that would fit in the scope of the django-htmx
package (specifically the Middleware)? @high-toothbrush-44006melodic-advantage-28381
12/14/2022, 8:51 AMmelodic-advantage-28381
12/14/2022, 9:19 AMmelodic-advantage-28381
12/14/2022, 9:24 AMboundless-vase-80440
12/14/2022, 11:24 AMhundreds-camera-24900
12/15/2022, 2:37 AMmelodic-advantage-28381
12/15/2022, 9:20 AMpackage.json
with only major version specified ("htmx.org": "1.*"
)
- The package-lock.json
is generated after npm install and is versioned in Git alongside with package.json
- Our web pages all load a main.js
file that is an ES6 file where we put import "htmx.org"
(among other things, like what we need to use SimulusJS) ; these main.js
files do not live in the standard static
Django folder but in a separate static_src
folder
- We use esbuild to transpile this ES6 and bundle everything needed into one main.js
file per page, which live in the standard static
folder (which makes them usable by collectstatic
, the {% static %}
templatetag, and Django cache-busting capabilities)
- Obviously node_modules
folder is Git-ignored, as well as every Django app static
folder (CSS also live in static_src
as they also are compiled/bundled using postcss)
With all this, we get :
- Properly managed JS dependencies, that can be parsed and updated by Github's Dependabot
- The ability to write modern JS for our apps (ES6 imports, not caring about JS files loading order, etc.)
@mysterious-toddler-20573 does that answer your question ?refined-waiter-90422
12/15/2022, 12:37 PMindex.html
file, by default, easy.
If a dev wants to use it with npm, they can (or any other dep/build system of the month next time the node community re-invents itself) .. and if some new dep/build system is used, they can use that too without second-guessing the docs or assuming its npm-only.boundless-vase-80440
12/15/2022, 12:46 PMvictorious-thailand-80225
12/15/2022, 2:27 PMmysterious-toddler-20573
12/15/2022, 3:42 PMhundreds-camera-24900
12/16/2022, 4:46 AMhundreds-camera-24900
12/16/2022, 4:47 AMhundreds-camera-24900
12/16/2022, 4:47 AMripe-ghost-5606
12/17/2022, 4:16 PMripe-ghost-5606
12/17/2022, 4:16 PMearly-camera-41285
12/17/2022, 7:05 PMripe-ghost-5606
12/17/2022, 7:06 PM