Giter Club home page Giter Club logo

product-reviews-sample-app's Introduction

Product Reviews Sample App

⚠️ WARNING The application in the repo uses a convention that is no longer the default approach to building a Node.js application on Shopify. Use this repo for the most up-to-date approach for structuring your Node.js Shopify application.

License: MIT

This sample app was built as a reference to show how Shopify Developer tools can be used together to create a fully functional application. The example we chose to showcase is an application that facilitates review creation for products in a Shopify store.

The application is written in Node.js and is comprised of the following elements:

Refer to the architecture diagram below to see how the application's components and Shopify interact with each other.

flowchart
    subgraph Storefront
        ratings[Show reviews on product page]
        feedback[Review form at checkout]
    end

    subgraph Shopify Admin
        ac[Embedded Node.js Application] <--> te[Theme App Extension]
        ac[Embedded Node.js Application] <--> pc[Post-Purchase Checkout Extension]
    end

    subgraph Shopify Platform
        meta[Metafield API]
        products[Product API]
        oauth[OAuth API]
    end

     classDef green fill:#9f6,stroke:#333,stroke-width:2px;
     classDef orange fill:#f96,stroke:#333,stroke-width:2px;
     class te,ratings green
     class feedback,pc orange

Tutorials and Instructions 📖

Instructions are provided to show how to setup and run the various components of this code repo. Click on each one to follow an in-depth tutorial.

Technical Details 💻

To complement the tutorials above, we have documented additional information about how various parts of the application work.

Limitations ❕

When using this code keep in mind:

  1. This is a sample application. It is not production-ready.
  2. Metafields are going to be a bigger part of the platform and will support building applications with more complex data structures.

APIs and Tools Used 🛠️

GraphQL

Shopify APIs have previously been available through REST, but more recently the Admin API was made available through GraphQL. Unlike REST APIs, which use multiple endpoints to return large sets of data, GraphQL uses a single endpoint with fields that can be queried to specify the data you need. This generally improves the speed of your app because it’s not asking for data it doesn’t intend to use.

for more information on the GraphQL Admin API, check out our reference guide.

App Bridge

Shopify App Bridge lets you embed your app directly inside the Shopify Admin. It offers React component wrappers for some actions, and is directly integrated with Polaris components. It offers a consistent experience for merchants, whether it’s on the web or in the Shopify Mobile app for iOS or Android.

for more information on App Bridge, check out our reference guide.

Metafields

Metafields represent custom metadata attached to a resource (for example, a shop or a product). Metafields can be sorted into namespaces and are composed of keys, values, and value types. They can be used as a data layer to create and store a small amount of information relating to Shopify resources.

for more information on Metafields, check out our guide.

Theme App Extensions

Theme app extensions let you extend themes via app blocks. App blocks are liquid files that contain code, a schema and static resource dependencies (CSS, JS). They can be added to existing theme sections or as full-width content on the page. App blocks can also be reordered, removed and configured by merchants directly from the theme editor. Theme app extensions do not modify a theme's code, are served by Shopify, and can be cleanly uninstalled without leaving ghost code behind.

for more information on Theme App Extensions, check out our guide.

Post-Purchase Checkout Extension

Post-purchase checkout extensions give developers and Plus merchants the ability to add post-purchase interactions directly into the Shopify checkout. A post-purchase page displays a customizable UI to a buyer after their order is confirmed, but before the thank you page.

for more information on Post-Purchase Checkout Extensions, check out our guide.

Contributing

For help on setting up the repository locally, building, testing and contributing please see CONTRIBUTING.md.

Code of conduct

All developers who wish to contribute through code or issues, please first read our Code of Conduct.

License

Copyright © 2022 Shopify. See LICENSE for further details.

product-reviews-sample-app's People

Contributors

al-campuzano avatar carlzoo avatar cdagli avatar cursedcoder avatar damienleroux avatar dependabot[bot] avatar dgtlmonk avatar digitallyamar avatar ernest-lian-shopify avatar lizkenyon avatar meganmajewski avatar movermeyer avatar perryraskin avatar stevemar avatar translation-platform avatar translation-platform[bot] avatar veken1199 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

product-reviews-sample-app's Issues

shopify node open

The get started documentation is inconsistent with early shopify cli docs. To install test app, use the following CLI command. Don't understand one would want to go through all that based on https://shopify.dev/apps/getting-started/create.

shopify node open

why two different methods for the same thing that only causes confusions.

Update app to work with Node v17+

Trying to run this application using shopify app serve generates a warning if you're running with Node v17 or newer. See related issue.

┃ Error: Package subpath './lib/parser' is not defined by "exports" in /Users/stevemartinelli/src/github.com/Shopify/product-reviews-sample-app/node_modules/next/node_modules/postcss/package.json
…
(/Users/stevemartinelli/src/github.com/Shopify/product-reviews-sample-app/node_modules/next/dist/compiled/postcss-scss/scss-syntax.js:1:3733) {
┃   code: 'ERR_PACKAGE_PATH_NOT_EXPORTED'
┃ }
┃ 
┃ Node.js v17.5.0
┃ [nodemon] app crashed - waiting for file changes before starting...

While we evaluate the work required to update to the latest Shopify Node library we should do at least the following:

  • Document what version of Node works
  • Use a .node_version file in the repo which is often honored by tools such as nvm

command shopify extension push throwing Tried to load unspecified class: Symbol error

When running shopify extension push and any other command except shopify extension create I get the following error:

Traceback (most recent call last):
        43: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/shopify-cli-2.3.0/bin/shopify:32:in `<main>'
        42: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/shopify-cli-2.3.0/vendor/deps/cli-kit/lib/cli/kit/error_handler.rb:21:in `call'
        41: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/shopify-cli-2.3.0/vendor/deps/cli-kit/lib/cli/kit/error_handler.rb:75:in `handle_abort'
        40: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/shopify-cli-2.3.0/bin/shopify:33:in `block in <main>'
        39: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/shopify-cli-2.3.0/lib/shopify-cli/core/entry_point.rb:17:in `call'
        38: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/shopify-cli-2.3.0/lib/shopify-cli/project_type.rb:34:in `load_all'
        37: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/shopify-cli-2.3.0/lib/shopify-cli/project_type.rb:34:in `map'
        36: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/shopify-cli-2.3.0/lib/shopify-cli/project_type.rb:35:in `block in load_all'
        35: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/shopify-cli-2.3.0/lib/shopify-cli/project_type.rb:27:in `load_type'
        34: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/shopify-cli-2.3.0/lib/shopify-cli/project_type.rb:27:in `load'
        33: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/shopify-cli-2.3.0/lib/project_types/extension/cli.rb:3:in `<top (required)>'
        32: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/shopify-cli-2.3.0/lib/project_types/extension/cli.rb:6:in `<module:Extension>'
        31: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/shopify-cli-2.3.0/lib/project_types/extension/cli.rb:12:in `<class:Project>'
        30: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/shopify-cli-2.3.0/lib/project_types/extension/messages/message_loading.rb:7:in `load'
        29: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/shopify-cli-2.3.0/lib/project_types/extension/messages/message_loading.rb:20:in `load_current_type_messages'
        28: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/shopify-cli-2.3.0/lib/shopify-cli/project.rb:171:in `config'
        27: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/shopify-cli-2.3.0/lib/shopify-cli/project.rb:193:in `load_yaml_file'
        26: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/psych-4.0.0/lib/psych.rb:586:in `safe_load_file'
        25: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/psych-4.0.0/lib/psych.rb:586:in `open'
        24: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/psych-4.0.0/lib/psych.rb:587:in `block in safe_load_file'
        23: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/psych-4.0.0/lib/psych.rb:334:in `safe_load'
        22: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/psych-4.0.0/lib/psych/visitors/to_ruby.rb:35:in `accept'
        21: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/psych-4.0.0/lib/psych/visitors/visitor.rb:6:in `accept'
        20: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/psych-4.0.0/lib/psych/visitors/visitor.rb:30:in `visit'
        19: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/psych-4.0.0/lib/psych/visitors/to_ruby.rb:318:in `visit_Psych_Nodes_Document'
        18: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/psych-4.0.0/lib/psych/visitors/to_ruby.rb:35:in `accept'
        17: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/psych-4.0.0/lib/psych/visitors/visitor.rb:6:in `accept'
        16: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/psych-4.0.0/lib/psych/visitors/visitor.rb:30:in `visit'
        15: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/psych-4.0.0/lib/psych/visitors/to_ruby.rb:167:in `visit_Psych_Nodes_Mapping'
        14: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/psych-4.0.0/lib/psych/visitors/to_ruby.rb:343:in `revive_hash'
        13: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/psych-4.0.0/lib/psych/visitors/to_ruby.rb:343:in `each_slice'
        12: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/psych-4.0.0/lib/psych/visitors/to_ruby.rb:343:in `each'
        11: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/psych-4.0.0/lib/psych/visitors/to_ruby.rb:345:in `block in revive_hash'
        10: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/psych-4.0.0/lib/psych/visitors/to_ruby.rb:35:in `accept'
         9: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/psych-4.0.0/lib/psych/visitors/visitor.rb:6:in `accept'
         8: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/psych-4.0.0/lib/psych/visitors/visitor.rb:30:in `visit'
         7: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/psych-4.0.0/lib/psych/visitors/to_ruby.rb:128:in `visit_Psych_Nodes_Scalar'
         6: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/psych-4.0.0/lib/psych/visitors/to_ruby.rb:65:in `deserialize'
         5: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/psych-4.0.0/lib/psych/scalar_scanner.rb:74:in `tokenize'
         4: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/psych-4.0.0/lib/psych/class_loader.rb:84:in `symbolize'
         3: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/psych-4.0.0/lib/psych/class_loader.rb:32:in `symbolize'
         2: from (eval):2:in `symbol'
         1: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/psych-4.0.0/lib/psych/class_loader.rb:28:in `load'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/psych-4.0.0/lib/psych/class_loader.rb:100:in `find': Tried to load unspecified class: Symbol (Psych::DisallowedClass)

