Related to [11014](https://github.com/vercel/next.js/issues/11014)
1. Moved the reducer into the store and created new store file
2. The example was using a server that was no longer available, now it uses JSON placeholder instead.
3. Moved from getInitialProps to getStaticProps
4. Refactored all the classes to functional components, using the new redux hooks API.
5. Upgraded all the packages and using custom redux wrapper instead of next-redux-wrapper, which I have removed from the example.
6. Upgraded all the other packages.
Please, let me know if I should change anything.
**First, apologies for a second PR on the same issue but I was working on this already so I thought I'd push it and let you decide which you want to merge.**
The PR is related to [13466](https://github.com/vercel/next.js/issues/13466).
Based on my research, the error happens if the options are empty, null, or undefined. That's why I have decided that the most proper check would be using the! post-fix expression operator may assert that its operand is non-null and non-undefined. ``if (options == null)``
(Optional)
I have also added a warning, which warns the user if the passed "dev" variable is not a boolean.
It's my first PR on the "packages" part of the repo so I'd be glad to receive all kinds of critics. If you want me to change or remove anything, I'm open to suggestions.
---
Fixes#13466
The [docs for customising the PostCSS config](https://nextjs.org/docs/advanced-features/customizing-postcss-config) warn the user they will need to manually install any dependencies that Next.JS will implicitly use if the config is not overridden. `postcss-preset-env` is missing from the install command.
This skips reading from the file system because the `sourcesContent` can be used to access the source code.
I've completely removed the filesystem fallback, because it's probably not our code that'd be syntax highlighted anyway.
This removes remaining references to `granularChunks` in configs, error messages, and comments.
Also removed the `process.env.__NEXT_GRANULAR_CHUNKS` value.
---
Follow up to: https://github.com/vercel/next.js/pull/13663
In serverless mode, it's best practice to propagate an unhandled error so that the function is disposed instead of recycled. This helps fix the "bad state" problem.
Was going through _document and noticed some variable shadowing going on. Added a rule for it to our eslint configuration and went through all warnings with @Timer.
Closes#12664Closes#13604
The culprit was not only changing the library directory, but also having the icons version past 4.0.6. Also, the components which used the library had to be adjusted according to the new changes.
Confirmed that it works both in production and development. Confirmed that it builds on dev and production.
![Alt Text](https://media.giphy.com/media/dZ46aA1Rs7Oi1wSQKU/giphy.gif)
Fixes https://github.com/vercel/next.js/issues/13524
To do:
- [x] fix dev mode
- [x] there's a ~route ordering or~ trailing slash issue with top level catch-all (current tests reflect that)
- [x] in this test `/get-static-paths/whatever` should fall back to `/[[...optionalName]].js` since `fallback` is `false` in its `getStaticPaths` method. ~Currently seems to 500~ must have been a glitch
- [x] add tests for `null`, `undefined` ~and `false`~ behavior as well (if decided these are valid)
- [x] ~add tests for string params as well~ this is not allowed for catch-all routes
- [x] test behavior when fallback is enabled and a top level catch-all exists
This addresses some errors for `/_next/data` requests where encoded `/` values in dynamic route param would cause invalid behavior, a headers already sent error would be shown when sending the fallback page in development, and when rendering the `_error` page for a data request the error response would still be treated as a data request.
This also adds test cases for these errors to prevent regression
- The first links were updated to match the new titles
- Removed the `# .env.local` comment as it's redundant
- Added links to the sections related to data fetching
Also added `.now`, this should make sure that if the Vercel CLI is used inside the examples to deploy a project, the project folder is not added to the list of changes.
This PR fixes https://github.com/vercel/next.js/issues/4883.
It introduces a new global variable (`window.__REHYDRATE_IDS`) only when necessary.
In the case of the `with-react-with-styles` example, rehydration isn't happening, so I removed the creation of the variable.
In the case of the `with-react-intl` example, the information doesn't seem to be set anymore on `__NEXT_DATA__`, so I just removed the default reference to it.
Looks like `caniuse-lite` is out of date and causing test failures.
- I upgraded both `browserslist` and `caniuse-lite` to latest semver compatible version.
- This seemed to cause changes in ncc compiled files, so recompiled.
- `lint-staged` failed on these files even though they should be ignored. As a fix, I applied the advice from https://github.com/okonet/lint-staged#how-can-i-ignore-files-from-eslintignore-
- Updated some test snapshots. 🤔 not sure this is the way to go
* Refactored the store so that it doesnt use getInitialProps
* Applied the changes in the _app file
* Refactored the wrapper so that it uses the new store flow
* Removed the old redux syntax
Instead of passing the state from the parent component, I have used the new redux hooks to retrieve the current state.
* The clock no longer requires state to be passed too
* Updated the variable names
* forgot to bring back hot reloading
* Applied requested change.
Closes#12045
This PR adds support for [etags](https://tools.ietf.org/html/rfc7232#section-3.2) to Next.js' API routes, which will improve user experience and decrease network traffic by enabling usage of etag-based caching.
* Moved the state to the clock component
* Refactored the store according to the new requirements
* Refactored _app so it uses the new store
* This file is no longer needed
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
- Update to latest stripe-node version and pin the exact version so the Types won't go out of sync
- Add the env var changes for next 9.4.4 (https://nextjs.org/blog/next-9-4#new-environment-variables-support)
- Remove `next.config.js` as no longer needed.
- Add the Deploy to Vercel button
* created with-mongodb, Next.js + MongoDB
Co-authored-by: Shania Dhani <31454777+sdhani@users.noreply.github.com>
Co-authored-by: Michelle Lucero <31500626+MichelleLucero@users.noreply.github.com>
Co-authored-by: Chi Shing Lee <60354073+chislee0708@users.noreply.github.com>
* Update examples/with-mongodb/README.md
Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
* modified for dotenv and environment var setup
* removed extra instructions on readme, linked it to the MongoDB guides
* changes to environment var
* replaced document with react logic
* removed Pet header
* removed isomorphic-unfetch
* replaced getInitialProps with getStaticProps (SSG)
* removed console log
* deleted next.config.js file
* fixed prettier styling
* fixed link 404 server rendering issue
* modified server path for delete/edit
* fixed prettier styling
* fixed a typo
* change .env to .env.local
Co-authored-by: Joe Haddad <timer150@gmail.com>
* fixed typo, change .env to .env.local
Co-authored-by: Joe Haddad <timer150@gmail.com>
* change .env to .env.local
Co-authored-by: Joe Haddad <timer150@gmail.com>
* Update examples/with-mongodb/package.json
Co-authored-by: Joe Haddad <timer150@gmail.com>
* removed dotenv dev dependency
Co-authored-by: Joe Haddad <timer150@gmail.com>
* cleaned up code and instructions
* Update examples/with-mongodb/.gitignore
Co-authored-by: Luis Alvarez D. <luis@vercel.com>
* minor changes to code style and logic
* Updated index page and .env.local.example
* Updated new page
* Don't use SSG for the edit page
* Fixed revalidation issue
* Use es6 for the model
* Updated edit page
* Removed VERCEL_URL
* Updated readme and renamed env
* Added temporal vercel.json
* Removed seed until added with a script
* Updated package.json
* Renamed example in readme
* Renamed example
* Lint fix
Co-authored-by: liulanz <zhengliulan@gmail.com>
Co-authored-by: Shania Dhani <31454777+sdhani@users.noreply.github.com>
Co-authored-by: Chi Shing Lee <60354073+chislee0708@users.noreply.github.com>
Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
Co-authored-by: sdhani <shania.dhani46@myhunter.cuny.edu>
Co-authored-by: liulanz <37808313+liulanz@users.noreply.github.com>
Co-authored-by: Joe Haddad <timer150@gmail.com>
Co-authored-by: Luis Alvarez D. <luis@vercel.com>
This PR fixes https://github.com/vercel/next.js/issues/7769.
However, I would like for @jayu to confirm that it's ok to use the latest Linaria 2.0 alpha release. I can confirm from my local testing that it's working as expected.