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

Export renderer and Renderer based on environment from @b9g/crank/standalone #256

Open
brainkim opened this issue Mar 25, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@brainkim
Copy link
Member

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.

@brainkim brainkim added the enhancement New feature or request label Mar 25, 2023
@brainkim brainkim added the help wanted Extra attention is needed label May 22, 2023
@brainkim brainkim removed the help wanted Extra attention is needed label Jan 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant