-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Server compat should have a default export #4047
Server compat should have a default export #4047
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a bit confused by the changes proposed in this PR. From what I can tell they are mostly stylistic changes and don't change the way a the code is exported at all.
Ok, as you can see with your client.js https://github.com/preactjs/preact/blob/master/compat/client.mjs, you need a default export to be imported with Do you prefer I add some tests to make it sure both imports work as expected ? |
ANother example, i'm working with draft-convert and there is this kind of error too: In order to fix this, I need a default export |
348d5f2
to
65f73f8
Compare
Is that okay for you ? |
compat/server.browser.js
Outdated
@@ -1,4 +1,11 @@ | |||
import { renderToString as preactRenderToString } from 'preact-render-to-string'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: No need for the as
, just keep it as renderToString
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
compat/server.mjs
Outdated
@@ -1,4 +1,11 @@ | |||
import { renderToString as preactRenderToString } from 'preact-render-to-string'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
65f73f8
to
90d618c
Compare
Hi preact,
For now the use of preact/compat do not allow to use
import ReactDOM from 'react-dom/server'
, as it will fail with an error:This PR is here to allow it, without breaking the classical use
import {renderToStaticMarkup} from 'react-dom/server'