-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
templates(netlify): improve DX for Netlify serverless template #3754
templates(netlify): improve DX for Netlify serverless template #3754
Conversation
|
Hi @nickytonline, Welcome, and thank you for contributing to Remix! Before we consider your pull request, we ask that you sign our Contributor License Agreement (CLA). We require this only once. You may review the CLA and sign it by adding your name to contributors.yml. Once the CLA is signed, the If you have already signed the CLA and received this response in error, or if you have any questions, please contact us at hello@remix.run. Thanks! - The Remix team |
Thank you for signing the Contributor License Agreement. Let's get this merged! 🥳 |
Before this gets merged, I'd like to have at least one of my team members approve it, so for the moment, I will put it back in draft. |
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.
Thanks for tagging me, @nickytonline! Although I personally find "serverless server" hilarious, I'm not sure we want to use it in the docs.
Let me know if you have questions!
Co-authored-by: Kyle Rollins <kyleblankrollins@gmail.com>
Co-authored-by: Kyle Rollins <kyleblankrollins@gmail.com>
Co-authored-by: Kyle Rollins <kyleblankrollins@gmail.com>
@@ -1,7 +1,10 @@ | |||
/** @type {import('@remix-run/dev').AppConfig} */ | |||
module.exports = { | |||
serverBuildTarget: "netlify", | |||
server: "./server.js", | |||
server: |
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 check is to ensure we do not start the Netlify function to run the Remix app server when running npm run dev
, i.e. remix dev
as you can't run a custom server via remix dev
. Without this check, if you run remix dev
it will error out with the following message:
Error: remix dev is not supported for custom servers.
at Object.dev (/Users/some_user/dev/issues/remix-tailwind/node_modules/@remix-run/dev/cli/commands.js:260:11)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at Object.run (/Users/some_user/dev/issues/remix-tailwind/node_modules/@remix-run/dev/cli/run.js:499:7)
ERROR: "dev:remix" exited with 1.
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.
Thank you!
…-run#3754) * chore: improve DX for Netlify serverless template * added myself as a contributor to Remix * chore: updated some documentation * changed conditional check for generating Remix config * Update templates/netlify/README.md Co-authored-by: Kyle Rollins <kyleblankrollins@gmail.com> * Update templates/netlify/README.md Co-authored-by: Kyle Rollins <kyleblankrollins@gmail.com> * Update templates/netlify/README.md Co-authored-by: Kyle Rollins <kyleblankrollins@gmail.com> * chore: added a link to Netlify Functions in the Netlify README * updated deployment commands Co-authored-by: Kyle Rollins <kyleblankrollins@gmail.com>
matching the default netlify template remix-run/remix#3754 https://github.com/remix-run/remix/tree/main/templates/netlify
@nickytonline I was wondering if this was released? I still see something similar in |
@devraj, the home for the Netlify templates can now be found in this Remix stack, https://github.com/netlify/remix-template. The CLI still points to the one that only supports the Netlify Functions template. Kent or others, I know long term, folks are encouraged to build their templates outside of the repo, but given that Netlify is still an option in the CLI like Vercel, Deno etc., could we point to the https://github.com/netlify/remix-template Stack instead when someone selects Netlify? Happy to create a PR for this. |
@nickytonline Your best course of action here is to create a new proposal in the discussions tab 🙏🏼 |
I agree. If that repo is what is kept up to date, then it would save everyone deploying to Netlify a lot of time. Appreciate you taking the time to post a response.. |
This PR improves the DX when using the Netlify template to build out your Remix application. cc: @ascorbic. I've based this PR off of
main
because I believe @mcansh mentioned that if it's just template changes, there's no need to branch off of thedev
branch.Closes: #3753
Testing Strategy:
npm run dev
netlify dev
. The server running on Netlify functions locally starts and renders the main page when navigating to http://localhost:3000.netlify deploy --build
. If you're application isn't configured to deploy yet, ensure you've followed the steps in the README first to get your app configured to deploy to Netlify.