Skip to content

Commit

Permalink
Export
Browse files Browse the repository at this point in the history
  • Loading branch information
bep committed Oct 19, 2024
1 parent 33c8ad2 commit 7545e08
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
3 changes: 1 addition & 2 deletions tpl/js/batch-esm-callback.gotmpl
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{{ range $i, $e := .Modules -}}
import { {{ printf "% as Mod%d" .CallbackExport $i }} } from
"{{ .ImportPath }}";
{{ printf "import { %s as Mod%d } from %q;" .CallbackExport $i .ImportPath }}
{{ end -}}
{{ range $i, $e := .Callbacks }}
{{ $id := printf "Callback%d" $i }}
Expand Down
7 changes: 4 additions & 3 deletions tpl/js/batch.go
Original file line number Diff line number Diff line change
Expand Up @@ -804,9 +804,10 @@ func (b *batcher) doBuild() (*Package, error) {
})

bt := batchTemplateExecutionsContext{
ID: vv.ID,
r: vv.Resource,
ImportPath: impPath,
ID: vv.ID,
r: vv.Resource,
CallbackExport: vv.CallbackExport,
ImportPath: impPath,
}
state.importResource.Set(bt.ImportPath, vv.Resource)
for _, vvv := range instances.ByScriptID(vv.ID) {
Expand Down
2 changes: 1 addition & 1 deletion tpl/js/batch_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ Home.
{{ with .Script "r2" }}
{{ .SetOptions (dict
"resource" (resources.Get "js/react2.jsx")
"exporrt" "MyOtherButton"
"callbackExport" "MyOtherButton"
"importContext" $otherCSS
"params" (dict "id" "r2")
)
Expand Down

0 comments on commit 7545e08

Please sign in to comment.