Skip to content

chore: Upgrade to 2g@1.0.0 - #143

Open
kitten wants to merge 2 commits into
mainfrom
@kitten/chore/update-2g
Open

kitten wants to merge 2 commits into
mainfrom
@kitten/chore/update-2g

Conversation

@kitten

@kitten kitten commented Oct 9, 2026

Copy link
Copy Markdown
Member

See: https://github.com/kitten/2g/releases/tag/v1.0.0
Related to: expo/expo#51338

There shouldn't be an extreme breaking change in any case, but this will make metadata accessible from Expo CLI (see related PR) to the wrappers

@kitten
kitten requested review from Kudo and vonovak October 9, 2026 23:34
@kitten

kitten commented Oct 9, 2026

Copy link
Copy Markdown
Member Author

@Kudo, @vonovak: One thing I noted but didn't change is that 2g isn't externalised. It could be preferable to do this, since this would allow us to ship patches and dedupe this (there is some shared state, which uses global state, so bundling should be fine, but if we never ship the CLI as a monolithic bundle, this is probably still preferable)

@kitten

kitten commented Oct 9, 2026 •

Copy link
Copy Markdown
Member Author

Side-note, but subject to approval/alignment first. There's probably a few high-level things we may want to fix, that an agent spotted:

  • src/dev/detachAsync.ts:228 will copy process.env but if the IPC connection of the agent CLI itself (assuming it also uses 2g for debugging) is initialised in the parent, the parent IPC can die while still being on process.env
  • src/log.ts:110 and src/cli.ts:125 don't call flushEventLogger() before process.exit or with an appropriate exit hook
  • evals/tier2/cli-evidence.mjs:30 contains manual root:init checks but doesn't account for worker / child process _w markers
  • src/devLock/port.ts:21 reads output logs. This shouldn't ever be done in any case, since the format isn't part of the public API and subject to log rotation. 2g/api should be used there (but I assume that's what will be replaced with metadata.port, based on the filename)
  • some tests and evals re-implement log reading without (e.g. evals/harness/cli.ts:86, evals/run.mjs:330) instead of using 2g/api (as per above)
  • src/utils/inheritedRun.ts:72 can cause issues if we use it to spawn Expo processes as we then pass on 2g to the child, absorbing the events. That can be fine but stdout/stderr redirection may get quirky, if you're using the output
  • e2e/utils.ts:348 and packages/@expo/agent-cli/evals/harness/cli.ts:65 don't use captureEvents().spawnOptions() and instead supply LOG_EVENTS, which can then be ignored if the parent process already logs to a 2g IPC output

In general, since I can't find use of 2g/api, I'm assuming that this is a WIP and adherence can follow later, so didn't touch anything. It might be helpful to give an agent a clone of 2g while it works through this, so it can check alignment to the README and source

@Kudo

Kudo commented Oct 10, 2026

Copy link
Copy Markdown
Collaborator

Side-note, but subject to approval/alignment first. There's probably a few high-level things we may want to fix, that an agent spotted:

created a backlog task https://linear.app/expo/issue/ENG-28011/2g-follow-up

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