-
Notifications
You must be signed in to change notification settings - Fork 773
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
feat: expose Fragment
on h
#2846
base: main
Are you sure you want to change the base?
Conversation
This way it's possible to set `jsxFragmentFactory` to `h.Fragment` in tsconfig, so that `<></>` syntax can be used without having to import `Fragment` explicitly (just importing `h` is sufficient).
The broken test is from eec7651 (see https://github.com/ionic-team/stencil/runs/1796291494). All other tests pass locally. |
This is kind of cool!, i like it. My only concern is so performance regression because adding a property to an arrow function is disables some V8 optimization. Wondering how we could check that |
Interesting, I didn't know that. Is this different when using a normal BTW In the meantime what I did was to patch import { h, Fragment } from '@stencil/core;
export default () => {
if (!('Fragment' in h)) {
h.Fragment = Fragment;
}
} (breaks spec tests with |
Hm, idea: const h = () => { /* ... */ }
export default h
export const Fragment = (_, children) => children import h from './h'
export { h } |
Never mind, mixing default and named exports doesn't seem to work with Rollup (see repl). |
This way it's possible to set
jsxFragmentFactory
toh.Fragment
in tsconfig, so that<></>
syntax can be used without having to importFragment
explicitly (just importingh
is sufficient).