Skip to content
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

[Themes] PoC Hot Reload for OSE #4908

Open
wants to merge 22 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 21 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
a8bee62
Adapt hot reloading for OSE
frandiox Nov 22, 2024
8d5a00e
Wait full sync before doing full-reload
frandiox Nov 22, 2024
9dfd3d7
Move CORS logic
frandiox Nov 28, 2024
38bd7c1
Rely on section rendering API from the browser instead of cloud syncing
frandiox Nov 28, 2024
d8b7f35
Show HR port in OSE url
frandiox Dec 9, 2024
534852f
Introduce HR filters to fork logic for OSE without affecting CLI
frandiox Dec 9, 2024
a9adaa6
Fix type in app ext
frandiox Dec 9, 2024
43a9016
Move hot reload decisions to frontend to increase client flexibility
frandiox Jan 6, 2025
b8d128c
Basic support for OSE preview hot reload
frandiox Jan 7, 2025
67b9e8a
Support hot reload in prod Theme Preview
frandiox Jan 7, 2025
db317eb
Sections hot reload for OSE
frandiox Jan 8, 2025
89e1f1b
Temporary fix for hot reloading sections in OSE
frandiox Jan 8, 2025
7d7a8fc
Support hot reloading theme settings in OSE
frandiox Jan 8, 2025
f8356ee
Support hot reload for language files in OSE
frandiox Jan 9, 2025
f75bcb4
Skip SSE reconnection if it fails the first time to avoid console err…
frandiox Jan 9, 2025
5d4e787
Support hot reload from Online Code Editor via OSE
frandiox Jan 9, 2025
afe8aa9
Rename type and add support for create events
frandiox Jan 10, 2025
3e2be46
Send all events to OSE
frandiox Jan 10, 2025
df6feb6
Fix sections reload in OSE
frandiox Jan 10, 2025
af9436a
Remove comment
frandiox Jan 10, 2025
2d53198
Disable outdated test
frandiox Jan 10, 2025
b49e12e
Simplify hot reload endpoints
frandiox Jan 21, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions packages/cli-kit/src/public/node/themes/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,19 @@ export type Key = string

export type ThemeFSEventName = 'add' | 'change' | 'unlink'

type OnSync = (onSuccess: () => void, onError?: () => void) => void

type ThemeFSEvent =
| {
type: 'unlink'
payload: {fileKey: Key; onSync?: (fn: () => void) => void}
payload: {fileKey: Key; onSync: OnSync}
}
| {
type: 'add' | 'change'
payload: {
fileKey: Key
onContent: (fn: (content: string) => void) => void
onSync: (fn: () => void) => void
onSync: OnSync
}
}

Expand Down
2 changes: 1 addition & 1 deletion packages/theme/src/cli/services/dev.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ describe('dev', () => {
{
link: {
label: 'Customize your theme at the theme editor',
url: 'https://my-store.myshopify.com/admin/themes/123/editor',
url: 'https://my-store.myshopify.com/admin/themes/123/editor?hr=9292',
},
},
],
Expand Down
2 changes: 1 addition & 1 deletion packages/theme/src/cli/services/dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ export function renderLinks(store: string, themeId: string, host = DEFAULT_HOST,
{
link: {
label: 'Customize your theme at the theme editor',
url: `${remoteUrl}/admin/themes/${themeId}/editor`,
url: `${remoteUrl}/admin/themes/${themeId}/editor?hr=${port}`,
},
},
],
Expand Down
Loading
Loading