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

Add example with link to oficial example of "Material-ui with Typescript" #37499

Closed
wants to merge 58 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
8c600bc
Examples: Add Material UI example with Typescript
henriqueholtz Jun 7, 2022
78d2fff
Avoid unnecessary router state changes (#37431)
shuding Jun 7, 2022
0996628
Enable externalHelpers swc option (#37150)
ijjk Jun 7, 2022
7e5ef97
Update flakey preview test (#37518)
ijjk Jun 7, 2022
f3cf3ae
Add middleware size stats (#37519)
ijjk Jun 7, 2022
7963990
Add check for duplicate locales (#37485)
eric-burel Jun 7, 2022
0473d45
add method to measure Interaction to Next Paint (INP) (#36490)
Jun 7, 2022
b3392ce
chore: remove unused variable (#37538)
balazsorban44 Jun 8, 2022
fdd776f
Update to latest version of @swc/helpers (#37531)
ijjk Jun 8, 2022
09d075c
[middleware] Support any `method` when fetching a `Request` instance …
Schniz Jun 8, 2022
d9ebd9d
Migrate head side effects to hooks (#37526)
huozhi Jun 8, 2022
2e282ee
chore: remove unused safari nomodule fix (#37541)
SukkaW Jun 8, 2022
5b064d7
fix(#37106): middleware can not be loaded from src folder (#37428)
feugy Jun 8, 2022
935960c
Remove Middleware Preflight (#37490)
javivelasco Jun 8, 2022
f105ae7
fix(eslint): false positive for legit next/server imports (#37515)
feugy Jun 8, 2022
5a120de
chore: reworks nested middleware error message (#37513)
feugy Jun 8, 2022
dc665f2
v12.1.7-canary.32
ijjk Jun 8, 2022
0945347
Update deployment documentation. (#37571)
leerob Jun 8, 2022
fd83f50
Revert "Avoid unnecessary router state changes" (#37572)
shuding Jun 8, 2022
77f15fd
v12.1.7-canary.33
ijjk Jun 8, 2022
6d821d2
Middleware: remove `req.ua` (#37512)
Kikobeats Jun 9, 2022
b1ce020
[middleware] support destructuring for env vars in static analysis (#…
Schniz Jun 9, 2022
d8e2ad2
Fix react root env missing in NextServer (#37562)
huozhi Jun 9, 2022
34b155f
Fix client entry unexpectedly created in app dir (#37561)
shuding Jun 9, 2022
d5fb317
Ensure check-precompiled exits correctly on failure (#37592)
ijjk Jun 9, 2022
6bcd84d
Revert "Revert "Avoid unnecessary router state changes"" (#37593)
shuding Jun 9, 2022
41947e2
Update to process redirects/rewrites for _next/data with middleware (…
ijjk Jun 10, 2022
5a4b291
Bump @vercel/nft 0.20.0 (#37602)
styfle Jun 10, 2022
41a9a49
i18n regression tests and docs for ignore locale in rewrite (#37581)
Jun 10, 2022
4062f45
Strip next internal queries for flight response (#37617)
huozhi Jun 10, 2022
462d1f4
v12.1.7-canary.34
ijjk Jun 10, 2022
fa31975
Fix failing swc builds (#37629)
ijjk Jun 10, 2022
78ce85f
Update usage of example.com -> example.vercel.sh (#37630)
ijjk Jun 10, 2022
06035f3
v12.1.7-canary.35
ijjk Jun 10, 2022
46b3154
Fix with mux video example (#37434)
icyJoseph Jun 11, 2022
aaa69e7
chore: narrows regexp to enable middleware source maps (#37582)
feugy Jun 11, 2022
788acb0
Changed _app.js to a functional component (#37635)
alabhyajindal Jun 11, 2022
5e6b190
Bump version tailwindcss example to 3.1 (#37633)
nguyenyou Jun 11, 2022
ad73ac4
feat(next export): add warning if using getInitialProps (#37642)
jsjoeio Jun 13, 2022
8f91aec
Update with-faunadb dependencies (#37650)
vorcigernix Jun 13, 2022
39f27b4
[Script] Updates stale `no-script-in-document-page` error doc (#37568)
housseindjirdeh Jun 13, 2022
9df1e68
Request library required by setup (#37658)
vorcigernix Jun 13, 2022
226c982
Update matched path params priority (#37646)
ijjk Jun 13, 2022
43cb401
Update flakey next-script tests (#37663)
ijjk Jun 13, 2022
31efa73
Update with-mux-video to use latest upchunk and replace video player …
clearlyTHUYDOAN Jun 13, 2022
b40d39e
Fix links in google-font-display error (#37661)
splatterxl Jun 13, 2022
199e13a
v12.1.7-canary.36
ijjk Jun 13, 2022
4f1be36
Re-introduce Edge API Endpoints (#37481)
Schniz Jun 13, 2022
c0a92f7
Allow passing FileRef directly to createNext (#37664)
ijjk Jun 13, 2022
668961a
Fix rewrite/dynamic interpolation E2E cases (#37669)
ijjk Jun 13, 2022
5cd74bf
v12.1.7-canary.37
ijjk Jun 13, 2022
a26103c
Fix Image Optimization cache-control regression with external images …
styfle Jun 13, 2022
f40ddf8
Adds consistency to ESLint rules. (#34335)
manovotny Jun 14, 2022
1cf6fa0
Ensure custom middleware matcher is used correctly in client manifest…
ijjk Jun 14, 2022
294e761
v12.1.7-canary.38
ijjk Jun 14, 2022
0cba765
Convert active-class-name example to TypeScript (#37676)
maxproske Jun 14, 2022
d3609b9
Add with-docker-compose example (#32668)
maxproske Jun 14, 2022
e70be80
Remove folder "with-material-ui-typescript" and include the example w…
henriqueholtz Jun 14, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
22 changes: 12 additions & 10 deletions .github/workflows/build_test_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,8 @@ jobs:
path: ./*
key: ${{ github.sha }}-${{ github.run_number }}

- run: npm i -g pnpm@${PNPM_VERSION}

- run: rm -rf .git && mv .git-bak .git
if: ${{needs.build.outputs.docsChange != 'docs only change'}}

Expand Down Expand Up @@ -1241,23 +1243,23 @@ jobs:
- host: ubuntu-latest
target: aarch64-linux-android
build: |
export CARGO_TARGET_AARCH64_LINUX_ANDROID_LINKER="${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android24-clang"
export CC="${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android24-clang"
export CXX="${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android24-clang++"
export PATH="${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin:${PATH}"
export CARGO_TARGET_AARCH64_LINUX_ANDROID_LINKER="/usr/local/lib/android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android24-clang"
export CC="/usr/local/lib/android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android24-clang"
export CXX="/usr/local/lib/android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android24-clang++"
export PATH="/usr/local/lib/android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/linux-x86_64/bin:${PATH}"
npm i -g "@napi-rs/cli@${NAPI_CLI_VERSION}" "turbo@${TURBO_VERSION}" && if [ ! -f $(dirname $(which yarn))/pnpm ]; then ln -s $(which yarn) $(dirname $(which yarn))/pnpm;fi
turbo run build-native --cache-dir=".turbo" -- --release --target aarch64-linux-android
${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android-strip packages/next-swc/native/next-swc.*.node
/usr/local/lib/android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android-strip packages/next-swc/native/next-swc.*.node
- host: ubuntu-latest
target: armv7-linux-androideabi
build: |
export CARGO_TARGET_ARMV7_LINUX_ANDROIDEABI_LINKER="${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin/armv7a-linux-androideabi24-clang"
export CC="${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin/armv7a-linux-androideabi24-clang"
export CXX="${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin/armv7a-linux-androideabi24-clang++"
export PATH="${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin:${PATH}"
export CARGO_TARGET_ARMV7_LINUX_ANDROIDEABI_LINKER="/usr/local/lib/android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/linux-x86_64/bin/armv7a-linux-androideabi24-clang"
export CC="/usr/local/lib/android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/linux-x86_64/bin/armv7a-linux-androideabi24-clang"
export CXX="/usr/local/lib/android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/linux-x86_64/bin/armv7a-linux-androideabi24-clang++"
export PATH="/usr/local/lib/android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/linux-x86_64/bin:${PATH}"
npm i -g "@napi-rs/cli@${NAPI_CLI_VERSION}" "turbo@${TURBO_VERSION}" "pnpm@${PNPM_VERSION}"
turbo run build-native-no-plugin --cache-dir=".turbo" -- --release --target armv7-linux-androideabi
${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin/arm-linux-androideabi-strip packages/next-swc/native/next-swc.*.node
/usr/local/lib/android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/linux-x86_64/bin/arm-linux-androideabi-strip packages/next-swc/native/next-swc.*.node
- host: ubuntu-latest
target: 'aarch64-unknown-linux-musl'
docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine
Expand Down
2 changes: 1 addition & 1 deletion contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ Issues are opened with one of these labels:

- `template: story` - a feature request, converted to an [💡 Ideas discussion](https://github.com/vercel/next.js/discussions/categories/ideas)
- `template: bug` - unverified issue with Next.js itself, or one of the examples in the [`examples`](https://github.com/vercel/next.js/tree/canary/examples) folder
- `template: documentation` - feedback for improvement or unverfied issue with the Next.js documentation
- `template: documentation` - feedback for improvement or an unverified issue with the Next.js documentation

In case of a bug report, a maintainer looks at the provided reproduction. If the reproduction is missing or insufficient, a `please add a complete reproduction` label is added. If a reproduction is not provided for more than 30 days, the issue becomes stale and will be automatically closed. If a reproduction is provided within 30 days, the `please add a complete reproduction` label is removed and the issue will not become stale anymore.

Expand Down
7 changes: 7 additions & 0 deletions docs/api-reference/next.config.js/redirects.md
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,13 @@ module.exports = {
locale: false,
permanent: false,
},
// it's possible to match all locales even when locale: false is set
{
source: '/:locale/page',
destination: '/en/newpage',
permanent: false,
locale: false,
}
{
// this gets converted to /(en|fr|de)/(.*) so will not match the top-level
// `/` or `/fr` routes like /:path* would
Expand Down
6 changes: 6 additions & 0 deletions docs/api-reference/next.config.js/rewrites.md
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,12 @@ module.exports = {
destination: '/en/another',
locale: false,
},
{
// it's possible to match all locales even when locale: false is set
source: '/:locale/api-alias/:path*',
destination: '/api/:path*',
locale: false,
},
{
// this gets converted to /(en|fr|de)/(.*) so will not match the top-level
// `/` or `/fr` routes like /:path* would
Expand Down
8 changes: 6 additions & 2 deletions docs/api-reference/next/image.md
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ The cache status of an image can be determined by reading the value of the `x-ne
- `STALE` - the path is in the cache but exceeded the revalidate time so it will be updated in the background
- `HIT` - the path is in the cache and has not exceeded the revalidate time

The expiration (or rather Max Age) is defined by either the [`minimumCacheTTL`](#minimum-cache-ttl) configuration or the upstream server's `Cache-Control` header, whichever is larger. Specifically, the `max-age` value of the `Cache-Control` header is used. If both `s-maxage` and `max-age` are found, then `s-maxage` is preferred.
The expiration (or rather Max Age) is defined by either the [`minimumCacheTTL`](#minimum-cache-ttl) configuration or the upstream image `Cache-Control` header, whichever is larger. Specifically, the `max-age` value of the `Cache-Control` header is used. If both `s-maxage` and `max-age` are found, then `s-maxage` is preferred. The `max-age` is also passed-through to any downstream clients including CDNs and browsers.

- You can configure [`minimumCacheTTL`](#minimum-cache-ttl) to increase the cache duration when the upstream image does not include `Cache-Control` header or the value is very low.
- You can configure [`deviceSizes`](#device-sizes) and [`imageSizes`](#device-sizes) to reduce the total number of possible generated images.
Expand All @@ -503,7 +503,11 @@ module.exports = {
}
```

If you need to add a `Cache-Control` header for the browser (not recommended), you can configure [`headers`](/docs/api-reference/next.config.js/headers) on the upstream image e.g. `/some-asset.jpg` not `/_next/image` itself.
The expiration (or rather Max Age) of the optimized image is defined by either the `minimumCacheTTL` or the upstream image `Cache-Control` header, whichever is larger.

If you need to change the caching behavior per image, you can configure [`headers`](/docs/api-reference/next.config.js/headers) to set the `Cache-Control` header on the upstream image (e.g. `/some-asset.jpg`, not `/_next/image` itself).

There is no mechanism to invalidate the cache at this time, so its best to keep `minimumCacheTTL` low. Otherwise you may need to manually change the [`src`](#src) prop or delete `<distDir>/cache/images`.

### Disable Static Imports

Expand Down
43 changes: 23 additions & 20 deletions docs/basic-features/eslint.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,28 +80,31 @@ This will take precedence over the configuration from `next.config.js`.

Next.js provides an ESLint plugin, [`eslint-plugin-next`](https://www.npmjs.com/package/@next/eslint-plugin-next), already bundled within the base configuration that makes it possible to catch common issues and problems in a Next.js application. The full set of rules is as follows:

| | Rule | Description |
| :-: | ------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- |
| ✔️ | [next/google-font-display](/docs/messages/google-font-display.md) | Enforce optional or swap font-display behavior with Google Fonts |
| ✔️ | [next/google-font-preconnect](/docs/messages/google-font-preconnect.md) | Enforce preconnect usage with Google Fonts |
| ✔️ | [next/link-passhref](/docs/messages/link-passhref.md) | Enforce passHref prop usage with custom Link components |
| ✔️ | [next/no-css-tags](/docs/messages/no-css-tags.md) | Prevent manual stylesheet tags |
| ✔️ | [next/no-document-import-in-page](/docs/messages/no-document-import-in-page.md) | Disallow importing next/document outside of pages/document.js |
| ✔️ | [next/no-head-import-in-document](/docs/messages/no-head-import-in-document.md) | Disallow importing next/head in pages/document.js |
| ✔️ | [next/no-html-link-for-pages](/docs/messages/no-html-link-for-pages.md) | Prohibit HTML anchor links to pages without a Link component |
| ✔️ | [next/no-img-element](/docs/messages/no-img-element.md) | Prohibit usage of HTML &lt;img&gt; element |
| ✔️ | [next/no-head-element](/docs/messages/no-head-element.md) | Prohibit usage of HTML &lt;head&gt; element |
| ✔️ | [next/no-page-custom-font](/docs/messages/no-page-custom-font.md) | Prevent page-only custom fonts |
| ✔️ | [next/no-sync-scripts](/docs/messages/no-sync-scripts.md) | Forbid synchronous scripts |
| ✔️ | [next/no-title-in-document-head](/docs/messages/no-title-in-document-head.md) | Disallow using &lt;title&gt; with Head from next/document |
| ✔️ | [next/no-unwanted-polyfillio](/docs/messages/no-unwanted-polyfillio.md) | Prevent duplicate polyfills from Polyfill.io |
| ✔️ | [next/inline-script-id](/docs/messages/inline-script-id.md) | Enforce id attribute on next/script components with inline content |
| ✔️ | next/no-typos | Ensure no typos were made declaring [Next.js's data fetching function](/docs/basic-features/data-fetching/overview.md) |
| ✔️ | [next/next-script-for-ga](/docs/messages/next-script-for-ga.md) | Use the Script component to defer loading of the script until necessary. |
| ✔️ | [next/no-styled-jsx-in-document](/docs/messages/no-styled-jsx-in-document.md) | styled-jsx should not be used in \_document |

- ✔: Enabled in the recommended configuration

| | Rule | Description |
| :-: | --------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- |
| ✔️ | [@next/next/google-font-display](/docs/messages/google-font-display.md) | Enforce font-display behavior with Google Fonts. |
| ✔️ | [@next/next/google-font-preconnect](/docs/messages/google-font-preconnect.md) | Ensure `preconnect` is used with Google Fonts. |
| ✔️ | [@next/next/inline-script-id](/docs/messages/inline-script-id.md) | Enforce `id` attribute on `next/script` components with inline content. |
| ✔️ | [@next/next/next-script-for-ga](/docs/messages/next-script-for-ga.md) | Prefer `next/script` component when using the inline script for Google Analytics. |
| ✔️ | [@next/next/no-before-interactive-script-outside-document](/docs/messages/no-before-interactive-script-outside-document.md) | Prevent usage of `next/script`'s `beforeInteractive` strategy outside of `pages/_document.js`. |
| ✔️ | [@next/next/no-css-tags](/docs/messages/no-css-tags.md) | Prevent manual stylesheet tags. |
| ✔️ | [@next/next/no-document-import-in-page](/docs/messages/no-document-import-in-page.md) | Prevent importing `next/document` outside of `pages/_document.js`. |
| ✔️ | [@next/next/no-duplicate-head](/docs/messages/no-duplicate-head.md) | Prevent duplicate usage of `<Head>` in `pages/_document.js`. |
| ✔️ | [@next/next/no-head-element](/docs/messages/no-head-element.md) | Prevent usage of `<head>` element. |
| ✔️ | [@next/next/no-head-import-in-document](/docs/messages/no-head-import-in-document.md) | Prevent usage of `next/head` in `pages/_document.js`. |
| ✔️ | [@next/next/no-html-link-for-pages](/docs/messages/no-html-link-for-pages.md) | Prevent usage of `<a>` elements to navigate to internal Next.js pages. |
| ✔️ | [@next/next/no-img-element](/docs/messages/no-img-element.md) | Prevent usage of `<img>` element to prevent layout shift. |
| ✔️ | [@next/next/no-page-custom-font](/docs/messages/no-page-custom-font.md) | Prevent page-only custom fonts. |
| ✔️ | [@next/next/no-script-component-in-head](/docs/messages/no-script-component-in-head.md) | Prevent usage of `next/script` in `next/head` component. |
| ✔️ | [@next/next/no-server-import-in-page](/docs/messages/no-server-import-in-page.md) | Prevent usage of `next/server` outside of `middleware.js`. |
| ✔️ | [@next/next/no-styled-jsx-in-document](/docs/messages/no-styled-jsx-in-document.md) | Prevent usage of `styled-jsx` in `pages/_document.js`. |
| ✔️ | [@next/next/no-sync-scripts](/docs/messages/no-sync-scripts.md) | Prevent synchronous scripts. |
| ✔️ | [@next/next/no-title-in-document-head](/docs/messages/no-title-in-document-head.md) | Prevent usage of `<title>` with `Head` component from `next/document`. |
| ✔️ | @next/next/no-typos | Prevent common typos in [Next.js's data fetching functions](/docs/basic-features/data-fetching.md) |
| ✔️ | [@next/next/no-unwanted-polyfillio](/docs/messages/no-unwanted-polyfillio.md) | Prevent duplicate polyfills from Polyfill.io. |

If you already have ESLint configured in your application, we recommend extending from this plugin directly instead of including `eslint-config-next` unless a few conditions are met. Refer to the [Recommended Plugin Ruleset](/docs/basic-features/eslint.md#recommended-plugin-ruleset) to learn more.

### Custom Settings
Expand Down
Loading