It’s annoying to import the new jsx template tag from standalone, and also have to import a renderer for the respective environment. I’m wondering if we can use some sort of environment detection mechanism to have the correct one imported.
Before:
import {jsx} from "@b9g/crank/standalone";
import {renderer} from "@b9g/crank/dom";
renderer.render(jsx`<div id="hello">Hello world</div>`, document.body);
After:
import {jsx, renderer} from "@b9g/crank/standalone";
renderer.render(jsx`<div id="hello">Hello world</div>`, document.body);
How do we determine environment? I don’t like using non-standard package.json exports, and exports conditions are really confusing. I honestly just want to do top-level await imports.
It’s annoying to import the new jsx template tag from
standalone
, and also have to import a renderer for the respective environment. I’m wondering if we can use some sort of environment detection mechanism to have the correct one imported.Before:
After:
How do we determine environment? I don’t like using non-standard package.json exports, and exports conditions are really confusing. I honestly just want to do top-level await imports.