I'm using cli version 2.3 in a Windows system

Reproduction steps:

  1. Run shopify extension create
  2. Select app to register with extension
  3. Select Theme-app-extension as type of extension
  4. After folder is created cd into that folder and run shopify extension push. The above errors occur

[FEATURE] dynamically set embeddedAppHost for different environments

What is the problem you are facing?

In docs/checkout-extension-post-purchase.md it says update embeddedAppHost variables.
I’m using the same set up but the embeddedAppHost url is different for local, staging and production. How can we make it dynamic or use env vars in the checkout extension for this purpose?

Describe the solution you'd like to see

I would like to understand how we can use either .env or some other method such that this value is different for local staging and production. The main reason being I am deploying using github actions.

Anything else?

No response

Post-Purchase Extension

Issue

How are you supposed to run the post-purchase checkout extension locally along with the server. I’ve been trying to use two cli terminals to no avail. One with the checkout extension “Shopify extension serve” and one with the app server “Shopify app serve”. They appear to run locally, but there is no network communication between the two when using the ngrok url.

GraphQL requests return HTTP status code 500

After following the README.md, none of the GraphQL requests return a response; the following error appears in the log:

Error: Failed to parse session token '<token>': jwt not active
┃       at InvalidJwtError.ShopifyError [as constructor] (/home/vango/sourcecode/product-reviews-sample-app/node_modules/@shopify/shopify-api/dist/error.js:13:28)
┃       at new InvalidJwtError (/home/vango/sourcecode/product-reviews-sample-app/node_modules/@shopify/shopify-api/dist/error.js:39:42)
┃       at Object.decodeSessionToken (/home/vango/sourcecode/product-reviews-sample-app/node_modules/@shopify/shopify-api/dist/utils/decode-session-token.js:20:15)
┃       at Object.getCurrentSessionId (/home/vango/sourcecode/product-reviews-sample-app/node_modules/@shopify/shopify-api/dist/auth/oauth/oauth.js:218:64)
┃       at Object.<anonymous> (/home/vango/sourcecode/product-reviews-sample-app/node_modules/@shopify/shopify-api/dist/utils/load-current-session.js:19:46)
┃       at step (/home/vango/sourcecode/product-reviews-sample-app/node_modules/@shopify/shopify-api/node_modules/tslib/tslib.js:143:27)
┃       at Object.next (/home/vango/sourcecode/product-reviews-sample-app/node_modules/@shopify/shopify-api/node_modules/tslib/tslib.js:124:57)
┃       at /home/vango/sourcecode/product-reviews-sample-app/node_modules/@shopify/shopify-api/node_modules/tslib/tslib.js:117:75
┃       at new Promise (<anonymous>)
┃       at Object.__awaiter (/home/vango/sourcecode/product-reviews-sample-app/node_modules/@shopify/shopify-api/node_modules/tslib/tslib.js:113:16)
┃       at Object.loadCurrentSession (/home/vango/sourcecode/product-reviews-sample-app/node_modules/@shopify/shopify-api/dist/utils/load-current-session.js:15:20)
┃       at /home/vango/sourcecode/product-reviews-sample-app/node_modules/@shopify/koa-shopify-auth/dist/src/verify-request/login-again-if-different-shop.js:17:74
┃       at step (/home/vango/sourcecode/product-reviews-sample-app/node_modules/tslib/tslib.js:133:27)
┃       at Object.next (/home/vango/sourcecode/product-reviews-sample-app/node_modules/tslib/tslib.js:114:57)
┃       at /home/vango/sourcecode/product-reviews-sample-app/node_modules/tslib/tslib.js:107:75
┃       at new Promise (<anonymous>)

