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

Update dependency Next.js to v9.1.4 #315

Merged
merged 36 commits into from
Jun 18, 2020
Merged

Update dependency Next.js to v9.1.4 #315

merged 36 commits into from
Jun 18, 2020

Conversation

iquabius
Copy link
Owner

@iquabius iquabius commented Jun 17, 2020

This partially solves #304

iquabius added 2 commits June 16, 2020 22:21
For now just to make the tests run in CI. Later we can
figure out if it's "declaration" that should go away.
"Error while running `getDataFromTree` TypeError: Cannot read property
'pathname' of null".

There's a lot of code I added in this commit just to debug what was
going on, but the important part is the usage of `AppTree` instead
of the composed `App` when using `getDataFromTree()`.

The issue is documented here:
vercel/next.js#7731

And solved here:
vercel/next.js#7732
@iquabius
Copy link
Owner Author

In the terminal log below, why is WithData.render() being called twice? The integration with Apollo Client in withData() is probably outdated. Take a look at a more up to date version: vercel/next.js#9516.

WithData.getInitialProps() -> ctx:  [ 'AppTree', 'Component', 'router', 'ctx' ]
WithData.getInitialProps() -> router: { pathname: '/admin/provas/detalhes' }
OliApp.getInitialProps -> appCtx:  [ 'AppTree', 'Component', 'router', 'ctx' ]
OliApp.getInitialProps -> appCtx -> Component:  [Function: PageAdminExamDetails] { getInitialProps: [AsyncFunction] }
OliApp.getInitialProps -> appCtx -> router:  { pathname: '/admin/provas/detalhes' }
PageAdminExamDetails.getInitialProps() -> pageCtx:  [
  'err',
  'req',
  'res',
  'pathname',
  'query',
  'asPath',
  'AppTree',
  'apolloClient'
]
OliApp.getInitialProps -> pageProps:  [ 'fakeProp', 'loggedInUser' ]
WithData -> appProps:  [ 'pageProps' ]
Awaiting getDataFromTree()...
WithData.render()
OliApp.render() -> props:  [ 'pageProps', 'apolloClient', 'Component', 'router' ]
OliApp.render() -> props -> router:  { pathname: '/admin/provas/detalhes' }
AppWrapper -> router:  { pathname: '/admin/provas/detalhes' }
PageAdminExamDetails() -> props:  [ 'fakeProp', 'loggedInUser' ]
WithData.render()
OliApp.render() -> props:  [ 'pageProps', 'apolloClient', 'Component', 'router' ]
OliApp.render() -> props -> router:  { pathname: '/admin/provas/detalhes' }
AppWrapper -> router:  { pathname: '/admin/provas/detalhes' }
PageAdminExamDetails() -> props:  [ 'fakeProp', 'loggedInUser' ]
getDataFromTree() finished -> data extracted
MyDocument.getInitialProps()
WithData.render()
OliApp.render() -> props:  [ 'Component', 'router', 'apolloState', 'pageProps' ]
OliApp.render() -> props -> router:  { pathname: '/admin/provas/detalhes' }
AppWrapper -> router:  { pathname: '/admin/provas/detalhes' }
PageAdminExamDetails() -> props:  [ 'fakeProp', 'loggedInUser' ]
MyDocument.render()

Another thing I noticed is that apolloState is not complete in __NEXT_DATA__, it's missing data from ExamDetails:

image

iquabius added 19 commits June 17, 2020 17:27
Babel, through Next.js, need this very badly:

"The following changes are being made to your tsconfig.json file:
  - compilerOptions.isolatedModules must be true (requirement for babel)"
"error TS1208: All files must be modules when
the '--isolatedModules' flag is provided."
I removed by mistake when updating Next.js in
274a008
@codecov-commenter
Copy link

codecov-commenter commented Jun 18, 2020

Codecov Report

Merging #315 into master will increase coverage by 0.34%.
The diff coverage is 22.44%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #315      +/-   ##
==========================================
+ Coverage   23.08%   23.43%   +0.34%     
==========================================
  Files         105      106       +1     
  Lines        1412     1434      +22     
  Branches      230      230              
==========================================
+ Hits          326      336      +10     
- Misses       1085     1097      +12     
  Partials        1        1              
Impacted Files Coverage Δ
packages/web/src/components/AppFrame.tsx 0.00% <0.00%> (ø)
...web/src/components/Question/Form/FilePondField.tsx 0.00% <ø> (ø)
...ackages/web/src/components/Question/UpdateForm.tsx 0.00% <0.00%> (ø)
packages/web/src/components/UserMenuAppBar.tsx 0.00% <0.00%> (ø)
packages/web/src/pages/_app.tsx 0.00% <0.00%> (ø)
packages/web/src/pages/_document.tsx 0.00% <0.00%> (ø)
packages/web/src/pages/admin/provas/detalhes.tsx 0.00% <0.00%> (ø)
packages/web/src/pages/criar_conta.tsx 0.00% <0.00%> (ø)
packages/web/src/pages/index.tsx 0.00% <ø> (ø)
packages/web/src/pages/login.tsx 0.00% <0.00%> (ø)
... and 8 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 184e555...d6ed837. Read the comment docs.

@iquabius iquabius merged commit b565983 into master Jun 18, 2020
@iquabius iquabius deleted the next-v9.1.4 branch June 18, 2020 20:08
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.

3 participants