Skip to content

feat(devvit): split inline and expanded starter surfaces - #44

Merged
imjlk merged 4 commits into
mainfrom
codex/devvit-surface-starter
Jul 12, 2026
Merged

imjlk merged 4 commits into
mainfrom
codex/devvit-surface-starter

Conversation

@imjlk

@imjlk imjlk commented Jul 12, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • add a reusable Devvit web-surface router behind the adapter boundary
  • generate separate lightweight inline preview and expanded Phaser documents
  • keep the reference starter, generated template, Devvit manifest, smoke verifier, and agent workflow in sync

Validation

  • pnpm check
  • pnpm --dir adapters/devvit test
  • pnpm --dir examples/phaser-starter build
  • pnpm build:devvit
  • pnpm smoke:target reddit
  • Open Code Review on 402e8bb: 7 comments addressed
  • Open Code Review on 30b2b45: 0 comments

Release

Includes a Sampo changeset for a minor @mpgd/adapter-devvit release and a patch @mpgd/cli release.

Summary by CodeRabbit

  • New Features
    • Added Devvit surface routing with inline/expanded mode selection and a fallback when mode detection is unavailable.
    • Exposed new public web-surface entrypoints for Devvit (surface and web) and added a browser-focused surface starter.
    • Updated Phaser starter templates to use separate inline preview and expanded game pages, with a Play action to open the expanded surface.
  • Documentation
    • Updated Devvit/Phaser starter READMEs and acceptance/brief guidance for the new split entrypoint behavior.
  • Tests
    • Added unit tests for routing, fallback behavior, and async loader ordering.
    • Added browser/dist import checks and starter workflow/build-artifact validation.

@coderabbitai

coderabbitai Bot commented Jul 12, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: bddb56f1-1fde-4d24-a3a4-2cff5dc7856c

📥 Commits

Reviewing files that changed from the base of the PR and between 30b2b45 and e3fe06f.

📒 Files selected for processing (7)
  • adapters/devvit/package.json
  • adapters/devvit/src/web.test.ts
  • adapters/devvit/src/web.ts
  • adapters/devvit/test/web-dist-import.mjs
  • examples/phaser-starter/src/platform/devvitEntrypoint.ts
  • packages/cli/templates/phaser-game/src/platform/devvitEntrypoint.ts
  • tools/validate-starter-workflow.ts
🚧 Files skipped from review as they are similar to previous changes (5)
  • adapters/devvit/src/web.ts
  • examples/phaser-starter/src/platform/devvitEntrypoint.ts
  • packages/cli/templates/phaser-game/src/platform/devvitEntrypoint.ts
  • adapters/devvit/package.json
  • tools/validate-starter-workflow.ts

📝 Walkthrough

Walkthrough

Adds reusable Devvit web-surface routing, browser wrappers, and public adapter entrypoints. Phaser starter builds now produce separate inline and expanded documents, with matching CLI templates, Devvit mappings, preview UI, and validation for generated artifacts.

Changes

Devvit surface API

Layer / File(s) Summary
Adapter surface API
adapters/devvit/..., tsconfig.base.json
Adds mode-aware routing, browser helpers, public exports, aliases, dependency wiring, and tests for inline, expanded, fallback, and async behavior.

Starter dual-surface wiring

Layer / File(s) Summary
Starter dual-surface wiring
apps/target-devvit/..., examples/phaser-starter/...
Adds separate index.html and game.html entries, conditional loading, inline preview rendering, styling, Devvit mappings, and dual-entry Vite output.

CLI template parity

Layer / File(s) Summary
CLI template parity
packages/cli/templates/phaser-game/...
Mirrors the split surface entrypoints, preview UI, Devvit configuration, build output, documentation, acceptance guidance, and workflow metadata.

Surface contract validation

Layer / File(s) Summary
Surface contract validation
tools/..., .sampo/...
Validates expanded artifacts and manifest mappings, checks starter/template surface contracts, and records package release changes.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant InlineDocument
  participant DevvitEntrypoint
  participant DevvitWebSurface
  participant PreviewUI
  participant GameDocument
  InlineDocument->>DevvitEntrypoint: load /src/entry.ts
  DevvitEntrypoint->>DevvitWebSurface: startDevvitWebSurface(...)
  DevvitWebSurface->>PreviewUI: mount inline preview
  PreviewUI->>GameDocument: request expanded game entry
  GameDocument->>GameDocument: load /src/gameEntry.ts
  GameDocument->>GameDocument: dynamically import Phaser main
Loading

Possibly related PRs

  • imjlk/mpgd-kit#4: Both changes update Devvit web artifact requirements in tools/smoke/verify-target-artifacts.ts.
  • imjlk/mpgd-kit#24: Both changes extend Devvit manifest validation for the expanded game entry and built client/game.html.

Poem

A rabbit hops where previews glow,
No Phaser bundle loads below.
One button bounds to games afar,
A second page becomes the star.
Two surfaces leap clean and bright!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: splitting inline and expanded Devvit starter surfaces.
Description check ✅ Passed The description covers Summary and Validation well, but the template's Notes section is missing.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/devvit-surface-starter

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 30b2b451f0

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread adapters/devvit/src/web.ts Resolved
@imjlk

imjlk commented Jul 12, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 30b2b451f0

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread adapters/devvit/src/web.ts Resolved
@imjlk

imjlk commented Jul 12, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Delightful!

Reviewed commit: eb8786fa0c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@imjlk

imjlk commented Jul 12, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: eb8786fa0c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread adapters/devvit/src/web.ts Resolved
@imjlk

imjlk commented Jul 12, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🎉

Reviewed commit: e3fe06fc88

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@imjlk
imjlk merged commit 2f51b58 into main Jul 12, 2026
6 checks passed
@imjlk
imjlk deleted the codex/devvit-surface-starter branch July 15, 2026 13:41
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.

1 participant