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(SSR) - enable SSR with redux - WIP #84

Draft
wants to merge 6 commits into
base: develop
Choose a base branch
from

Conversation

GuillaumeJasmin
Copy link
Collaborator

No description provided.

@emile-bex emile-bex force-pushed the feature/redux-ssr branch from fbdc2d9 to 384adbb Compare June 2, 2021 15:38
@emile-bex emile-bex temporarily deployed to entourage-webapp-preprod June 3, 2021 11:57 Inactive
@emile-bex emile-bex force-pushed the feature/redux-ssr branch from 387ee75 to a7d6c53 Compare June 3, 2021 12:00
@emile-bex emile-bex temporarily deployed to entourage-webapp-preprod June 3, 2021 12:16 Inactive
@emile-bex emile-bex temporarily deployed to entourage-webapp-preprod June 3, 2021 14:45 Inactive
@emile-bex emile-bex force-pushed the feature/redux-ssr branch from 34841fc to ef2631b Compare June 3, 2021 15:46
@emile-bex emile-bex temporarily deployed to entourage-webapp-preprod June 3, 2021 15:47 Inactive
@emile-bex emile-bex temporarily deployed to entourage-webapp-preprod June 7, 2021 07:42 Inactive
@emile-bex emile-bex force-pushed the feature/redux-ssr branch from d8ffa69 to c51e388 Compare June 7, 2021 07:59
@emile-bex emile-bex temporarily deployed to entourage-webapp-preprod June 7, 2021 08:02 Inactive

const { feedsMarkersContent, isLoading } = useActionMarkers()
if (googleMapApiIsLoaded) {
const hasNotLoadedFromSSR = !actionId
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Pourquoi on a besoin de faire ça exactement ?
Normalement même si le composant se charge dans une page qui n'a pas été chargé par le serveur, on va quand même avoir le getInitialProps de la page qui sera appelé

// TODO
// it.skip('should remove user token on logout', () => {})
// TODO fix test
it.skip(`
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

A fixer avant le merge

@@ -1066,6 +1097,7 @@ describe('Auth User', () => {
authUserSensitizationStorage.getHasSeenPopup.mockReturnValueOnce(false)

store.dispatch(publicActions.setUser(user))
store.dispatch(publicActions.initUser())
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

C'est bizarre d'avoir initUser après setUser, il faudrait peut être renommer initUser pour que ça soit plus précis comme action ?

this.store = store
this.persistor = persistor
if (!isSSR) {
CookiesAuthUserTokenStorage.initToken().then()
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Je crois qu'on avait vu qu'il n'y avait pas besoin du then

Suggested change
CookiesAuthUserTokenStorage.initToken().then()
CookiesAuthUserTokenStorage.initToken()

// Wait until React Queries support SSR. Coming soon
// see https://github.com/tannerlinsley/react-query/issues/14
// }
const Actions: StatelessPage<Props> = () => (
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Pourquoi on a 2 composants dans une même page ?

@@ -1,5 +1,5 @@
import React from 'react'
import { Messages, useEntourageUuid } from 'src/containers/Messages'
import { Messages as MessagesComponent, useEntourageUuid } from 'src/containers/Messages'
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

pas de composant qui s'appelle Component, ça ne le distingue pas plus d'un autre

</PrivateRoute>
</>
)
}

export default MessagesPage
const Messages: StatelessPage<Props> = () => (
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Pourquoi on a 2 composants dans une même page ?

// Wait until React Queries support SSR. Coming soon
// see https://github.com/tannerlinsley/react-query/issues/14
// }
const POIs: StatelessPage<Props> = () => (
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

idem

})
}

export default connect((state: AppState) => state)(Action)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

pourquoi on a besoin de connect ici ?

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