Skip to content

Allow overriding Super Dev Mode server URL via prompt#10344

Open
schteff wants to merge 2 commits into
gwtproject:mainfrom
Tempus-Information-Systems:feature/allow-alt-sdm-url
Open

Allow overriding Super Dev Mode server URL via prompt#10344
schteff wants to merge 2 commits into
gwtproject:mainfrom
Tempus-Information-Systems:feature/allow-alt-sdm-url

Conversation

@schteff

@schteff schteff commented Jun 15, 2026

Copy link
Copy Markdown

If the SDM server is unreachable, a prompt now allows users to specify a new server URL. This URL is persisted in sessionStorage so it can be used during the subsequent page reload.

This makes it possible to use https://github.com/localtunnel/localtunnel or other similar services (that tunnel specific ports) to share the local dev environment with other people without having to build and deploy the app on some other server.

If the SDM server is unreachable, a prompt now allows users to specify a new server URL. This URL is persisted in sessionStorage so it can be used during the subsequent page reload.

@niloc132 niloc132 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the idea, and at a quick glance the implementation seems okay - but doesn't the bookmarklet setup solve this too? That is, if you first start mysdm:9876 and visit that URL, the bookmarklets let you enable SDM in session storage?

My current usage is atypical, so I may well be misremembering.

try {
serverUrl = $wnd.sessionStorage.getItem(serverUrlKey) || defaultServerUrl;
} catch (e) {
// sessionStorage may be unavailable; fall back to the default url.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the risk/likelihood that session storage is unavailable? dev_mode_on.js relies on it and won't function without it, so I think maybe we can assume it is there?

try {
$wnd.sessionStorage.setItem(serverUrlKey, newServerUrl);
} catch (e) {
// Without storage the reload falls back to the default url.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(assuming still relevant) Should probably notify that the prompt had no effect?

Maybe test for storage usage before attempting to use prompt to begin with?

@schteff

schteff commented Jun 16, 2026

Copy link
Copy Markdown
Author

I like the idea, and at a quick glance the implementation seems okay - but doesn't the bookmarklet setup solve this too? That is, if you first start mysdm:9876 and visit that URL, the bookmarklets let you enable SDM in session storage?

My current usage is atypical, so I may well be misremembering.

I haven't used the bookmarklets in so long, I thought they were abandoned with the old dev mode and replaced by SDM.

I'll remove the check for sessionstorage availability, I was not aware of it being used for other GWT functionality. 👍

Remove try-catch blocks around sessionStorage interactions when retrieving or persisting the Super Dev Mode server URL since we know sessionStorage is already available and used in dev_mode_on.js.
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