-
Notifications
You must be signed in to change notification settings - Fork 64
Adding JavaScript functions to sample apps #169
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
Conversation
andrewhassan
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Out of curiosity, why did we choose to have a JS example and not a TS example instead?
| @@ -0,0 +1,1741 @@ | |||
| # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should these two yarn.lock files be committed? It looks like we already have package-lock.json files. We should choose one or the other depending on the tooling we recommend (e.g. yarn or npm).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought we had standardized on yarn in this repo, but looks like we have a mix. In our docs, we don't recommend a particular package manager. But the CLI team internally has moved from yarn to pnpm.
sample-apps/payment-customizations/extensions/payment-customization-js/package.json
Outdated
Show resolved
Hide resolved
...s/payment-customizations/extensions/payment-customization-js/shopify.function.extension.toml
Show resolved
Hide resolved
sample-apps/payment-customizations/extensions/payment-customization-js/src/index.js
Show resolved
Hide resolved
sample-apps/payment-customizations/extensions/payment-customization-js/src/index.js
Outdated
Show resolved
Hide resolved
@andrewhassan Our docs, and thus the sample, are going to focus on JS based on consistency with UI extensions, and survey feedback (Vanilla JS edging out TS). Thought about doing both but it would add maintenance overhead for minor benefit. |
…ation-js/src/index.js Co-authored-by: Andrew Hassan <[email protected]>
35e06b9 to
169e8d6
Compare
|
@adampetro Looks like this is failing now due to Rust checks being done on a JavaScript extension, is that something that was added in the JS unit test PR? |
Most likely this line. I think we can get around it by using |
1021628 to
b88a5ca
Compare
* move vitest and test script to the extension itself * ensure sample tests run with workspace tests
|
@adampetro Thanks! Unfortunately they can't be globbed due to this but that fixed it. Also added the JS sample extensions to the workspace so those tests run now too. Awesome work setting up all the test automation. |
adampetro
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! If you have time it would be nice to add a newline at the end of files that don't have one
sample-apps/delivery-customizations/extensions/delivery-customization-js/.gitignore
Outdated
Show resolved
Hide resolved
sample-apps/delivery-customizations/extensions/delivery-customization-js/src/index.js
Outdated
Show resolved
Hide resolved
sample-apps/delivery-customizations/extensions/delivery-customization-js/src/index.test.js
Outdated
Show resolved
Hide resolved
sample-apps/discounts/extensions/product-discount-js/.gitignore
Outdated
Show resolved
Hide resolved
sample-apps/discounts/extensions/product-discount-js/src/index.test.js
Outdated
Show resolved
Hide resolved
sample-apps/discounts/extensions/product-discount-rust/input.graphql
Outdated
Show resolved
Hide resolved
sample-apps/payment-customizations/extensions/payment-customization-js/.gitignore
Outdated
Show resolved
Hide resolved
sample-apps/payment-customizations/extensions/payment-customization-js/src/index.js
Outdated
Show resolved
Hide resolved
sample-apps/payment-customizations/extensions/payment-customization-js/src/index.test.js
Outdated
Show resolved
Hide resolved
Added missing newlines
8531e7e to
7869cc4
Compare
Existing sample apps can add JavaScript functions in this PR. It should not be merged until JavaScript functions are generally available.
🎩
Payment Customization
Delivery Customization
Discounts