Releases: cloudflare/next-on-pages
@cloudflare/next-on-pages@1.4.0
Minor Changes
-
660ed5e: Optimize build output function processing to increase next-on-pages' build speed by 2-4x.
-
11afe0a: Group code block identifiers by the function files that they are consumed in. This reduces the total number of unique files created for identifiers that are used in multiple functions, like Webpack chunks or manifests.
-
ee6b7dc: add user-agent header to outgoing fetch requests
mimic Next.js' behavior of setting (if not already present) a
user-agent
header set toNext.js Middleware
see: https://github.com/vercel/next.js/blob/6705c803021d3bdea7fec20e5d98f6899e49836d/packages/next/src/server/web/sandbox/context.ts#L318-L320this helps making next-on-pages more consistent with Next.js on Vercel
(it and can solve issues in which such header is necessary, as for example when making Github rest api calls,
see: #376 (comment))
Patch Changes
- 660ed5e: Prevent prerender files from overwriting in the output directory when the file hashes are the same.
- 660ed5e: Completely avoid processing rsc functions due to them being identical to non-rsc functions.
- f08f2b9: Fix
next.config.js
rewrites unintentionally redirecting the user instead of rewriting the request. - 6c28128: Fix middleware redirects not always bailing out of the routing stages.
- 9734795: clarify that Yarn Plug'n'Play can't be used simply because not supported by vercel
- 551fa05: Fix the
/_next/static
exclusion in_routes.json
being incorrect when the directory is not in the root.
eslint-plugin-next-on-pages@1.3.1
eslint-plugin-next-on-pages@1.3.1
@cloudflare/next-on-pages@1.3.1
Patch Changes
-
619beea: bundle assets produced by the Vercel build and make them accessible via fetch
Vercel/Next can allow access binary assets bundled with their edge functions in the following manner:
const font = fetch(new URL('../../assets/asset-x', import.meta.url)).then( (res) => res.arrayBuffer(), );
As you can see in this
@vercel/og
example:
https://vercel.com/docs/concepts/functions/edge-functions/og-image-generation/og-image-examples#using-a-custom-fontThis sort of access to bindings is necessary for the
@vercel/og
package to work and might be used in other packages
as well, so it is something that we need to support.
We do so by making sure that we properly bind the assets found in the Vercel build output into our worker
and that fetches to such assets (using blob urls) are correctly handled (this requires us to patch the globalfetch
function) -
76a8bb4: Fix multiple search params with the same key not being preserved
eslint-plugin-next-on-pages@1.3.0
Minor Changes
-
f1f5a95: remove eslint
missing-image-loader
rulethe
missing-image-loader
rule is no longer needed since@cloudflare/next-on-pages
version 1.3.0 as basic support for theImage
component has been introduced
(in the following PR: #357), therefore there isn't
a real need to warn developers not to use theImage
component without a custom loader
(since the component will just work by default).Warning
This is technically a breaking change to theeslint-plugin-next-on-pages
package
since linting would break for users specifically including themissing-image-loader
rule (causingDefinition for rule 'next-on-pages/missing-loader' was not found
errors)
however currently we don't assume that many people are using the plugin with the rule
specifically included, moreover the resolution for the breaking change is to simply
remove the rule from the application's eslint configuration so it is also extremely
simple to fix, thus we didn't consider this worth a major bump
eslint-plugin-next-on-pages@1.2.0
Patch Changes
-
daa32fd: update no-unsupported-config rules (to match the latest supported configs table)
-
c21c995: add fallback detection check in no-unsupported-configs rule
add an additional check in the no-unsupported-configs rule so that if the rule
were to fail detecting the config's name as a last resort we fall back checking
the variable declaration present just after the "/*_ @type {import('next').NextConfig} _/"
comment
@cloudflare/next-on-pages@1.2.0
Minor Changes
- 2f9cf97: Support for using a custom output directory for the generated worker and static assets, through a
--outdir
flag.
Patch Changes
-
f879ffd: Prevent middleware redirects applying search params.
When a middleware function results in a redirect, the location header specified in the response is the full destination, including any search params, as written by the developer. Previously, we always applied search params to redirects found during the routing process, no matter what. This meant that we accidentally were applying search params to middleware redirects, which would alter the intended final destination. This change prevents that from happening.
-
3a95489: Fix middleware returning
new NextResponse
resulting in 404 for routes that don't exist in the build output. -
2dceb75: Fix middleware being invoked multiple times in a phase during routing when there is more than one config entry.
eslint-plugin-next-on-pages@1.1.1
eslint-plugin-next-on-pages@1.1.1
eslint-plugin-next-on-pages@1.0.3
eslint-plugin-next-on-pages@1.0.3
@cloudflare/next-on-pages@1.1.1
Minor Changes
- 2c87481: Display a summary about the build at the end of the build process.
Patch Changes
-
b1c3a33: fix --info showing [object Promise] for relevant packages instead of their versions
-
a9b8c3c: Overwrite prerendered files if they already exist in the output directory.
When using
--skip-build
, it would fail if a prerendered file already existed, so we need to override the files so that the build process can continue like normal. This was problematic as after the first build, the prerendered files would now exist in the output directory as static assets, preventing any additional builds. -
b1c3a33: fix vercel command not found issue
@cloudflare/next-on-pages@1.0.3
Patch Changes
-
b1c3a33: fix --info showing [object Promise] for relevant packages instead of their versions
-
a9b8c3c: Overwrite prerendered files if they already exist in the output directory.
When using
--skip-build
, it would fail if a prerendered file already existed, so we need to override the files so that the build process can continue like normal. This was problematic as after the first build, the prerendered files would now exist in the output directory as static assets, preventing any additional builds. -
b1c3a33: fix vercel command not found issue