Any guidance that could be provided to successfully run this application would be appreciated.

Update

Turns out it was an issue with my system time being out of sync with the NTP server:

*Shopify/shopify-api-js#137 (comment)
*https://linuxhint.com/sync-time-ntp-server-linux/

Unhandled Runtime Error

The following error occurred when ran the sample app from test store,

SecurityError: Failed to read the 'localStorage' property from 'Window': Access is denied for this document.

Call Stack
eval
webpack-internal:///./node_modules/use-persisted-state/dist/use-persisted-state.m.js (5:404)
Module.eval
webpack-internal:///./pages/index.js (16:96)
eval
webpack-internal:///./pages/index.js (116:30)
Module../pages/index.js
file:///Users/joe/Documents/shopify-os2-apps/product-reviews-sample-app/.next/static/chunks/pages/index.js (686:1)
__webpack_require__
/_next/static/chunks/webpack.js (873:31)
fn
file:///Users/joe/Documents/shopify-os2-apps/product-reviews-sample-app/.next/static/chunks/webpack.js (151:20)
eval
webpack-internal:///./node_modules/next/dist/build/webpack/loaders/next-client-pages-loader.js (5:16)
eval
webpack-internal:///./node_modules/next/dist/client/route-loader.js (208:43)

[BUG] package-lock.json is out of date

Current Behavior

Running npm install shows that the checking in package-lock.json is out of date.

Expected Behavior

No error message.

Steps To Reproduce

  1. clone the repo
  2. run npm install
  3. see the warning

Environment

- OS: osx
- Node: 16
- npm: 7.x

Anything else?

No response

Why redirect to offline session if the shop hasn't been seen yet

I don't quite understand why to redirect to offline session in case the shop hasn't been seen yet. Is there any special reason for that?

From server.js

  const verifyIfActiveShopifyShop = (ctx, next) => {
    const { shop } = ctx.query;

    // This shop hasn't been seen yet, go through OAuth to create a session
    if (ACTIVE_SHOPIFY_SHOPS[shop] === undefined) {
      ctx.redirect(`/offline/auth?shop=${shop}`);
      return;
    }

    return next();
  };

Authentication failure when calling app rest endpoint from theme extension

What is the problem you are facing?

Hello,

I'm trying to add a button in the theme.
Use case: Click on the button changes the value of a metafield attached to an order, and I'll get the new value of the metafield
shown on the page.

Solution I managed to put together so far:

  • Create a theme app extension: in the liquid containing the button, there's an api call to an endpoint (/app/xxx/status) like you are doing in the product reviews sample app.
  • Create an App proxy that exposes the above endpoint and defines the logic for it: calls the Admin API to get the metafield

