Skip to content

Commit

Permalink
feat(remix-vercel)!: remove Vercel adapter
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelDeBoey committed Aug 3, 2023
1 parent a7fd80c commit d5bbe0f
Show file tree
Hide file tree
Showing 31 changed files with 28 additions and 1,371 deletions.
5 changes: 0 additions & 5 deletions .changeset/big-papayas-jam.md

This file was deleted.

3 changes: 1 addition & 2 deletions .changeset/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@
"@remix-run/react",
"@remix-run/serve",
"@remix-run/server-runtime",
"@remix-run/testing",
"@remix-run/vercel"
"@remix-run/testing"
]
],
"linked": [],
Expand Down
13 changes: 13 additions & 0 deletions .changeset/fair-falcons-wink.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
"@remix-run/vercel": major
---

The `@remix-run/vercel` runtime adapter has been removed in favor of out of the box Vercel functionality. Please update
your code by removing `@remix-run/vercel` & `@vercel/node` from your `package.json`, removing your
`server.ts`/`server.js` file, and removing the `server` & `serverBuildPath` options from your `remix.config.js`.

Due to the removal of this adapter, we also removed our [Vercel template][vercel-template] in favor of the
[official Vercel template][official-vercel-template].

[vercel-template]: https://github.com/remix-run/remix/tree/main/templates/vercel
[official-vercel-template]: https://github.com/vercel/vercel/tree/main/examples/remix
1 change: 0 additions & 1 deletion .changeset/purple-zoos-refuse.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
"@remix-run/serve": major
"@remix-run/server-runtime": major
"@remix-run/testing": major
"@remix-run/vercel": major
---

Require Node >=18.0.0
1 change: 0 additions & 1 deletion .changeset/v2-remove-auto-globals-install.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"@remix-run/netlify": major
"@remix-run/node": major
"@remix-run/serve": major
"@remix-run/vercel": major
---

For preparation of using Node's built in fetch implementation, installing the fetch globals is now a responsibility of the app server. If you are using `remix-serve`, nothing is required. If you are using your own app server, you will need to install the globals yourself.
Expand Down
40 changes: 0 additions & 40 deletions .github/workflows/deployments.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@ on:
required: true
TEST_NETLIFY_TOKEN:
required: true
TEST_VERCEL_TOKEN:
required: true
TEST_VERCEL_USER_ID:
required: true

jobs:
arc_deploy:
Expand Down Expand Up @@ -257,39 +253,3 @@ jobs:
working-directory: ./scripts/deployment-test
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.TEST_NETLIFY_TOKEN }}

vercel_deploy:
name: "Vercel Deploy"
if: github.repository == 'remix-run/remix'
runs-on: ubuntu-latest
steps:
- name: 🛑 Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.11.0

- name: ⬇️ Checkout repo
uses: actions/checkout@v3

- name: ⎔ Setup node
uses: actions/setup-node@v3
with:
node-version-file: ".nvmrc"
cache: npm
cache-dependency-path: ./scripts/deployment-test/package.json # no lockfile, key caching off package.json

# some deployment targets require the latest version of npm
# TODO: remove this eventually when the default version we get
# is "latest" enough.
- name: 📦 Install latest version of npm
run: npm install -g npm@latest
working-directory: ./scripts/deployment-test

- name: 📥 Install deployment-test deps
run: npm install
working-directory: ./scripts/deployment-test

- name: 🚀 Deploy to Vercel
run: node ./vercel.mjs
working-directory: ./scripts/deployment-test
env:
VERCEL_TOKEN: ${{ secrets.TEST_VERCEL_TOKEN }}
VERCEL_ORG_ID: ${{ secrets.TEST_VERCEL_USER_ID }}
2 changes: 0 additions & 2 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,6 @@ jobs:
TEST_DENO_DEPLOY_TOKEN: ${{ secrets.TEST_DENO_DEPLOY_TOKEN }}
TEST_FLY_TOKEN: ${{ secrets.TEST_FLY_TOKEN }}
TEST_NETLIFY_TOKEN: ${{ secrets.TEST_NETLIFY_TOKEN }}
TEST_VERCEL_TOKEN: ${{ secrets.TEST_VERCEL_TOKEN }}
TEST_VERCEL_USER_ID: ${{ secrets.TEST_VERCEL_USER_ID }}

stacks:
needs: [nightly]
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,6 @@ jobs:
TEST_DENO_DEPLOY_TOKEN: ${{ secrets.TEST_DENO_DEPLOY_TOKEN }}
TEST_FLY_TOKEN: ${{ secrets.TEST_FLY_TOKEN }}
TEST_NETLIFY_TOKEN: ${{ secrets.TEST_NETLIFY_TOKEN }}
TEST_VERCEL_TOKEN: ${{ secrets.TEST_VERCEL_TOKEN }}
TEST_VERCEL_USER_ID: ${{ secrets.TEST_VERCEL_USER_ID }}

