Add support for Blueprints defineSiteUrl#2516
Conversation
- Add comprehensive tests for extractFormValuesFromBlueprint and updateBlueprintWithFormValues utility functions - Add tests for defineSiteUrl step extraction in blueprint deeplink hook - Cover edge cases: port preservation, invalid URLs, http vs https
📊 Performance Test ResultsComparing 815dff1 vs trunk site-editor
site-startup
Results are median values from multiple test runs. Legend: 🟢 Improvement (faster) | 🔴 Regression (slower) | ⚪ No change |
sejas
left a comment
There was a problem hiding this comment.
I tested the PR with and without https and I confirm Studio pre-fills the custom domain extracting it from defineSiteUrl step.
The only case that fails is Test 3: URL with port - Verify custom domain field shows mysite.local:8443 (port preserved). I don't see the port preserved, and I'm not sure if we should support it at all.
| if ( defineSiteUrlStep?.siteUrl ) { | ||
| try { | ||
| const url = new URL( defineSiteUrlStep.siteUrl ); | ||
| values.customDomain = url.hostname; |
There was a problem hiding this comment.
Verify custom domain field shows mysite.local:8443 (port preserved)
If we want to preserve the port we might need to use host instead of hostname. Although I'm not sure if we should just show a warning or error to avoid falling into a rabbit hole.
| values.customDomain = url.hostname; | |
| values.customDomain = url.host; |
|
Good catch! This is intentional - we're using The reason is that domain validation (
If we preserved the port (e.g., I've updated the PR description to reflect this behavior. 👍 |

Related issues
Proposed Changes
defineSiteUrlfrom blueprint steps to pre-populate the custom domain fieldextractFormValuesFromBlueprint/updateBlueprintWithFormValues)BlueprintSiteSettingstype for shared settings between blueprints and formsdefineSiteUrlstep and expand advanced settingsdefineSiteUrl(https vs http)Testing Instructions
Test 1: HTTPS URL in blueprint
defineSiteUrlstep using https:{ "steps": [ { "step": "defineSiteUrl", "siteUrl": "https://mysite.local" } ] }mysite.localTest 2: HTTP URL in blueprint
defineSiteUrlstep using http:{ "steps": [ { "step": "defineSiteUrl", "siteUrl": "http://mysite.local" } ] }mysite.localTest 3: URL with port (port is stripped)
{ "steps": [ { "step": "defineSiteUrl", "siteUrl": "https://mysite.local:8443" } ] }mysite.local(port is stripped - domain validation doesn't support ports)Pre-merge Checklist