Problem:

  • The request from the store is not going through: I have the authentication problem below :

https://mystore.myshopify.com/api/auth?oseid=xxxxxxx&shop=mystore.myshopify.com 404

Code:

I am using thee same logic as the generated code :

app.get("/api/products/count", async (_req, res) => {
const countData = await shopify.api.rest.Product.count({
session: res.locals.shopify.session,
});
res.status(200).send(countData);
});

and then calling this endpoint from the theme extension.

Question:

  • How can I see the logs of my app ?

  • How can I get this request go through ?

  • How to authenticate the request coming from the store to the app proxy then to the Admin API?

  • Is there an example to accomplish this ?

Regards

Describe the solution you'd like to see

I won't to see my app responding with 200 ok

Anything else?

No response

j

The get started documentation is horrible. To install test app, use the following CLI command. Don't understand one would want to go through all that based on https://shopify.dev/apps/getting-started/create.

shopify node open

why two different methods for the same thing that only causes confusions.

Reviews are not shown

Hello guys. I'm new with Shopify app development.
I followed all the instructions from getting started. And when I followed the link from ngrok I've got this
getting-started

I use default Dawn theme. When I follow the link to editor there are no new Blocks or Secrions for review. What am I doing wrong? How should I install missing blocks?

Thank you!

[BUG] Deprecation: <Sheet /> is deprecated.

Current Behavior

On a fresh install getting a deprecation warning for

Sheet.js?0ffe:54 Deprecation: <Sheet /> is deprecated. This component might be removed in a future major version of Polaris. Use <Modal /> instead or avoid modal patterns all together.

Screen Shot 2022-05-09 at 3 01 01 PM

Expected Behavior

Should be updated with components that are not going to be deprecated.

Steps To Reproduce

  1. Clone & install dependencies
  2. run shopify app serve
  3. notice that you get the deprecation warning

Environment

- OS: Mac
- Node: 16.14.0
- npm: 8.3.1 - polaris 9.6.0

Anything else?

No response

How to show review stars within collection templates?

I'd like to start a discussion about how to show the review stars for this sample app inside of a collection or search template.

For example, for each product in the collection, I'd like to see the average rating stars when viewing a collection or search template.

This use case doesn't seem to be directly supported with the new App Blocks unless I am mistaken. Do you have any tips you can share about how you might make this work?

Thanks,
Tom

Failed to build extension code with "shopify extension push"

shopify extension push returns the following

Failed to build extension code.
┏━━ Building extension with: npm… ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
┃
┃ > [email protected] build
┃ > checkout-ui-extensions-run build
┃
┃ sh: checkout-ui-extensions-run: command not found
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

What's funny is that it did create checkout extension albeit the error.

Update shopify-api and koa-shopify-auth

The application is littered with deprecation notices, likely from an old shopify-api version being pulled in from koa-shopify-auth. When attempting to force to the latest shopify-api version the auth broke when launching the app. Looks like the latest version of shopify-api and koa-shopify-auth have some backwards incompatible changes related to how sessions are started.

[BUG] Invalid directory: locales

Current Behavior

When running a command on fresh installation and full setup in directory /theme-app-extension shopify extension push it returns and error:
[BUG] Invalid directory: locales
https://i.imgur.com/Wwf3l8e.png

Expected Behavior

It should not return any error messages and inside the theme editor the translations should be seen.

Steps To Reproduce

Fresh installation, when setup and pushed to register theme app extension

Environment

- OS: Ubuntu 20.04
- Node: v16.8.0
- npm: 8.5.4

Anything else?

No response

deprecated metafield type "json_string" vs. new "json"

Based on the current docs https://shopify.dev/api/liquid/objects/metafield#deprecated-metafields I wondered why this sample app is using the deprecated json_string.

Could this be because the 2019-10 API version only supports the old types?

uri: `https://${shop}/admin/api/2019-10/graphql.json`,

Can I use the new json type the same way json_string is used in this example?

Thanks!

[BUG] App appears as blank in store admin

Current Behavior

The page does not automatically redirect to either 'get-started' or 'proudcts', thus appears to be blank when launching the app.

