Shopify / shopify-app-template-node

MIT License
860 stars 393 forks source link

Conflict between importing from LATEST_API_VERSION and 2023-04 #1279

Closed its-anas closed 1 year ago

its-anas commented 1 year ago

I believe restResources import should be dynamic just like the first import that uses LATEST_API_VERSION, otherwise it may cause a conflict one day.

https://github.com/Shopify/shopify-app-template-node/blob/57de24b8ac52471b76dd0bc5072282ecc941e6a3/web/shopify.js#L1-L4

paulomarg commented 1 year ago

That's a fair point, but if we make this a dynamic import we will lose intellisense on e.g. VSCode, which makes it a lot more difficult to use the resources.

If they ever fall out of sync, that won't break anything - it will just log a message reminding the developer that they should update their import statement, but it will continue to use 2023-04 for the resources so the code will continue to work the same way until the app is ready to be migrated.

Since this is working as intended, I'll close the issue. Please do report to us if this ever causes any problems while developing!