stacks:
name: 🥞 Remix Stacks Test
Expand Down
1 change: 0 additions & 1 deletion docs/file-conventions/remix-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,6 @@ There are a few conventions that Remix uses you should be aware of.
[deno]: https://deno.land
[netlify]: https://www.netlify.com
[node-cjs]: https://nodejs.org/en
[vercel]: https://vercel.com
[dilum-sanjaya]: https://twitter.com/DilumSanjaya
[an-awesome-visualization]: https://remix-routing-demo.netlify.app
[remix-dev]: ../other-api/dev#remix-dev
Expand Down
17 changes: 4 additions & 13 deletions docs/other-api/adapter.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ Idiomatic Remix apps can generally be deployed anywhere because Remix adapts the
- `@remix-run/cloudflare-workers`
- `@remix-run/express`
- `@remix-run/netlify`
- `@remix-run/vercel`

These adapters are imported into your server's entry and are not used inside of your Remix app itself.

Expand All @@ -28,7 +27,8 @@ Each adapter has the same API. In the future we may have helpers specific to the

- [`@fastly/remix-server-adapter`][fastly-remix-server-adapter] - For [Fastly Compute@Edge][fastly-compute-at-edge].
- [`@mcansh/remix-fastify`][remix-fastify] - For [Fastify][fastify].
- [`@mcansh/remix-raw-http`][remix-raw-http] - For a good ol barebones Node server.
- [`@mcansh/remix-raw-http`][remix-raw-http] - For a good old bare bones Node server.
- [`@vercel/remix`][vercel-remix] - For [Vercel][vercel].
- [`remix-google-cloud-functions`][remix-google-cloud-functions] - For [Google Cloud][google-cloud-functions] and [Firebase][firebase-functions] functions.

## Creating an Adapter
Expand Down Expand Up @@ -83,17 +83,6 @@ exports.handler = createRequestHandler({
});
```

Here's an example with Vercel:

```ts
const {
createRequestHandler,
} = require("@remix-run/vercel");
module.exports = createRequestHandler({
build: require("./build"),
});
```

Here's an example with Netlify:

```ts
Expand Down Expand Up @@ -189,3 +178,5 @@ addEventListener("fetch", (event) => {
[remix-fastify]: https://github.com/mcansh/remix-fastify
[fastify]: https://www.fastify.io
[remix-raw-http]: https://github.com/mcansh/remix-node-http-server
[vercel-remix]: https://github.com/vercel/remix/blob/main/packages/vercel-remix
[vercel]: https://vercel.com
2 changes: 1 addition & 1 deletion docs/pages/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ Nightly releases will run the action files from the `main` branch as scheduled w

## End to end testing

For every release of Remix (stable, experimental, nightly, and pre-releases), we will do a complete end-to-end test of Remix apps on each of our official adapters from `create-remix`, all the way to deploying them to production. We do this by utilizing the default [templates][templates] and the CLIs for Fly, Vercel, Netlify, and Arc. We'll then run some simple Cypress assertions to make sure everything is running properly for both development and the deployed app.
For every release of Remix (stable, experimental, nightly, and pre-releases), we will do a complete end-to-end test of Remix apps on each of our official adapters from `create-remix`, all the way to deploying them to production. We do this by utilizing the default [templates][templates] and the CLIs for Fly, Netlify, and Arc. We'll then run some simple Cypress assertions to make sure everything is running properly for both development and the deployed app.

## Conclusion

Expand Down
14 changes: 0 additions & 14 deletions docs/pages/v2.md
Original file line number Diff line number Diff line change
Expand Up @@ -681,20 +681,6 @@ module.exports = {
};
```

#### `vercel`

```js filename=remix.config.js
/** @type {import('@remix-run/dev').AppConfig} */
module.exports = {
publicPath: "/build/", // default value, can be removed
serverBuildPath: "api/index.js",
serverMainFields: ["main", "module"], // default value, can be removed
serverMinify: false, // default value, can be removed
serverModuleFormat: "cjs", // default value, can be removed
serverPlatform: "node", // default value, can be removed
};
```

## `serverModuleFormat`

The default server module output format will be changing from `cjs` to `esm`.
Expand Down
1 change: 0 additions & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ module.exports = {
"packages/remix-serve",
"packages/remix-server-runtime",
"packages/remix-testing",
"packages/remix-vercel",
],
watchPlugins: [
require.resolve("jest-watch-select-projects"),
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@
"packages/remix-react",
"packages/remix-serve",
"packages/remix-server-runtime",
"packages/remix-testing",
"packages/remix-vercel"
"packages/remix-testing"
],
"scripts": {
"bug-report-test": "yarn test:integration bug-report --project chromium",
Expand Down
Loading

0 comments on commit d5bbe0f

Please sign in to comment.