-
Notifications
You must be signed in to change notification settings - Fork 140
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
Make developer console support create/delete extensions mid-dev #5118
base: main
Are you sure you want to change the base?
Make developer console support create/delete extensions mid-dev #5118
Conversation
Coverage report
Show files with reduced coverage 🔻
Test suite run success1994 tests passing in 902 suites. Report generated by 🧪jest coverage report action from 147046b |
this.handle = this.buildHandle() | ||
this.devUUID = `dev-${nonRandomUUID(this.handle)}` |
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.
With this we ensure that the devUUID
is always the same for the same extension. Allowing us to reload it if we need it.
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.
Noting that the handle can change (right?) so it's not 100% foolproof but it's close enough that it should be fine.
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.
It shouldn't change during dev
though, which solves the issue of "reloading" the app.
In any case, this is mostly for ui-extensions, and we need to rethink why ui-extensions need a devUUID
in the first place. Will probably do it in early january.
this.handle = this.buildHandle() | ||
this.devUUID = `dev-${nonRandomUUID(this.handle)}` |
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.
Noting that the handle can change (right?) so it's not 100% foolproof but it's close enough that it should be fine.
// NOTE: Always use `payloadOptions`, never `options` directly. This way we can mutate `payloadOptions` without | ||
// affecting the original `options` object and we only need to care about `payloadOptions` in this function. |
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.
Note that we could make options
of type Readonly<ExtensionDevOptions>
but there are also downsides as Readonly
is a somewhat weak guarantee and might make us think code is safe when it really isn't. Not a mandatory change, but something to consider.
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.
Actually, I just forced all other functions to expect a ExtensionsPayloadStoreOptions
, that way i'm sure we are using payloadOptions
This comment has been minimized.
This comment has been minimized.
We may have API key rather than ID
In fact it's just a second reference to the same thing after the code changes in the previous commit. So it would be better to avoid suggesting that changes are safe.
If this is the first time deploying and there is no UID, the autogenerated UID won't yet be found in `module.configuration`. All singleton shopify.app.toml-based extensions don't need assets, so even though they should technically use module.handle here, it basically doesn't matter. And for all other extension types, `module.uid` is the correct value to use here.
Just pass `SHOPIFY_APP_TEMPLATES_JSON_PATH=/path/to/your/file` and it will draw from there instead of pulling from the live URL.
…delete_extensions_mid-dev
WHY are these changes introduced?
Adds support for handling extension creation and deletion events in the developer console during consistent-dev.
Fixes https://github.com/Shopify/develop-app-outer-loop/issues/1198
WHAT is this pull request doing?
KNOWN ISSUES:
How to test your changes?
Measuring impact
Checklist