-
-
Notifications
You must be signed in to change notification settings - Fork 7.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add js.Batch #12626
Comments
Naming it |
@cmahnke do you have better name? |
Not really, my point is that My suggestion would be not to use too common nomenclature from the context (as this may imply functionality) or if that can't be avoided, at least not to use a verb. |
@cmahnke The scope of this issue is clearly defined; this is something that I want to do. Scoping it to something that I 1. Want to do and 2. Something that has a limited/possible scope means that it might get done. Pulling in every other remotely related thing isn't moving this particular issue forward, even if I can sympathise with your motivation. |
As to naming:
Both should support the same setting/CSS handling/plugins. I think that should be possible to document and clear enough. As to plugins; I created a feedback thread relevant to this after v0.132.0 (added support for QuickJS via Wasi/WASM). where I have gotten close to zero relevant feedback, so I'm guessing that's not a priority among the common Hugo user. |
@bep You misspelled the second term?
Personally, I would have expected that I would be keen to learn more about this new building mechanism soon and hope your experiments fare well. I'd love to be able to easily bundle Alpine.js data objects individually. |
@doompadee well, whatever we call it, the APIs are wastly different, so trying to force them into one function would create lots of extra work, and also I suspect would be mucho confusing for the end user. All of the esbuild related options should, of course, be shared/the same. {{ $bundle := (js.Bundle "mybundle" .Store) }} Looking at that extract of the integration test now, we could possibly also call it So: {{ $jsBuilder := (js.Builder "mybundle" site.Store) }}
// ... add stuff in this (home.html) and in single.html etc. templates.
// Then build and include the script(s).
{{ with (templates.Defer (dict "data" (dict "js" $jsBuilder)) }}
{{ with .Build.Scripts }}
{{ with index . "alpinejs1" }}
<script src="{{ .RelPermalink }}">
{{ end }}
{{ end }}
{{ end }} |
That's why I was thinking at some point in the (distant) future, the older
Having thought about the naming, why not use the name of the underlying tool? We already have |
Well, as we spent the entire "2024 Hugo developer budget" already, the distant future may very well be when this particular issue gets resolved. |
Fixes gohugoio#12626 Closes gohugoio#7499 Closes gohugoio#12874
Fixes gohugoio#12626 Closes gohugoio#7499 Closes gohugoio#12874
Fixes gohugoio#12626 Closes gohugoio#7499 Closes gohugoio#12874
Fixes gohugoio#12626 Closes gohugoio#7499 Closes gohugoio#12874
Fixes gohugoio#12626 Closes gohugoio#7499 Closes gohugoio#12874
Fixes gohugoio#12626 Closes gohugoio#7499 Closes gohugoio#12874
Fixes gohugoio#12626 Closes gohugoio#7499 Closes gohugoio#12874
Fixes gohugoio#12626 Closes gohugoio#7499 Closes gohugoio#12874
Fixes gohugoio#12626 Closes gohugoio#7499 Closes gohugoio#12874
Fixes gohugoio#12626 Closes gohugoio#7499 Closes gohugoio#12874
Fixes gohugoio#12626 Closes gohugoio#7499 Closes gohugoio#12874
Fixes gohugoio#12626 Closes gohugoio#7499 Closes gohugoio#12874
Fixes gohugoio#12626 Closes gohugoio#7499 Closes gohugoio#12874
Fixes gohugoio#12626 Closes gohugoio#7499 Closes gohugoio#12874
Naming is hard, but the entry point to this new feature is
js.Bundle
. We already havejs.Build
, which also allow bundling ... Yea, we should look for a different name.There are some aspects to this new feature:
home.js
,mysection.js
).Like with
js.Build
and others, these bundles are built in parallel during render, but for this we need some improved synchronisation mechanisms.In the examples below, all the methods prefixed
Use*
acquire a lock and needs to be closed when done. This would probably be too hard to teach the common Hugo user, so I have made it so if you use as the argument towith
, it will automatically be closed whenwith
closes.The text was updated successfully, but these errors were encountered: