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

feat(remix-netlify)!: remove Netlify adapter #7058

Merged
merged 1 commit into from
Aug 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions .changeset/brown-gifts-chew.md

This file was deleted.

1 change: 0 additions & 1 deletion .changeset/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
"@remix-run/dev",
"@remix-run/eslint-config",
"@remix-run/express",
"@remix-run/netlify",
"@remix-run/node",
"@remix-run/react",
"@remix-run/serve",
Expand Down
1 change: 0 additions & 1 deletion .changeset/purple-zoos-refuse.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
"@remix-run/deno": major
"@remix-run/dev": major
"@remix-run/express": major
"@remix-run/netlify": major
"@remix-run/node": major
"@remix-run/react": major
"@remix-run/serve": major
Expand Down
17 changes: 17 additions & 0 deletions .changeset/strong-rice-applaud.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
"@remix-run/netlify": major
---

The `@remix-run/netlify` runtime adapter has removed in favor of [`@netlify/remix-adapter`][official-netlify-adapter]
& [`@netlify/remix-edge-adapter`][official-netlify-edge-adapter]. Please update your code by changing all
`@remix-run/netlify` imports to `@netlify/remix-adapter`.
Keep in mind that `@netlify/remix-adapter` requires `@netlify/functions@^1.0.0`, which is a breaking change compared
to the previous supported `@netlify/functions` versions in `@remix-run/netlify`.

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

[official-netlify-adapter]: https://github.com/netlify/remix-compute/tree/main/packages/remix-adapter
[official-netlify-edge-adapter]: https://github.com/netlify/remix-compute/tree/main/packages/remix-edge-adapter
[netlify-template]: https://github.com/remix-run/remix/tree/main/templates/netlify
[official-netlify-template]: https://github.com/netlify/remix-template
1 change: 0 additions & 1 deletion .changeset/v2-remove-auto-globals-install.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
"@remix-run/architect": major
"@remix-run/express": major
"@remix-run/netlify": major
"@remix-run/node": major
"@remix-run/serve": major
---
Expand Down
37 changes: 0 additions & 37 deletions .github/workflows/deployments.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ on:
required: true
TEST_FLY_TOKEN:
required: true
TEST_NETLIFY_TOKEN:
required: true

jobs:
arc_deploy:
Expand Down Expand Up @@ -218,38 +216,3 @@ jobs:
working-directory: ./scripts/deployment-test
env:
FLY_API_TOKEN: ${{ secrets.TEST_FLY_TOKEN }}

netlify_deploy:
name: "Netlify 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 Netlify
run: node ./netlify.mjs
working-directory: ./scripts/deployment-test
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.TEST_NETLIFY_TOKEN }}
1 change: 0 additions & 1 deletion .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ jobs:
TEST_CF_API_TOKEN: ${{ secrets.TEST_CF_API_TOKEN }}
TEST_DENO_DEPLOY_TOKEN: ${{ secrets.TEST_DENO_DEPLOY_TOKEN }}
TEST_FLY_TOKEN: ${{ secrets.TEST_FLY_TOKEN }}
TEST_NETLIFY_TOKEN: ${{ secrets.TEST_NETLIFY_TOKEN }}

stacks:
needs: [nightly]
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ jobs:
TEST_CF_API_TOKEN: ${{ secrets.TEST_CF_API_TOKEN }}
TEST_DENO_DEPLOY_TOKEN: ${{ secrets.TEST_DENO_DEPLOY_TOKEN }}
TEST_FLY_TOKEN: ${{ secrets.TEST_FLY_TOKEN }}
TEST_NETLIFY_TOKEN: ${{ secrets.TEST_NETLIFY_TOKEN }}

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 @@ -228,7 +228,6 @@ There are a few conventions that Remix uses you should be aware of.
[cloudflare-pages]: https://pages.cloudflare.com
[cloudflare-workers]: https://workers.cloudflare.com
[deno]: https://deno.land
[netlify]: https://www.netlify.com
[node-cjs]: https://nodejs.org/en
[dilum-sanjaya]: https://twitter.com/DilumSanjaya
[an-awesome-visualization]: https://remix-routing-demo.netlify.app
Expand Down
43 changes: 6 additions & 37 deletions docs/other-api/adapter.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@ Idiomatic Remix apps can generally be deployed anywhere because Remix adapts the
- `@remix-run/cloudflare-pages`
- `@remix-run/cloudflare-workers`
- `@remix-run/express`
- `@remix-run/netlify`

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

If you initialized your app with `npx create-remix@latest` with something other than the built-in Remix App Server, you will note a `server/index.js` file that imports and uses one of these adapters.

Expand All @@ -28,6 +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 old bare bones Node server.
- [`@netlify/remix-adapter`][netlify-remix-adapter] - For [Netlify][netlify].
- [`@netlify/remix-edge-adapter`][netlify-remix-edge-adapter] - For [Netlify][netlify] Edge.
- [`@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.

Expand Down Expand Up @@ -83,41 +84,6 @@ exports.handler = createRequestHandler({
});
```

Here's an example with Netlify:

```ts
const path = require("node:path");

const {
createRequestHandler,
} = require("@remix-run/netlify");

const BUILD_DIR = path.join(process.cwd(), "netlify");

function purgeRequireCache() {
// purge require cache on requests for "server side HMR" this won't let
// you have in-memory objects between requests in development,
// netlify typically does this for you, but we've found it to be hit or
// miss and some times requires you to refresh the page after it auto reloads
// or even have to restart your server
for (const key in require.cache) {
if (key.startsWith(BUILD_DIR)) {
delete require.cache[key];
}
}
}

exports.handler =
process.env.NODE_ENV === "production"
? createRequestHandler({ build: require("./build") })
: (event, context) => {
purgeRequireCache();
return createRequestHandler({
build: require("./build"),
})(event, context);
};
```

Here's an example with the simplified Cloudflare Workers API:

```ts
Expand Down Expand Up @@ -178,5 +144,8 @@ 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
[netlify-remix-adapter]: https://github.com/netlify/remix-compute/tree/main/packages/remix-adapter
[netlify-remix-edge-adapter]: https://github.com/netlify/remix-compute/tree/main/packages/remix-edge-adapter
[netlify]: https://netlify.com
[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, 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, 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 @@ -665,20 +665,6 @@ module.exports = {
};
```

#### `netlify`

```js filename=remix.config.js
/** @type {import('@remix-run/dev').AppConfig} */
module.exports = {
publicPath: "/build/", // default value, can be removed
serverBuildPath: ".netlify/functions-internal/server.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
};
```

#### `node-cjs`

```js filename=remix.config.js
Expand Down
1 change: 0 additions & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ module.exports = {
"packages/remix-dev",
"packages/remix-eslint-config",
"packages/remix-express",
"packages/remix-netlify",
"packages/remix-node",
"packages/remix-react",
"packages/remix-serve",
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
"packages/remix-dev",
"packages/remix-eslint-config",
"packages/remix-express",
"packages/remix-netlify",
"packages/remix-node",
"packages/remix-react",
"packages/remix-serve",
Expand Down
Loading
Loading