I suspected this is due to a failed redirect from Next.js useRouter

I understand this repo is marked as deprecated, but it does not explain why the routing system from Next.js does not work.

Expected Behavior

No response

Steps To Reproduce

No response

Environment

- OS:
- Node:
- npm:

Anything else?

No response

How to use modules?

Issue

Hi,

So I am migrating our old app, which used the ScriptTag API to inject itself into the page and had a Laravel backend to use the new Theme App Extensions, using NextJS.

We were making use of Javascript modules to keep the Javascript ordered and composable, but I am not entirely clear on how to so this with Theme App Extensions. I suppose I could somehow pre-build the final JS file, like the Laravel version used to do with Mix, but is there some standard way this should be working?

post checkout extension doc suggestions

There are two main issues I ran into when going through the docs:

  • The extension will not work for "free" products, this should be be a note in the docs.
  • We don't need to run the step npm install @shopify/admin-ui-extensions-run@latest --save-dev. Just running npm install from the right directory should be enough.
  • There is no documentation on how to enable the extension. To do this go to Store Admin > Settings > Checkout > “Post-purchase page” and click on the product review option.

Screen Shot 2022-02-24 at 10 02 27 AM

Error "The script_tag filter is parser-blocking..." when running "shopify extension push"

Hello, i have followed the getting started guide precisely, but i am getting an error when trying to push the shopify app extension.

The whole error is:
X The script_tag filter is parser-blocking. Use a script tag with the async or defer attribute for better performance at blocks/product-reviews.liquid:46

Which happens after runing "shopify extension push", after having followed the guide.

The error prevents the app extension from being pushed.

Set this app as deprecated

Please explain to me why this app and the app built from the Shopify CLI have different structures?
Why is this application not updated to have the updated structure?

For example, You are new to Shopify apps development. And you want to get some dynamic data from your shop. You will use Shopify Node app.
If you read Shopify documentation and want to create an app, you run the CLI command. After that, if you want to create an extension, you run the CLI command.

BUT, if you want to make some fetch from that extension, you will see the link to this repository product-reviews-sample-app. And the different app structure. What? Why?

This app uses koa-router. And the example fetch from the extension not working in the new application.
CLI app uses express.

And the app extensions documentation does not contain an example, it sends to this repository. Facepalm.
That kind of attitude is just annoying.

How to install this sample app in vintage (1.0) themes?

Issue

This is a great demonstration of how to build an app for 2.0 themes, but I can't find any mention in the codebase or support material of how to support 1.0 themes please?

Given that this is the model application for new apps on Shopify, it would be great if you model how to support 1.0 themes, of which there are still many in service.

Doc suggestions

  • In addition to the larger "getting started" doc there is a theme specific doc and extension specific doc. These should be consolidated in a meaningful way.
  • Include a git clone step.
  • Separate the "create an app in partner dashboard" step from the CLI steps
  • Add a warning/note for not updating the API scopes. Include the error that will appear if that step is skipped.
  • After "Start the server" add a note about not trying to go to the ngrok URLs yet (you need to update the callbacks in the app settings.
  • The "Verify if the embedded app is running" can give a bit more detail and possibly a screenshot so the reader knows what to expect
  • There needs to be more clarity between what is being accomplished in each section. E.g. Getting started puts the app in the storefront admin, then the theme needs to be update to show the reviews, checkout extension is built so the buyers can submit a review after they have purchased something.
  • Include an architecture diagram

[BUG] browser cookies can't be accessed via koa-shopify-auth

Current Behavior

I've walked through the tutorial but having the following warning on browser console panel in step 9. And the iframe field for this App is empty.

img

Actually, after searching a bit, I found there's this open issue on koa-shopify-auth. Perhaps this is where the problem comes from. Anyone have a similar issue? Shopify/koa-shopify-auth#61

Expected Behavior

The result should be consistent with the screenshot shown in step 9 without the warning mentioned above.

Steps To Reproduce

Follow this guide.

Environment

- OS: Mac 10.15.7
- Node: 16.13.0
- npm: 8.1.0

Anything else?

No response

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.