Replace hardcoded port 3000 with dynamic port in dev URLs#110002
Open
p-jackson wants to merge 2 commits intodot-env-portfrom
Open
Replace hardcoded port 3000 with dynamic port in dev URLs#110002p-jackson wants to merge 2 commits intodot-env-portfrom
p-jackson wants to merge 2 commits intodot-env-portfrom
Conversation
Jetpack Cloud Live (direct link)
Automattic for Agencies Live (direct link)
Dashboard Live (dotcom) (direct link)
|
Contributor
|
This PR modifies the release build for the following Calypso Apps: For info about this notification, see here: PCYsg-OT6-p2
To test WordPress.com changes, run |
Add {{key}} template support to config values, resolved at config
creation time via create-calypso-config. Config JSON files use
{{port}} in URL values so they reflect the actual server port.
Client code uses config('port') for dev URLs in dashboard routing,
jetpack-connect, and checkout. CORS allowlists in wpcom-proxy-request
and calypso-url match localhost origins on any port.
8ce6fe7 to
21bebd9
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #109963
Proposed Changes
{{key}}template support to config values increate-calypso-config, resolved at config creation timedevelopment.json,dashboard-development.json) use{{port}}in URL values (wpcom_url,logout_url) so they reflect the actual server portconfig('port')for dev URLs in dashboard routing, jetpack-connect, and checkoutwpcom-proxy-requestandcalypso-urlmatch localhost origins on any port by stripping the port and comparing against known dev originsresolveTemplatesfromcreate-calypso-configfor server-side use onclientData(which must remain a plain object)Why are these changes being made?
When running Calypso on a non-default port (e.g. via
PORT=4321or cmux/conductor), many URLs were hardcoded to:3000— the Reader link in the masterbar, dashboard cross-origin links, CORS allowlists, etc. This makes the port fully dynamic so all dev URLs match the actual server port.Testing Instructions
PORT=4321 yarn start(or any non-3000 port):4321window.configData.wpcom_urlcontains the correct port:3000appears in the HTML source:curl -s http://calypso.localhost:4321 | grep -c ':3000'should be 0http://my.localhost:4321Pre-merge Checklist