dev-docs/RFCs/proposals/pr-preview-demos-rfc.md
This RFC proposes adding PR-specific demo and preview functionality to deck.gl, making it easier for reviewers to test changes without needing to clone branches and run examples locally.
Currently, when a PR author wants to provide a testable demo for reviewers, they have several suboptimal options:
This creates friction for both authors and reviewers. As @felixpalmer noted:
"There is value in providing an easy way for reviewers to test, but it also needs to not introduce friction for the author of the PR."
This RFC presents several approaches that could be implemented independently or in combination.
A GitHub Action that deploys a preview of the deck.gl website when triggered.
Label-triggered deployment of the full deck.gl website for a PR branch. See PR #10019 for implementation details.
Mechanism:
pull_request_target events (labeled, unlabeled, synchronize, reopened, closed)website.yml (yarn bootstrap + website build with API keys)pr-preview/pr-{number}/Pros:
Cons:
A template example (e.g., examples/code-review/) that when modified as part of a PR:
Mechanism:
examples/code-review/Pros:
Cons:
Use CodePen/CodeSandbox that consumes a deck.gl bundle built from the PR.
Mechanism:
Pros:
Cons:
Automatically deploy the relevant "Browser" example when related modules are updated.
Layer Browser: When layer modules are updated (modules/layers/, modules/geo-layers/, etc.), deploy the Layer Browser.
Basemap Browser: When basemap modules are updated (modules/mapbox/, modules/google-maps/), deploy the Basemap Browser.
Mechanism:
Pros:
Cons:
| Option | Pros | Cons |
|---|---|---|
| GitHub Pages | Free, integrated | Single branch limitation, cleanup complexity |
| Cloudflare Pages | Fast, generous free tier | Additional service to manage |
| Vercel | Easy setup, preview URLs built-in | May have limits for open source |
| Netlify | Similar to Vercel | May have limits for open source |
For any deployment approach, we need to handle cleanup:
pull_request_target allows access to secrets but runs in context of base branch