Skip to content

feat: add framework docs - #272

Open
chroxify wants to merge 8 commits into
mainfrom
framework-docs
Open

feat: add framework docs#272
chroxify wants to merge 8 commits into
mainfrom
framework-docs

Conversation

@chroxify

Copy link
Copy Markdown
Contributor

No description provided.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Aug 19, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
🔵 In progress
View logs
superwall-docs 7e7e771 Aug 25 2026, 08:20 PM

@DreamingInBinary

DreamingInBinary commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Trimmed this way down, the original was far too long. Docs fixes are already pushed to the branch. What's left is code, not docs.

Restore doesn't fire transaction_complete, and the dev mock says it does

iOS restore sends .restoreComplete (TransactionManager.swift:370) and .transactionRestore (:466). .transactionComplete comes only from the purchase path (:1123). Android matches. Neither restore event exists in packages/protocol/src/messages/incoming.ts, so useSuperwallEvent("restore_complete", ...) doesn't compile.

But packages/runtime/src/mock.ts answers case "restore" with transaction_complete. So a paywall that unlocks on that event after a restore works in superwall dev and silently no-ops on device.

Two source comments say the same wrong thing, packages/runtime/src/session/index.ts:186-190 and packages/superwall/src/hooks/useActions.ts:22-25, which is probably where the docs picked it up.

transaction_fail isn't modeled, so a declined card hangs purchase()

iOS sends it. It isn't in incoming.ts, so handleIncomingMessage drops it to default: and only logs. With no purchaseTimeoutMs there's no timer either, so the promise never settles and isPurchasing stays true. The studio already renders a toast for the event.

Four smaller ones, all questions rather than claims

  • *.m4a has no declare module in assets.d.ts (*.mp3 and *.aac do), so the import fails typecheck under the scaffold's strict tsconfig. Ships fine at runtime.
  • Nothing derives --sw-background from config.background. The scaffold and all 18 examples set it by hand, so config alone leaves system Canvas over the configured color. Intentional?
  • presentation, featureGating, and onDeviceCacheEnabled are accepted by the type and never read anywhere in the monorepo. Setting them type-checks, builds, and pushes with no warning and no effect. Intentional? packages/superwall/README.md:78 says they're set in config.
  • navigation.mdx claimed back-nav restores scroll position. Non-top routes get display: none, which resets scrollTop, and I found no restoration code. I dropped the claim, but tell me if it's meant to work.

One non-docs change on the branch

Raised the prerender heap from 5120 to 8192 in package.json. The new section pushed build:cf past the old ceiling, and 6144 is the floor. Flagging since it's outside content/.

…dashes

Review pass over the new Framework section.

Overview: open by naming the alternative (the visual editor) and the job
this does, instead of leading with a feature list. Adds a "which should I
use" comparison. The section previously never mentioned the editor at all.

Claim fixes, each verified against superwall/superwall and the iOS SDK:

- Restore does not fire transaction_complete. iOS sends restoreComplete /
  transactionRestore, neither of which the framework protocol models, so
  the typed event map cannot subscribe to them. lifecycle.mdx and
  actions.mdx claimed otherwise while purchases.mdx had it right; made
  purchases.mdx canonical. Note the dev mock does answer a restore with
  transaction_complete, so this works in the studio and no-ops on device.
- transaction_fail is unmodeled, so a declined card leaves purchase()
  pending rather than resolving failed. Documented, with the advice to set
  purchaseTimeoutMs on any paywall gating UI on the awaited result.
- --sw-background was undocumented on the styling page. Nothing derives it
  from config.background; every example and the CLI scaffold set it by
  hand, so following the page as written left system Canvas painted over
  the configured color. navigation.mdx framed it as layout-conditional,
  which is true of --sw-routes-height only; split the two.
- presentation, featureGating and onDeviceCacheEnabled were called "not
  config keys". They are keys, accepted by the type and never read, so
  setting them type-checks, builds, pushes without warning and does
  nothing. Reworded to say so.
- superseded narrowed to a newer purchase for the same product reference.
- Portability warning names the first five offenders, then counts the
  rest, and offers a package registry as a second remedy.
- Declared the missing haptics binding in the restore snippet.

Prose: 385 em dashes down to 30, all of which are code samples, paywall
copy inside examples, table "none" cells, or a JSX fallback glyph.

Build: raise the prerender heap from 5120 to 8192. The section pushed the
crawl past the old ceiling; branch HEAD passed only marginally, and 6144
is the floor. 719 pages prerendered, 64 tests pass.

Findings that look like framework rather than docs bugs, including the
restore mock divergence and a missing *.m4a module declaration, are on
PR #272.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@DreamingInBinary
DreamingInBinary marked this pull request as ready for review August 25, 2026 20:23
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