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: implemented Remix server adapter and runtime for Netlify #16

Merged
merged 43 commits into from
Feb 8, 2023
Merged
Changes from 1 commit
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
e141d98
feat: implemented Remix server adapter and runtime for Netlify
nickytonline Jan 26, 2023
8e56897
chore: added the demo edge site to test the Netlify remix server adapter
nickytonline Jan 27, 2023
79bb70d
chore: added default remix config for the Netlify adapter
nickytonline Jan 27, 2023
379fcf9
chore: remove extension from import
nickytonline Jan 27, 2023
c5b3b36
chore: added some more defaults to the default remix config
nickytonline Jan 27, 2023
2faaffa
Update packages/remix-server-adapter/src/globals.ts
nickytonline Jan 27, 2023
4bc07ea
chore: renamed '@netlify/remix-server-adapter to @netlify/remix-adapter
nickytonline Jan 27, 2023
569bc20
chore: fixed globals
nickytonline Jan 27, 2023
959a30b
chore: forgot to commit updated package lock
nickytonline Jan 27, 2023
a58e06e
chore: configured project to deploy edge demo site
nickytonline Jan 27, 2023
853ac97
chore: renamed remix-server-runtime to remix-runtime
nickytonline Jan 30, 2023
cb6cdee
chore: renamed remix-adapter to remix-edge-adapter
nickytonline Jan 30, 2023
21d9bf8
Merge remote-tracking branch 'origin/main' into nickytonline/add-adap…
nickytonline Jan 30, 2023
8b3cd57
Merge remote-tracking branch 'origin/main' into nickytonline/adapter-…
nickytonline Jan 31, 2023
84fdc49
Merge remote-tracking branch 'origin/main' into nickytonline/adapter-…
nickytonline Feb 3, 2023
aaaff6f
chore: fixed lint errors
nickytonline Feb 3, 2023
7b03c6c
chore: automatic prettier formatting
nickytonline Feb 3, 2023
1007d4d
chore: avoid husky in CI
nickytonline Feb 3, 2023
a0038db
chore: avoid husky in CI (again)
nickytonline Feb 3, 2023
f570e9c
Merge remote-tracking branch 'origin/main' into nickytonline/add-adap…
nickytonline Feb 3, 2023
9974faa
test: added E2E tests
nickytonline Feb 6, 2023
7b0970a
chore: react 18 hydration errors in Cypress handled now
nickytonline Feb 6, 2023
360b94b
chore: clarified a comment
nickytonline Feb 6, 2023
6f258da
chore: added GH workflow for Cypress
nickytonline Feb 6, 2023
e0b4e65
chore: trying an if-env fix again
nickytonline Feb 6, 2023
3b2e8cc
Merge remote-tracking branch 'origin/main' into nickytonline/add-adap…
nickytonline Feb 6, 2023
e9927b0
chore: fixed build setup for git push deploy
nickytonline Feb 7, 2023
4333b20
chore: fixed edge functions path
nickytonline Feb 7, 2023
f788018
chore: fixed a typo in Cypress YAML config 🙃
nickytonline Feb 7, 2023
c443950
chore: added ReadME for @netlify/remix-runtime
nickytonline Feb 7, 2023
0c15673
chore: added ReadME for @netlify/remix-edge-adapter
nickytonline Feb 7, 2023
ce64771
chore: updated ReadME for edge demo site
nickytonline Feb 7, 2023
af313d0
chore: first attempt at project README
nickytonline Feb 7, 2023
67fe4d4
chore: changed script names from compile to build
nickytonline Feb 7, 2023
cfb4cbd
chore: added the build:watch script
nickytonline Feb 7, 2023
8676091
chore: set Cypress containers to 1 as we only spec file atm
nickytonline Feb 8, 2023
9ce4b79
chore: added a comment about the demo site's server build path
nickytonline Feb 8, 2023
27c4b51
Update README.md
nickytonline Feb 8, 2023
cd4d261
chore: corrected Netlify Edge functions links and referenced the prod…
nickytonline Feb 8, 2023
daafe3f
chore: set cache-control to 60 seconds for the demo site
nickytonline Feb 8, 2023
f616d4f
chore: added the x-nf-runtime header to responses returned from our r…
nickytonline Feb 8, 2023
993a262
chore: corrected what the product is called
nickytonline Feb 8, 2023
6ed4e65
Update packages/edge-demo-site/README.md
nickytonline Feb 8, 2023
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
4 changes: 4 additions & 0 deletions packages/remix-edge-adapter/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ export function createRequestHandler({
const loadContext = (await getLoadContext?.(request, context)) || context

const response = await remixHandler(request, loadContext)

// A useful header for debugging
response.headers.set('x-nf-runtime', 'Edge')
Copy link
Contributor Author

@nickytonline nickytonline Feb 8, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed in #16 (comment) @ascorbic, we now have the x-nf-runtime header.

CleanShot 2023-02-08 at 09 04 15


if (response.status === 404) {
// Check if there is a matching static file
const originResponse = await context.next({
Expand Down