Skip to content

Conversation

@isaacroldan
Copy link
Contributor

@isaacroldan isaacroldan commented Jan 27, 2025

WHY are these changes introduced?

For dev-sessions, update the preview URL dynamically depending on whether the app has previewable extensions or not.

WHAT is this pull request doing?

  • Adds dynamic preview URL updates in dev sessions based on extension previewability
  • Introduces a new devSessionPreviewURL state to track and update the preview URL
  • Updates the UI to reflect preview URL changes in real-time

How to test your changes?

  1. Start a dev session with no previewable extensions (no UI ext.)

    • Verify the default app preview URL is displayed
  2. Add a previewable extension (admin-action for example)

    • Verify the preview URL updates to show the dev console URL
    • Press 'p' to confirm the new URL opens correctly
  3. Remove all previewable extensions

    • Verify the preview URL reverts to the default app preview URL

Measuring impact

  • n/a - this doesn't need measurement, e.g. a linting rule or a bug-fix

Checklist

  • I've considered possible cross-platform impacts (Mac, Linux, Windows)
  • I've considered possible documentation changes

Copy link
Contributor Author

isaacroldan commented Jan 27, 2025

@isaacroldan isaacroldan changed the title Add tests for dev.tsx changes Update preview URL based on dev session status Jan 27, 2025
@isaacroldan isaacroldan marked this pull request as ready for review January 27, 2025 10:11
@isaacroldan isaacroldan requested a review from a team as a code owner January 27, 2025 10:11
@github-actions
Copy link
Contributor

We detected some changes at packages/*/src and there are no updates in the .changeset.
If the changes are user-facing, run "pnpm changeset add" to track your changes and include them in the next release CHANGELOG.

@isaacroldan isaacroldan force-pushed the 01-27-update_app_preview_url_from_dev-session branch 2 times, most recently from 218c502 to a7bf159 Compare January 27, 2025 11:18
Copy link
Contributor Author

/snapit

@github-actions
Copy link
Contributor

🫰✨ Thanks @isaacroldan! Your snapshot has been published to npm.

Test the snapshot by intalling your package globally:

pnpm i -g @shopify/cli@0.0.0-snapshot-20250127111920

After installing, validate the version by running just shopify in your terminal
If the versions don't match, you might have multiple global instances installed.
Use which shopify to find out which one you are running and uninstall it.

@github-actions
Copy link
Contributor

github-actions bot commented Jan 27, 2025

Coverage report

St.
Category Percentage Covered / Total
🟡 Statements
75.45% (+0.07% 🔼)
8930/11835
🟡 Branches
70.72% (+0.1% 🔼)
4347/6147
🟡 Functions
75.25% (+0.11% 🔼)
2347/3119
🟡 Lines
75.97% (+0.05% 🔼)
8436/11105
Show files with reduced coverage 🔻
St.
File Statements Branches Functions Lines
🟢
... / app-event-watcher.ts
93.83% (-1.23% 🔻)
86.49% (-2.7% 🔻)
90.48% 98.61%
🟢
... / previewable-extension.ts
85.71% (-3.17% 🔻)
100% 66.67%
83.33% (-4.17% 🔻)
🟢
... / setup-dev-processes.ts
95.56% (+0.1% 🔼)
78.57% (-3.57% 🔻)
90.91%
94.87% (+0.13% 🔼)

Test suite run success

2012 tests passing in 905 suites.

Report generated by 🧪jest coverage report action from 9301fe3

@isaacroldan isaacroldan force-pushed the 01-27-update_app_preview_url_from_dev-session branch from a7bf159 to 6001250 Compare January 27, 2025 12:51
@isaacroldan isaacroldan force-pushed the 01-27-update_app_preview_url_from_dev-session branch from 6001250 to 9301fe3 Compare January 27, 2025 14:02
@isaacroldan isaacroldan added this pull request to the merge queue Jan 28, 2025
Merged via the queue into main with commit 8b805e7 Jan 28, 2025
1 check passed
@isaacroldan isaacroldan deleted the 01-27-update_app_preview_url_from_dev-session branch January 28, 2025 10:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants