Skip to content

[DO NOT MERGE] Sync with upstream #34

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

Draft
wants to merge 62 commits into
base: main-js
Choose a base branch
from
Draft

[DO NOT MERGE] Sync with upstream #34

wants to merge 62 commits into from

Conversation

m-ocana
Copy link

@m-ocana m-ocana commented Mar 14, 2024

This is based off of Shopify#58
Just an attempt to resolve the merges separately for better visibility before pushing the final changes to the javascript branch.

lizkenyon and others added 30 commits January 15, 2024 19:56
…ve-graphqlrc

Update the transpile job to remove the graphqlrc.ts
…0.0.4

chore: bump @shopify/app-bridge-types to 0.0.4 for Modal types
…hopify/app-bridge-types-0.0.5

Bump @shopify/app-bridge-types from 0.0.3 to 0.0.5
Stop using prettier-plugin in CI JS conversion
…graphqlrc

[docs] Fix 404 link of graphqlrc.ts
[Versioned app config] Remove config push CLI command from scripts and README
…hopify/app-bridge-types-0.0.6

Bump @shopify/app-bridge-types from 0.0.5 to 0.0.6
paulomarg and others added 26 commits February 21, 2024 11:20
Move vite-tsconfig-paths to dependencies
…hopify/app-bridge-types-0.0.7

Bump @shopify/app-bridge-types from 0.0.6 to 0.0.7
Comment on lines +143 to +145
1. Setting up your Shopify app in [/app/shopify.server.ts](https://github.com/Shopify/shopify-app-template-remix/blob/main/app/shopify.server.ts)
2. Querying data using Graphql. Please see: [/app/routes/app.\_index.tsx](https://github.com/Shopify/shopify-app-template-remix/blob/main/app/routes/app._index.tsx).
3. Responding to mandatory webhooks in [/app/routes/webhooks.tsx](https://github.com/Shopify/shopify-app-template-remix/blob/main/app/routes/webhooks.tsx)
Copy link
Author

@m-ocana m-ocana Mar 15, 2024

Choose a reason for hiding this comment

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

Should probably replace with js|jsx

Choose a reason for hiding this comment

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

You should change the upstream to the javascript branch in the template, the main branch is now running on TS.

Comment on lines +56 to +60
resolve: {
alias: {
'~': path.resolve(__dirname, './app')
}
}
Copy link
Author

Choose a reason for hiding this comment

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

Resolves import issues found initially:

[vite] Error when evaluating SSR module /app/routes/app.dashboard_simulator.$paymentId.jsx: failed to import "~/payments.repository"
09:55:01 │ remix      │ |- Error: Cannot find module '~/payments.repository'

Choose a reason for hiding this comment

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

This is a great callout - we could consider adding that to the template as it makes things easier for everyone!

Comment on lines +35 to +36
v3_webhookAdminContext: true,
v3_authenticatePublic: true,
Copy link
Author

Choose a reason for hiding this comment

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

Unsure on whether v3_webhookAdminContext and v3_authenticatePublic should be set or not. I think they might have been removed from main-js previously.

Copy link

@paulomarg paulomarg Mar 15, 2024

Choose a reason for hiding this comment

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

These flags only affect their authenticate.* counterparts. If you're not using those you shouldn't see any difference. They're still there though.

I'd suggest copying the settings from the template here.

Comment on lines +252 to +284
### My webhook subscriptions aren't being updated

This template registers webhooks after OAuth completes, using the `afterAuth` hook when calling `shopifyApp`.
The package calls that hook in 2 scenarios:
- After installing the app
- When an access token expires

During normal development, the app won't need to re-authenticate most of the time, so the subscriptions aren't updated.

To force your app to update the subscriptions, you can uninstall and reinstall it in your development store.
That will force the OAuth process and call the `afterAuth` hook.

### Admin created webhook failing HMAC validation

Webhooks subscriptions created in the [Shopify admin](https://help.shopify.com/en/manual/orders/notifications/webhooks) will fail HMAC validation. This is because the webhook payload is not signed with your app's secret key.

Create [webhook subscriptions]((https://shopify.dev/docs/api/shopify-app-remix/v1/guide-webhooks)) using the `shopifyApp` object instead.

Test your webhooks with the [Shopify CLI](https://shopify.dev/docs/apps/tools/cli/commands#webhook-trigger) or by triggering events manually in the Shopify admin(e.g. Updating the product title to trigger a `PRODUCTS_UPDATE`).

### Incorrect GraphQL Hints

By default the [graphql.vscode-graphql](https://marketplace.visualstudio.com/items?itemName=GraphQL.vscode-graphql) extension for VS Code will assume that GraphQL queries or mutations are for the [Shopify Admin API](https://shopify.dev/docs/api/admin). This is a sensible default, but it may not be true if:

1. You use another Shopify API such as the storefront API.
2. You use a third party GraphQL API.

in this situation, please update the [.graphqlrc.ts](https://github.com/Shopify/shopify-app-template-remix/blob/main/.graphqlrc.ts) config.

### First parameter has member 'readable' that is not a ReadableStream.

See [hosting on Vercel](#hosting-on-vercel).

Copy link
Author

Choose a reason for hiding this comment

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

These sections might have been removed from the main branch prior to the merge. Should they be deleted?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants