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

feat(gatsby): Enable develop SSR for everyone #29251

Closed
wants to merge 15 commits into from
Closed

Conversation

KyleAMathews
Copy link
Contributor

@KyleAMathews KyleAMathews commented Jan 28, 2021

20% rollout went smoothly & time to rock & roll.

PR includes some misc test fixes to fixes issues exposed by rollout.

@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Jan 28, 2021
@KyleAMathews KyleAMathews removed the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Jan 28, 2021
@ascorbic
Copy link
Contributor

ascorbic commented Jan 28, 2021

@KyleAMathews Can you check why the e2e tests are failing? It looks like real failures.

@KyleAMathews
Copy link
Contributor Author

Hmm strange — might be a configuration issue — we've had those tests running with ssr this whole time. Investigating.

@KyleAMathews
Copy link
Contributor Author

Looks like hydration issues 👀

Hrmmm — maybe we weren't running these

@KyleAMathews
Copy link
Contributor Author

Screen Shot 2021-01-28 at 10 35 01 AM

@@ -49,8 +49,13 @@ export const restartWorker = (htmlComponentRendererPath): void => {

const searchFileForString = (substring, filePath): Promise<boolean> =>
new Promise(resolve => {
const escapedSubString = substring.replace(/[.*+?^${}()|[\]\\]/g, `\\$&`)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this was causing failing tests on the development-runtime for paths like -[client-only] as they'd crash the server

@@ -10,13 +10,13 @@ export const route = ({ app, program, store }): any =>
app.get(`*`, async (req, res, next) => {
trackFeatureIsUsed(`GATSBY_EXPERIMENTAL_DEV_SSR`)

const pathObj = findPageByPath(store.getState(), req.path)
const pathObj = findPageByPath(store.getState(), decodeURI(req.path))
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

needed for unicode paths like /안녕

render() {
if (this.state.hasRendered) {
return (
<ConditionalFastRefreshOverlay>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The overlays are client-only so we don't render them initially to avoid React saying there's hydration problems

@@ -2,7 +2,7 @@ const COUNT_ID = `count`

describe(`hooks`, () => {
beforeEach(() => {
cy.visit(`/hooks`).waitForRouteChange()
cy.visit(`/hooks`, { failOnStatusCode: false }).waitForRouteChange()
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the dev server now returns 404s

@KyleAMathews
Copy link
Contributor Author

Close in favor of #29720

@LekoArts LekoArts deleted the dev-ssr-100 branch July 2, 2021 15:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants