-
-
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 #12641
Draft
bep
wants to merge
10
commits into
gohugoio:master
Choose a base branch
from
bep:feat/jsbatch-12626
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Add js.Batch #12641
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Open
bep
force-pushed
the
feat/jsbatch-12626
branch
3 times, most recently
from
July 6, 2024 10:20
8b9f6b9
to
cc76968
Compare
Fernando2018s
approved these changes
Jul 7, 2024
bep
force-pushed
the
feat/jsbatch-12626
branch
from
September 12, 2024 09:19
cc76968
to
61fba92
Compare
bep
force-pushed
the
feat/jsbatch-12626
branch
4 times, most recently
from
September 20, 2024 08:56
6d81258
to
2b2dbc2
Compare
This was referenced Sep 20, 2024
bep
force-pushed
the
feat/jsbatch-12626
branch
5 times, most recently
from
September 24, 2024 06:03
d6f703d
to
f3e1915
Compare
bep
force-pushed
the
feat/jsbatch-12626
branch
4 times, most recently
from
October 5, 2024 08:55
752208d
to
a133d27
Compare
bep
force-pushed
the
feat/jsbatch-12626
branch
7 times, most recently
from
October 13, 2024 08:36
dedc04d
to
c91b32b
Compare
bep
force-pushed
the
feat/jsbatch-12626
branch
11 times, most recently
from
October 19, 2024 13:22
1a8c645
to
68f08ce
Compare
bep
force-pushed
the
feat/jsbatch-12626
branch
from
October 21, 2024 09:06
68f08ce
to
3518aec
Compare
bep
force-pushed
the
feat/jsbatch-12626
branch
from
October 21, 2024 10:20
3518aec
to
871bad8
Compare
bep
force-pushed
the
feat/jsbatch-12626
branch
from
October 21, 2024 16:58
3c397bb
to
92b0a38
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
OK, have pondered and going back and forth to find a builder API that would work in a distributed and concurrent setup that was also reasonably simple to understand/document. On a flight this morning, I think I got it.
There's some details omitted in the below, but an outline of the important parts would be:
Some notes:
with $batch.Group "main"
will be a JS file with common code/dependencies with other groups split out into chunks.Limitations
with $batch.Group
in the example above, all otherwith
clauses will returnnil
This the first invocation for a givenid
.Runner
construct is a little hard to explain without further examples, but the provided runner function will receive an object will all the script bindings in the group (exports). The use case I have in mind is JSX/TSX components (see example below), but I suspect there are other use cases.A batch will be built once, typically included in
<head>
:Fixes #12626