Skip to content
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

webc:type="module" for simpler ESM-friendly render functions #69

Open
zachleat opened this issue Nov 2, 2022 · 3 comments
Open

webc:type="module" for simpler ESM-friendly render functions #69

zachleat opened this issue Nov 2, 2022 · 3 comments
Labels
enhancement New feature or request on-hold

Comments

@zachleat
Copy link
Member

zachleat commented Nov 2, 2022

https://www.11ty.dev/docs/languages/webc/#webctyperender-(javascript-render-functions) are currently CJS but we should add another type for ESM!

@zachleat zachleat added the enhancement New feature or request label Nov 2, 2022
@zachleat
Copy link
Member Author

I’d like to feed two birds with one meal and simply call it webc:type="js" and forgo the function convention from webc:type="render" altogether.

Mentioned by @darthmall in #28. This would match how dynamic attributes work.

@zachleat zachleat changed the title webc:type="module" for ESM render functions webc:type="js" for simpler ESM-friendly render functions Nov 16, 2022
@zachleat
Copy link
Member Author

Welp, after a bare minimum of research it looks like Node is not quite ready for vm.Module (still experimental in Node 19) https://nodejs.org/api/vm.html#class-vmmodule

Gonna have to decouple these

@zachleat zachleat changed the title webc:type="js" for simpler ESM-friendly render functions webc:type="module" for simpler ESM-friendly render functions Nov 16, 2022
@zachleat
Copy link
Member Author

#73 is now the request from #69 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request on-hold
Projects
None yet
Development

No branches or pull requests

1 participant