-
Notifications
You must be signed in to change notification settings - Fork 27
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!: update to Remix 2 #128
Conversation
✅ Deploy Preview for remix-edge-on ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
@@ -2,6 +2,11 @@ | |||
command = "npm run build" | |||
publish = "public" | |||
|
|||
[dev] | |||
command = "npm run dev" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We no longer run a dev command - ntl is spawned by remix
✅ Deploy Preview for remix-on ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
app/entry.client.tsx
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the new default in Remix
status: responseStatusCode, | ||
}); | ||
} | ||
export { handleRequest as default } from "@netlify/remix-adapter"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We now define the handler in the adapter, so this is all that's needed!
netlify dev | ||
npm run dev |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We use the new v2 dev mode, which allows remiox dev to run a custom server, which in our case is ntl dev
. For that reason we dont want them running it themselves
const foldersToExclude = [".github", ".git"]; | ||
const foldersToExclude = [".github"]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The .git
dir is created by Remix, and is this site's initial commit
@@ -116,6 +125,7 @@ async function main({ rootDirectory }) { | |||
rootDirectory, | |||
}); | |||
await updatePackageJsonForFunctions(rootDirectory); | |||
await installAdditionalDependencies({ rootDirectory, packageManager }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both runtimes need an extra install step
const handler = createRequestHandler({ | ||
build, | ||
mode: process.env.NODE_ENV, | ||
}); | ||
|
||
export default handler; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't recognise it as a v2 function if we export it directly, so we assign to a var and export that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! 🚢
Description
Updates the templates for Remix 2. This includes:
entry.server.ts
with a re-export from the adapters