-
-
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
Further ideas on how WASI/Wasm modules could be used in Hugo #12737
Comments
While very useful on its own (and combined with the passthrough render hooks), this is also serves as a proof of concept of using WASI ( WebAssembly System Interface) modules in Hugo. This will be marked _experimental_ in the documentation. Not because it will be removed or change in a dramatic way, but we need to think a little more how to best set up/configure similar services, define where these WASM files gets stored, maybe we can allow user provided WASM files plugins via Hugo Modules mounts etc. See these issues for more context: * gohugoio#12736 * gohugoio#12737 See gohugoio#11927
While very useful on its own (and combined with the passthrough render hooks), this also serves as a proof of concept of using WASI (WebAssembly System Interface) modules in Hugo. This will be marked _experimental_ in the documentation. Not because it will be removed or changed in a dramatic way, but we need to think a little more how to best set up/configure similar services, define where these WASM files gets stored, maybe we can allow user provided WASM files plugins via Hugo Modules mounts etc. See these issues for more context: * gohugoio#12736 * gohugoio#12737 See gohugoio#11927
While very useful on its own (and combined with the passthrough render hooks), this also serves as a proof of concept of using WASI (WebAssembly System Interface) modules in Hugo. This will be marked _experimental_ in the documentation. Not because it will be removed or changed in a dramatic way, but we need to think a little more how to best set up/configure similar services, define where these WASM files gets stored, maybe we can allow user provided WASM files plugins via Hugo Modules mounts etc. See these issues for more context: * gohugoio#12736 * gohugoio#12737 See gohugoio#11927
While very useful on its own (and combined with the passthrough render hooks), this also serves as a proof of concept of using WASI (WebAssembly System Interface) modules in Hugo. This will be marked _experimental_ in the documentation. Not because it will be removed or changed in a dramatic way, but we need to think a little more how to best set up/configure similar services, define where these WASM files gets stored, maybe we can allow user provided WASM files plugins via Hugo Modules mounts etc. See these issues for more context: * gohugoio#12736 * gohugoio#12737 See gohugoio#11927
While very useful on its own (and combined with the passthrough render hooks), this also serves as a proof of concept of using WASI (WebAssembly System Interface) modules in Hugo. This will be marked _experimental_ in the documentation. Not because it will be removed or changed in a dramatic way, but we need to think a little more how to best set up/configure similar services, define where these WASM files gets stored, maybe we can allow user provided WASM files plugins via Hugo Modules mounts etc. See these issues for more context: * gohugoio#12736 * gohugoio#12737 See gohugoio#11927
While very useful on its own (and combined with the passthrough render hooks), this also serves as a proof of concept of using WASI (WebAssembly System Interface) modules in Hugo. This will be marked _experimental_ in the documentation. Not because it will be removed or changed in a dramatic way, but we need to think a little more how to best set up/configure similar services, define where these WASM files gets stored, maybe we can allow user provided WASM files plugins via Hugo Modules mounts etc. See these issues for more context: * gohugoio#12736 * gohugoio#12737 See gohugoio#11927
While very useful on its own (and combined with the passthrough render hooks), this also serves as a proof of concept of using WASI (WebAssembly System Interface) modules in Hugo. This will be marked _experimental_ in the documentation. Not because it will be removed or changed in a dramatic way, but we need to think a little more how to best set up/configure similar services, define where these WASM files gets stored, maybe we can allow user provided WASM files plugins via Hugo Modules mounts etc. See these issues for more context: * gohugoio#12736 * gohugoio#12737 See gohugoio#11927
While very useful on its own (and combined with the passthrough render hooks), this also serves as a proof of concept of using WASI (WebAssembly System Interface) modules in Hugo. This will be marked _experimental_ in the documentation. Not because it will be removed or changed in a dramatic way, but we need to think a little more how to best set up/configure similar services, define where these WASM files gets stored, maybe we can allow user provided WASM files plugins via Hugo Modules mounts etc. See these issues for more context: * gohugoio#12736 * gohugoio#12737 See gohugoio#11927
While very useful on its own (and combined with the passthrough render hooks), this also serves as a proof of concept of using WASI (WebAssembly System Interface) modules in Hugo. This will be marked _experimental_ in the documentation. Not because it will be removed or changed in a dramatic way, but we need to think a little more how to best set up/configure similar services, define where these WASM files gets stored, maybe we can allow user provided WASM files plugins via Hugo Modules mounts etc. See these issues for more context: * #12736 * #12737 See #11927
I'm very happy that Wasm/WASI support has landed in Hugo. Nice work! I've been using Hugo to build my website for a while and I've noticed that the syntax highlighting provided by Chroma hasn't been as nice as what other highlighters like Syntect or Shiki can produce. I wonder if there could be a way to have another syntax highlighter that uses Syntect/Shiki via Wasm? One thing to note is that Syntect especially has a long warmup time when loading stylesheets (around 100-200ms last time I tried) but is very fast once initialized. It would be good to have a way for programs to serve more than one request. As for extending the Wasm support in Hugo, I think the natural choice would be to have some kind of a plugin/extension system. I think Zed has the most advanced WASM plugin system of all, since it uses the WIT format to define an interface for extensions and exposes the API as a Rust crate. |
I was thinking of something similar to use wasm as a "plugin" or "function" that can be hooked into the templating system. A starting point could be supporting using a custom Often the times I found it tedious to implement things such as splitting a page into different chunks or parsing a Jupyter file which could be more straightforward in a higher-level languages like JavaScript or Go. potential design for the primitive:
transformWasm []byte := content.ReadFile(path)
type TransformInput struct {
Input string `json:"input"`
Options interface{} `json:"options"`
} As a module author or end user, I could just define things in JavaScript, similar to the greet.js const transform = function (input, options) {
// custom data transformation, e.g.
return input.toUpperCase()
}; This script could be compiled to
This could potentially address requests for "custom functions" |
@imfing thanks for the input. In my head, any use of wasm in Hugo needs to be relatively coarse grained -- there is a relatively big start up (and memory) cost so you need to think of each wasm file as "a server". So Thinking out loud here of some examples that I would find useful:
If we then allow people to include their wasm files/configurations as part of Hugo's module mount setup. |
Placeholder.
The text was updated successfully, but these errors were encountered: