Skip to content

Commit 8dac52c

Browse files
committed
Merge branch 'ep-create-edge-function-demo' of github.com:netlify/next-runtime into ep-create-edge-function-demo
2 parents b86093d + 88f0f36 commit 8dac52c

File tree

12 files changed

+245
-98
lines changed

12 files changed

+245
-98
lines changed

.github/workflows/codeql-analysis.yml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# For most projects, this workflow file will not need changing; you simply need
2+
# to commit it to your repository.
3+
#
4+
# You may wish to alter this file to override the set of languages analyzed,
5+
# or to provide custom queries or build logic.
6+
#
7+
# ******** NOTE ********
8+
# We have attempted to detect the languages in your repository. Please check
9+
# the `language` matrix defined below to confirm you have the correct set of
10+
# supported CodeQL languages.
11+
#
12+
name: 'CodeQL'
13+
14+
on:
15+
push:
16+
branches: ['main', v3]
17+
pull_request:
18+
# The branches below must be a subset of the branches above
19+
branches: ['main']
20+
schedule:
21+
- cron: '25 21 * * 6'
22+
23+
jobs:
24+
analyze:
25+
name: Analyze
26+
runs-on: ubuntu-latest
27+
permissions:
28+
actions: read
29+
contents: read
30+
security-events: write
31+
32+
strategy:
33+
fail-fast: false
34+
matrix:
35+
language: ['javascript']
36+
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
37+
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
38+
39+
steps:
40+
- name: Checkout repository
41+
uses: actions/checkout@v3
42+
43+
# Initializes the CodeQL tools for scanning.
44+
- name: Initialize CodeQL
45+
uses: github/codeql-action/init@v2
46+
with:
47+
languages: ${{ matrix.language }}
48+
# If you wish to specify custom queries, you can do so here or in a config file.
49+
# By default, queries listed here will override any specified in a config file.
50+
# Prefix the list here with "+" to use these queries and those in the config file.
51+
52+
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
53+
# queries: security-extended,security-and-quality
54+
55+
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
56+
# If this step fails, then you should remove it and run the build manually (see below)
57+
- name: Autobuild
58+
uses: github/codeql-action/autobuild@v2
59+
60+
# ℹ️ Command-line programs to run using the OS shell.
61+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
62+
63+
# If the Autobuild fails above, remove it and uncomment the following three lines.
64+
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
65+
66+
# - run: |
67+
# echo "Run, Build Application using script"
68+
# ./location_of_script_within_repo/buildscript.sh
69+
70+
- name: Perform CodeQL Analysis
71+
uses: github/codeql-action/analyze@v2

.prettierignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@ lib
2222
tsconfig.json
2323
demos/nx-next-monorepo-demo
2424

25-
packages/runtime/CHANGELOG.md
25+
**/CHANGELOG.md
2626
packages/runtime/lib
2727
packages/runtime/dist-types

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"packages/runtime": "4.21.1",
2+
"packages/runtime": "4.21.2",
33
"packages/next": "1.1.1"
44
}

README.md

Lines changed: 10 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,8 @@
22

33
# Next.js Runtime
44

5-
<p align="center">
6-
<a aria-label="npm version" href="https://www.npmjs.com/package/@netlify/plugin-nextjs">
7-
<img alt="" src="https://img.shields.io/npm/v/@netlify/plugin-nextjs">
8-
</a>
9-
<a aria-label="MIT License" href="https://img.shields.io/npm/l/@netlify/plugin-nextjs">
10-
<img alt="" src="https://img.shields.io/npm/l/@netlify/plugin-nextjs">
11-
</a>
12-
</p>
13-
14-
## What's new in this version
15-
16-
For full details of everything that's new, check out
17-
[the v4 release notes](https://github.com/netlify/next-runtime/blob/main/docs/release-notes/v4.md)
5+
Next.js is supported natively on Netlify, and in most cases you will not need to install or configure anything. This
6+
repo includes the packages used to support Next.js on Netlify.
187

198
## Deploying
209

@@ -55,21 +44,9 @@ by targeting the `/_next/image/*` route:
5544

5645
## Next.js Middleware on Netlify
5746

58-
Next.js Middleware works out of the box on Netlify, but check out the
59-
[docs on some caveats](https://github.com/netlify/next-runtime/blob/main/docs/middleware.md). By default, middleware
60-
runs using SSR. For better results, you should enable [Netlify Edge Functions](#netlify-edge-functions), which ensures
61-
middleware runs at the edge. To use Netlify Edge Functions for middleware or to enable
62-
[edge server rendering](https://nextjs.org/blog/next-12-2#edge-server-rendering-experimental), set the environment
63-
variable `NEXT_USE_NETLIFY_EDGE` to `true`.
64-
65-
### No nested middleware in Next 12.2.0
66-
67-
In Next 12.2.0, nested middleware [has been deprecated](https://nextjs.org/docs/messages/middleware-upgrade-guide) in
68-
favor of root level middleware. If you are not using edge functions then this means that you won't get the benefits of
69-
using a CDN, and ISR will not work.
70-
71-
To fix this issue, you can run your middleware on [Netlify Edge Functions](#netlify-edge-functions) by setting the
72-
environment variable `NEXT_USE_NETLIFY_EDGE` to `true`.
47+
Next.js Middleware works out of the box on Netlify. By default, middleware runs using Netlify Edge Functions. For legacy
48+
support for running Middleware at the origin, set the environment variable `NEXT_DISABLE_NETLIFY_EDGE` to `true`. Be
49+
aware that this will result in slower performance, as all pages that match middleware must use SSR.
7350

7451
## Monorepos
7552

@@ -127,11 +104,12 @@ package = "@netlify/plugin-nextjs"
127104

128105
## Manually upgrading from an older version of the Next.js Runtime
129106

130-
If you previously set these values, they're no longer needed and can be removed:
107+
If you previously set these values, they're no longer needed and should be removed:
131108

132109
- `distDir` in your `next.config.js`
133110
- `node_bundler = "esbuild"` in `netlify.toml`
134111
- `external_node_modules` in `netlify.toml`
112+
- The environment variable `NEXT_USE_NETLIFY_EDGE` can be removed as this is now the default
135113

136114
The `serverless` and `experimental-serverless-trace` targets are deprecated in Next 12, and all builds with this Next
137115
Runtime will now use the default `server` target. If you previously set the target in your `next.config.js`, you should
@@ -144,5 +122,6 @@ files must be placed in `public`, not in the root of the site.
144122

145123
## Feedback
146124

147-
If you think you have found a bug in this repo, [please open an issue](https://github.com/netlify/next-runtime/issues).
148-
If you have comments or feature requests, [see the dicussion board](https://github.com/netlify/next-runtime/discussions)
125+
If you think you have found a bug in Next.js on Netlify,
126+
[please open an issue](https://github.com/netlify/next-runtime/issues). If you have comments or feature requests,
127+
[see the discussion board](https://github.com/netlify/next-runtime/discussions)

0 commit comments

Comments
 (0)