-
Notifications
You must be signed in to change notification settings - Fork 1
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
Conversation
"Upgrade to latest release in a follow-up since they changed how they polyfill." See https://github.com/mui-org/material-ui/pull/18441/files#r386433177.
Next.js supports "src" directory since version 9.1: https://nextjs.org/blog/next-9-1#src-directory-support
The public directory was also introduced in version 9.1: https://nextjs.org/blog/next-9-1#public-directory-support.
npm run dev
Next.js "will automatically prefetch <Link> components as they appear in-viewport" since version 9.0. See: - https://nextjs.org/blog/next-9#production-optimizations - https://nextjs.org/docs/api-reference/next/link
Container was deprecated in v9.0.4: https://err.sh/zeit/next.js/app-container-deprecated
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
In the terminal log below, why is 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 |
This reverts commit bbc417d.
...in package-lock.json https://stackoverflow.com/a/54127283/1787829
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 Report
@@ 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
Continue to review full report at Codecov.
|
This partially solves #304