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

chore(cli): skip starting dev server in exports #28552

Merged
merged 32 commits into from
May 30, 2024

Conversation

EvanBacon
Copy link
Contributor

@EvanBacon EvanBacon commented Apr 30, 2024

Why

With static rendering we changed the CLI to start a dev server so we could ping it for resources. This prevents us from running tests in parallel and dilutes error handling as we have to parse them back from server requests.

This PR forks part of the metro dev server .bundle request into Expo CLI so we can call it directly for SSR instead of going through the dev server. We then skip starting the dev server in order to prevent using any ports.

We have to leave some of the legacy SSR code in place to support the error boundary (pending rework).

In the future we can consolidate more by removing all metro export interface code in favor of this code path, but we don't need to do that in this PR.

How

  • Consolidate export code from SPA-styled exports and SSR imports.
  • Remove all SSR error translation code since we now throw errors directly in-process.
  • Remove all port freeing code since export no longer starts a server.e

Test Plan

Test coverage for this is very high, hopefully tests run a bit faster now.

Checklist

@expo-bot expo-bot added the bot: suggestions ExpoBot has some suggestions label Apr 30, 2024
@expo-bot expo-bot added bot: passed checks ExpoBot has nothing to complain about and removed bot: suggestions ExpoBot has some suggestions labels May 10, 2024
Copy link

socket-security bot commented May 10, 2024

No dependency changes detected. Learn more about Socket for GitHub ↗︎

👍 No dependency changes detected in pull request

@EvanBacon EvanBacon marked this pull request as ready for review May 10, 2024 02:40
@EvanBacon EvanBacon requested a review from byCedric as a code owner May 10, 2024 02:40
@byCedric
Copy link
Member

For reference, this PR shows why we need to skip the server in exports #28605

@EvanBacon EvanBacon merged commit 6368262 into main May 30, 2024
11 checks passed
@EvanBacon EvanBacon deleted the @evanbacon/cli/direct-metro-srr branch May 30, 2024 18:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bot: fingerprint compatible bot: passed checks ExpoBot has nothing to complain about
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants