-
Notifications
You must be signed in to change notification settings - Fork 233
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
feature/RHTL-68 – server-side-rendering #510
Conversation
This isn't ready but i've made the move over into 'native' and thought it'd be good to track along side #498 as that is also a huge change to the codebase. |
the Error: .eslintrc » ./node_modules/kcd-scripts/eslint.js » /Users/joshua/code/react-hooks-testing-library/node_modules/kcd-scripts/node_modules/eslint-config-kentcdodds/jest.js:
Environment key "jest/globals" is unknown My assumption this is related to #502 any ideas @marcosvega91? |
Hi @joshuaellis have you reinstalled all modules ? Are you using If you are using |
Hi @marcosvega91,
I was using |
You're right. I'm receiving the same error. I'll try to understand why with yarn is giving this problem. Thanks for raising it 😄 |
The problem with yarn is that is not resolving correctly |
Hi @mpeyper, I've just migrated the previous server work you did & the ReactDOMServer does not yet support Suspense.
31 | renderProps = props
32 | baseAct(() => {
> 33 | const serverOutput = ReactDOMServer.renderToString(toRender(props))
| ^
34 | container.innerHTML = serverOutput
35 | })
36 | },
I just wanted to know if you remember this happening to you or not? IMO i can't initially see why this test would fail as we're not using |
@joshuaellis Yes, this was an issue for me too. |
@joshuaellis the TS migration (#498, #520) is in a beta release now. I suggest we rebase these changes on the [ |
Great stuff @mpeyper thanks for letting me know. |
I've managed to navigate alot of the Typescript stuff so far, I'm really struggling how to solve the issue in const toRender = (props?: TProps): JSX.Element => (
<Wrapper {...props}>
<TestHook hookProps={props} {...testHookProps} />
</Wrapper>
) the issue i'm getting is
I was wondering if it had something to do with this on going issue – DefinitelyTyped/DefinitelyTyped#34237 if anyone has ideas, they're definitely welcome. |
DM, it actually had to do with this issue microsoft/TypeScript#28938 (comment) |
I updated the base branch to reduce the noise in the review and I think we'll want this to honour as a beta first anyway. I've had a brief look on my phone just now and I like where this is headed. I have a few comments to leave, but I'll wait until I'm on my laptop to do so. |
Stil to do this comment & define some tests for ‘src/pure’ |
I've fixed the types for the submodules now and I've removed the I worked around the type issue by generating the submodules instead of having static files for them. In some ways I like this solution more, but I'm still a bit upset I couldn't figure out the TS configuration to get it to work. As for tests of the root module, I'm still not sure how to do this as we have both dependencies installed so testing the error cases or even getting it to select the Other than that, I think it's just the docs that need some love on this one now. |
I think we should release this into a beta now that the previous beta has been released. What do you think @joshuaellis? |
Absolutely, let’s push to beta. I can begin work on the docs later today 💪🏼 |
🎉 This PR is included in version 5.0.0-beta.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
hmmmm... I was expecting that to publish as |
bad bot. That is weird, I would have expected that too. |
to trigger the release of the Your master branch has a commit Anyway |
Thanks @marcosvega91, I have rebuilt the |
I just tried the beta out in one of my own projects. All renderers are working great and the auto-detection is also working. The only issue so far is that when niether Error: Could not auto-detect a React renderer. Are you sure you've installed one of the following
- react-dom/n - react-test-renderer Whoops. I'll fix that quickly and get a new build out. |
What:
New feature SSR testing – breaking change.
Split the repo into
dom|native|server
Why:
#68
How:
RTR does not currently support SSR,
react-dom
does, this will be the default renderer for SSR testing. However, the plan is to expose acustom
renderer usage where users can use other renderers e.gpreact
. User's will have their test engine autoChecklist: