-
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.
Merge pull request #646 from Shopify/liz/fix-deploys-on-vercel
Fix deploys to Vercel
- Loading branch information
Showing
13 changed files
with
278 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
"@shopify/shopify-app-remix": minor | ||
--- | ||
|
||
Introduce Vercel adapter to fix deploys to Vercel. | ||
|
||
Since v.9.0.0 of `@shopify/shopify-api` developers deploying their Remix apps to Vercel have encountered errors. | ||
|
||
Developers looking to deploy their application to Vercel should replace references to import `"@shopify/shopify-app-remix/adapters/node";` with `"@shopify/shopify-app-remix/adapters/vercel";` to properly load the required global variables. |
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.