Aliasing documentation for importmaps misses test-util and jsx-runtime
schlichtanders opened this issue · 3 comments
On https://preactjs.com/guide/v10/getting-started#using-preact-with-htm-and-importmaps an importmap aliasing is defined as
<script type="importmap">
{
"imports": {
"react": "https://esm.sh/preact@10.19.2/compat",
"react-dom": "https://esm.sh/preact@10.19.2/compat"
}
}
</script>
This apparently leaves out two further aliases which are needed for package.json
(parcel example in the same docs)
{
"alias": {
"react": "preact/compat",
"react-dom/test-utils": "preact/test-utils",
"react-dom": "preact/compat",
"react/jsx-runtime": "preact/jsx-runtime"
},
}
Are these two further aliases just not needed?
If they are needed, how can they be supported in importmaps?
The assumption is that most folks don't run tests in their browser. Since writing the compiled JSX output by hand most folks don't use the jsx-runtime either, and rather use htm
instead.
Exactly, those extra two aliases address tools that are quite unlikely to be used, hence why they're not included in the simple demo.
You can add them in if you want, they follow the same pattern, nothing unique.
Thank you for your support