-
Notifications
You must be signed in to change notification settings - Fork 124
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Deploys to vercel were broken because it was not loading the appropriate global variables To fix this we created an adapter that explicitly loads them. Developers looking to deploy to vercel should use that adapter in place of node.
- Loading branch information
Showing
12 changed files
with
269 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 0 additions & 3 deletions
3
packages/shopify-app-remix/src/server/__test-helpers/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
packages/shopify-app-remix/src/server/adapters/node/__tests__/setup-jest.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import fetchMock from 'jest-fetch-mock'; | ||
import '@shopify/shopify-api/adapters/web-api'; | ||
import '..'; | ||
|
||
// Globally disable fetch requests so we don't risk making real ones | ||
fetchMock.enableMocks(); | ||
|
||
beforeEach(() => { | ||
fetchMock.mockReset(); | ||
}); |
12 changes: 12 additions & 0 deletions
12
packages/shopify-app-remix/src/server/adapters/vercel/__tests__/setup-jest.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import fetchMock from 'jest-fetch-mock'; | ||
import '@shopify/shopify-api/adapters/web-api'; | ||
import '..'; | ||
import {setAbstractFetchFunc} from '@shopify/shopify-api/runtime'; | ||
|
||
// Globally disable fetch requests so we don't risk making real ones | ||
fetchMock.enableMocks(); | ||
|
||
beforeEach(() => { | ||
fetchMock.mockReset(); | ||
}); | ||
setAbstractFetchFunc(fetch); |
13 changes: 13 additions & 0 deletions
13
packages/shopify-app-remix/src/server/adapters/vercel/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import {setAbstractFetchFunc} from '@shopify/shopify-api/runtime'; | ||
import {installGlobals} from '@remix-run/node'; | ||
|
||
import '../node'; | ||
|
||
installGlobals(); | ||
|
||
const fetchFunc = fetch; | ||
setAbstractFetchFunc(async (...args) => { | ||
const response = await fetchFunc.apply(this, args); | ||
|
||
return response; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.