-
Notifications
You must be signed in to change notification settings - Fork 253
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
add tunneling in dev command #1804
Conversation
a8ba9cd
to
24dda14
Compare
24dda14
to
69af110
Compare
f706703
to
ebf40a9
Compare
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.
Haven't tried this yet but just a few quick comments.
We probably need to modify Vite's server URLs before calling printUrls
🤔
Also, not sure how this plays with the --host
flag. That flag is already turning localhost into 0.0.0.0
so that the site is available in the local network. It maps Vite's host.
ebf40a9
to
0755095
Compare
3c94ea6
to
841b73a
Compare
841b73a
to
3f80e93
Compare
3f80e93
to
96ff45c
Compare
96ff45c
to
d5e346a
Compare
d5e346a
to
8d2062f
Compare
3a3bb7f
to
eb43822
Compare
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.
Thanks for the updates! I've left a few things to consider in the comments.
I want to make sure I understand the flow:
- We are adding the flag by default, but devs can still use
mock.shop
because we keep that in.env
by default, right? - If they use mock.shop (by default they do), we only show a banner to ask them to link the storefront...?
- Once they have removed the mock.shop domain, we ask for login/link and start tunneling.
Is that somewhat correct? Thanks!
--
Also, I'm confused, do I still need to do a manual step? Shouldn't it be all automatic with these changes?
![image](https://private-user-images.githubusercontent.com/1634092/311182703-3023aa99-438a-4cfe-a773-8f76dde83110.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjI0NDk4MzIsIm5iZiI6MTcyMjQ0OTUzMiwicGF0aCI6Ii8xNjM0MDkyLzMxMTE4MjcwMy0zMDIzYWE5OS00MzhhLTRjZmUtYTc3My04Zjc2ZGRlODMxMTAucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDczMSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA3MzFUMTgxMjEyWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ZWY1ZmIwYWU5Y2VkZmYyMjFhM2I5MTdmMzViZmFlYzU1YWY0MmRlNjIyNzFiNGVhNjllZWI1MzE1Yjk4N2ZiNSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.B3gJTuybnhTwqULRJEv3TbnJJFlTDnOAlsc0hmBl6rI)
(I've chosen Hydrogen Preview).
Looks like the issue is happening because:
|
f7262be
to
cf206d6
Compare
3d4728c
to
bb20fab
Compare
I added an error link so if the "Javascript origin is not allow on this application type occur again", the message will take you to here to enable it to public type |
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.
Added a few extra comments to clarify what I meant in the previous review 👍
auto push tunnel url and push to admin
5457dd8
to
ed00e80
Compare
WHY are these changes introduced?
The first step for making developing with Customer Account API easier.
Where instead of using ngrok on top of shopify CLI, a tunnling service will come with using
npx shopify dev --tunnel
Step two will take the tunnel URL and push the redirect url to Admin.
WHAT is this pull request doing?
flag
--customer-account-push
had been added to the CLIhydrogen dev
&hydrogen dev-vite
commands.--customer-account-push
flag: A cloud flare tunnel is automatically started and the url display instead of localhost. At the end up starting a tunnel, the CLI will then take the tunneling url, push it to admin.A new command
hydrogen customer-account push
had been added with the following flag where it can be use as a stand alone command to push configIf the push is successful, the urls are then saved to
.shopify/project.json
file. And the next push will take the url here and remove it from admin while doing the next updateHOW to test your changes?
to see automatically tunnel running. The
--customer-account-push
is added to skeleton template along side of having new Customer Account APIThere are a few flows to check:
mock.shop
in the .env file: see the dev server running with info banner in the server log stating the flag functionalities had been skiphydrogen dev --customer-account-push
orhydrogen dev-vite --customer-account-push
=> can interact with CA API in browserhydrogen customer-account push --dev-oring <your-persisting-ngrok-url>
as a one off to push local dev url, production url, or even preview url to admin [cc @macpham would this be something oxygen need when generating preview?]Still To Do:
Nice to Have:
(Implement branded domains if it's an OK feature. Deploy a Cloudflare Worker with a custom domain like hydrogen.app and use Cloudflare's wild card subdomains to proxy the trycloudflare tunnel. For example, we check the Request in the worker and, if it was to xyz.hydrogen.app, we forward it to xyz.trycloudflare.com. Then, we show the users they can connect to xyz.hydrogen.app in the terminal.)
Post-merge steps
Checklist