ampproject / ampproject/worker-dom
script elements
Open
hydration
mutation
- Dominant language
- TypeScript
- Stars
- 3.3k
- Forks
- 154
- PR merge metrics
- No merged PRs in 30d
Description
We need to design/decide what adding a script elements via worker-dom does. This may also need to be configurable.
Currently it would just do it and execute the script on the main thread. Which would be right for some use cases. But for other cases, such as when using code splitting, one might want to run the script inside the worker.
In that case, we may "neuter" the script element and instead use `importScript` to load the script. I believe that `importScript` is sync, so we may need to instead `fetch` the script and then call `importScript` with a blob (is that supported?)
Contributor guide
Assessment
This issue has not been assessed yet.