Enables the symlink optimization that currently exists for `Lambda`
instances, but now for `EdgeFunction` instances as well. This will be
particularly beneficial for Remix applications which use edge functions
for many routes, since they will now all be represented by the same
underling function in production.
---------
Co-authored-by: Sean Massa <EndangeredMassa@gmail.com>
The `name` property of the `EdgeFunction` class is no longer necessary
on the infra side. Instead, its value is inferred based on the URL path
that the function is representing. So deprecate the property on the
class, and remove its usage throughout the codebase.
The CLI renders the deploy URL with the "Preview" label on first deploy because the CLI treats deploys as previews unless `--prod` is set. However the first deploy for a new project is always production, so the CLI needs to render the deploy URL based on the actual deployment's `target`.
This ensures we add handling for our internal `.rsc` suffixes for rewrites since this currently fail to match by default unless the user manually adds handling for this. Updated our test fixture to ensure this is tested properly.
The ionic react build currently fails with:
```
$ react-scripts build
09:06:23.084 | Creating an optimized production build...
09:06:45.231 | Failed to compile.
09:06:45.231 |
09:06:45.232 | /vercel/path0/node_modules/@types/babel__traverse/index.d.ts
09:06:45.232 | TypeScript error in /vercel/path0/node_modules/@types/babel__traverse/index.d.ts(314,13):
09:06:45.232 | Type expected. TS1110
09:06:45.232 |
09:06:45.232 | 312 \| // too complex for TS. So we type it as a general visitor only if the key contains `\|`
09:06:45.232 | 313 \| // this is good enough for non-visitor traverse options e.g. `noScope`
09:06:45.232 | > 314 \| [k: `${string}\|${string}`]: VisitNode<S, Node>;
09:06:45.232 | \| ^
09:06:45.232 | 315 \| };
09:06:45.232 | 316 \|
09:06:45.232 | 317 \| export type VisitNode<S, P extends Node> = VisitNodeFunction<S, P> \| VisitNodeObject<S, P>;
09:06:45.232
```
Upgrading to TypeScript 4 fixes the issue.
---------
Co-authored-by: Trek Glowacki <trek.glowacki@vercel.com>
update ionic/angular to latest v7. Needed to add and `overrides` entry.
Some packages just specify angular >= 14 and this bumps us to angular
17, which we're not ready for yet.
Undoes #10980 (mostly). This appears to be some kind of caching issue. Works locally until you run `eslint` without `--cache` and then it will reproduce. Hopefully this is the last time and we're not playing whack-a-mole with these pragmas every day?
Say you have a middleware (`middleware.js`) that looks like this:
```js
export async default function middleware(req, ctx) {
ctx.waitUntil(tooLongFunction())
}
async function tooLongFunction() {
console.log('tooLongFunction started')
await new Promise((resolve) => setTimeout(resolve, 10000))
console.log('tooLongFunction finished')
}
```
When you run this middleware locally with `vercel dev`, you won't see the `tooLongFunction finished` message because the server process is killed right after finishing the response. While Edge Runtime's `server.close()`, which awaits all `waitUntil` promises, is called, but `exit-hook`'s callback in CLI doesn't wait for the `close` promise to resolve.
This PR fixes this by allowing an optional graceful shutdown callback instead of killing the process immediately.
Previously routes that did not have a `dataRoute` key in the `prerender-manifest.json` would be treated as an App Route. The logic has been updated (for partial prerendering support) to also consider the new `prefetchDataRoute`. Entries with either of these keys are treated as an App Page instead of an App Route.
This also addressed the scenerio where a app route (`route.ts`) with a dynamic segment (`/api/[slug]/route.ts`) which doesn't emit a `.body` during build doesn't cause the build to fail by checking for the file first.
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.
# Releases
## vercel@33.0.0
### Major Changes
- [cli] replace `--deprecated` with `--update-required` in `vc project
ls` ([#10965](https://github.com/vercel/vercel/pull/10965))
### Patch Changes
- Fix `vercel bisect` selecting too many deployments
([#10956](https://github.com/vercel/vercel/pull/10956))
- Updated dependencies
\[[`6a9002f22`](6a9002f229),
[`4d63d9e95`](4d63d9e954)]:
- @vercel/remix-builder@2.0.15
- @vercel/build-utils@7.4.0
- @vercel/static-build@2.0.15
- @vercel/node@3.0.13
## @vercel/build-utils@7.4.0
### Minor Changes
- Adds new helper `getPathForPackageManager()`
([#10918](https://github.com/vercel/vercel/pull/10918))
## @vercel/client@13.0.11
### Patch Changes
- Updated dependencies
\[[`4d63d9e95`](4d63d9e954)]:
- @vercel/build-utils@7.4.0
## @vercel/gatsby-plugin-vercel-builder@2.0.13
### Patch Changes
- Add support for "rewrites"
([#10954](https://github.com/vercel/vercel/pull/10954))
- Updated dependencies
\[[`4d63d9e95`](4d63d9e954)]:
- @vercel/build-utils@7.4.0
## @vercel/node@3.0.13
### Patch Changes
- Updated dependencies
\[[`4d63d9e95`](4d63d9e954)]:
- @vercel/build-utils@7.4.0
## @vercel/remix-builder@2.0.15
### Patch Changes
- Update `@remix-run/dev` fork to v2.4.0
([#10943](https://github.com/vercel/vercel/pull/10943))
## @vercel/static-build@2.0.15
### Patch Changes
- Updated dependencies
\[[`652a31275`](652a312753)]:
- @vercel/gatsby-plugin-vercel-builder@2.0.13
## @vercel-internals/types@1.0.18
### Patch Changes
- Updated dependencies
\[[`4d63d9e95`](4d63d9e954)]:
- @vercel/build-utils@7.4.0
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
To use this outside of CLI we want a way to suppress the `console.log`s in `getEnvForPackageManager`.
For achieving this, we introduce a new helper `getPathForPackageManager()` which contains the core logic.
Best to review commit by commit + hide whitespace.
**X-Ref**
- [Internal Context](https://vercel.slack.com/archives/C03F2CMNGKG/p1701970097725689)
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.
# Releases
## vercel@32.7.1
### Patch Changes
- [cli] double page limit for vc project ls --deprecated
([#10932](https://github.com/vercel/vercel/pull/10932))
- Updated dependencies
\[[`d09dd1794`](d09dd1794b)]:
- @vercel/remix-builder@2.0.14
## @vercel/remix-builder@2.0.14
### Patch Changes
- Reinstall dependencies during `prepareCache()`
([#10922](https://github.com/vercel/vercel/pull/10922))
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
As titled. Increases api page size for `vc project ls` when
`--deprecated` is used.
This is a temporary workaround since we do the filtering "client-side".
We will eventually update the API itself to support this and then we can
remove the client-based filter and reduce the page limit back to the
ideal `20`.
---------
Co-authored-by: Sean Massa <EndangeredMassa@gmail.com>
https://github.com/vercel/vercel/pull/10819 introduced a bug causing the `prepareCache()` function to fail (due to `@remix-run/dev` no longer being require-able). Even if it were not failing, the deps installed are not a valid representation of the user's `package.json` / lockfile. So to have more truthful cache contents, run `npm install` once again during `prepareCache()` to fix both issues at the same time.
It seems the intention of this test was to verify that the rewritten
file matches the original file, but it does so by just asserting on
arbitrary script text, which is brittle and broke as a result of
https://github.com/vercel/next.js/pull/56294
The right way to test this would be to fetch the original script and
compare the contents with the rewritten script, but this relies on
`__NEXT_SCRIPT__` magic which is only available in probe checks. For now
this just asserts on a valid status code, as a chunk that isn't properly
rewritten should 404 in this case.
Adds a `--deprecated` option to the `vc project ls` command that will only show projects currently running on a soon-to-be-deprecated Node.js version.
It also adds additional output providing more information to the user about what versions and a link to our documentation so they can learn more.
Example:
<img width="836" alt="Screenshot 2023-12-07 at 15 01 22" src="https://github.com/vercel/vercel/assets/16144158/3b7f7b13-802e-4af1-a76e-a158a477beb4">