-
Notifications
You must be signed in to change notification settings - Fork 2
Draft: Polaris frame, Modals, and more! #8
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
base: main
Are you sure you want to change the base?
Conversation
| </div> | ||
|
|
||
| <div | ||
| className="main-content" |
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 wish I could just use <Frame /> from Polaris React 😭
| /** | ||
| * Print configuration summary | ||
| */ | ||
| function printConfigSummary(config: MockShopifyAdminConfig): void { |
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 found that this print ended up being inaccurate when my config file was applied
| .argument('[app-url]', 'Your app\'s URL (e.g., http://localhost:3000/shopify)') | ||
| .option('-i, --client-id <id>', 'Your Shopify app\'s client ID (optional, defaults to development ID)') | ||
| .option('-s, --client-secret <secret>', 'Mock client secret (development only)') | ||
| .option('--shop <domain>', 'Mock shop domain', 'test-shop.myshopify.com') |
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.
There's probably a better way, but this default was overriding my config
|
Now that I think about it, a better way to handle modal lifecycle would be to implement web components for them :P |
|
Is there any chance we'll get this in? This is like the missing link in Shopify App Development :) |
Disclaimer: This is a draft PR, still some more work to do :) Please feel free to take a look though!
Related issues #2, #7, #5, #4, #3
Hey! I finally got some time to sink my teeth into this. 😄
This PR has a lot of changes, and will probably get more as I continue to flesh out modals. My goals were:
postMessagecomms between the admin frame and client app bridgeIn doing so, I've introduced a plethora of changes:
--shopwould override the shop I have set in configiframesrcviaid_tokenparam, my Remix app needed thiswindow.shopifydefinition, give those a place to live for future iterationPLEASE ask me all the questions and give any feedback (maybe aside from code review, it's unfinished!) Let me know if this is in-line with your vision or if there is some contribution etiquette I'm missing!
So much more
TODO, including adding more info to this description. It's Saturday evening and I'm craving some brew 🍺Remaining tasks in this PR:
MutationObserverworks properly, modal content should be dynamic, unmounting should invoke cleanup, etc.)invokeFeatureis fine for unidirectional/opaque flow (app iframe -> parent) but what if the parent wants to return data? 🤔