Skip to content

Fixes for improving local development with Android Emulator #14372

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

vlbee
Copy link
Member

@vlbee vlbee commented Aug 11, 2025

What does this change?

You can preview DCAR rendered pages locally on the Android Simulator. Setting up this flow raises two issues:

This looks like its related to using chrome://inpector
1/ Android app makes regular requests every second to /json/version and /json/list - these are hitting the local server dotcom-rendering/src/server/server.dev.ts which attempts to redirect them creating a non-stop stream of console logs. Changes the dev server to stop trying to redirect requests to /json/*

2/ Android simulator runs within it's own localhost sandbox. Requests to the host machine are networked via IP 10.0.2.2. This means that when serving locally rendered DCAR App Article pages, the html is trying to download the javascript for client-side hydration from src="http://localhost:3030/assets/index.client.apps.js which gets blocked by the emulator security settings: net::ERR_CLEARTEXT_NOT_PERMITTED. Rather than loosen localhost defualt security settings we can serve the the file from src="http://10.0.2.2:3030/assets/index.client.apps.js instead.

This is not the case for iOS so we need to include both html script tags on the local server. Local hydration is needed to properly test and develpt Bridget API implementations locally.

Why?

Screenshots

Before After
before after

@vlbee vlbee marked this pull request as ready for review August 11, 2025 11:51
@vlbee vlbee requested a review from a team as a code owner August 11, 2025 11:51
Copy link

Hello 👋! When you're ready to run Chromatic, please apply the run_chromatic label to this PR.

You will need to reapply the label each time you want to run Chromatic.

Click here to see the Chromatic project.

@vlbee vlbee added the run_chromatic Runs chromatic when label is applied label Aug 11, 2025
@github-actions github-actions bot removed the run_chromatic Runs chromatic when label is applied label Aug 11, 2025
@@ -123,6 +123,17 @@ export const EDITIONS_CROSSWORD_SCRIPT = getScriptRegex(

export const generateScriptTags = (scripts: string[]): string[] =>
scripts.filter(isString).map((script) => {
// Fix to run enable Bridget on local Android emulator
Copy link
Member Author

Choose a reason for hiding this comment

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

Fix to enable Bridget to run on local Android sim

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant