Skip to content

Blog: The missing prop + RemoteDataStore.of() + .fromValue()#8

Merged
oyvindberg merged 1 commit into
masterfrom
blog-values-all-the-way-down
May 20, 2026
Merged

Blog: The missing prop + RemoteDataStore.of() + .fromValue()#8
oyvindberg merged 1 commit into
masterfrom
blog-values-all-the-way-down

Conversation

@oyvindberg
Copy link
Copy Markdown
Owner

@oyvindberg oyvindberg commented Mar 21, 2026

Summary

  • Blog post: "The missing prop" — on stores-as-values, why prop drilling isn't the problem people think it is, and how explicit dependencies make testing/SSR/Storybook trivially easy
  • RemoteDataStore.fromValue(data) — convenience constructor, shorthand for RemoteDataStore.of(RemoteData.success(data))
  • Rename RemoteDataStore.always()RemoteDataStore.of() — shorter, cleaner
  • Enable Docusaurus blog with authors.yml and navbar link

Blog post structure

  1. Opens with the punchline — testing, SSR, and Storybook are the same 3-line operation when data is a prop
  2. "What we're actually talking about" — honest about stores being mutable internally; the argument is about substitutability, not FP purity
  3. The infrastructure tax — testing/Storybook/SSR complexity exists because of hidden dependencies on global systems, not because components are complex
  4. The prop drilling question — three concrete alternatives instead of hand-waving:
    • Pass ReactNode as slots (inversion of control)
    • Bundle related props into named objects (data modeling)
    • Use callbacks for child-specific data
  5. One interface, every contextUserCard can't tell the difference between a real store, a test store, or a server-rendered store
  6. Testing / Storybook / SSR / Composition — concrete code for each, including fair acknowledgment of the container/presentational counterpoint
  7. The complexity budget argument — global caches work, but are cognitive overhead most components don't need
  8. Impossible states — tagged unions vs bags of booleans
  9. Honest tradeoffs — what you give up (deduplication by default, devtools, occasional pass-through props)

API changes

// New convenience constructor
RemoteDataStore.fromValue({ name: 'Alice' })
// equivalent to: RemoteDataStore.of(RemoteData.success({ name: 'Alice' }))

// Rename
RemoteDataStore.of(RemoteData.Pending)    // was: RemoteDataStore.always(...)

Test plan

  • All 54 tests pass
  • TypeScript compiles clean
  • Blog renders in Docusaurus dev server
  • Manual: review prose

🤖 Generated with Claude Code

@oyvindberg oyvindberg changed the title Blog: Values all the way down Blog: The missing prop + RemoteDataStore.of() + .fromValue() Mar 22, 2026
@oyvindberg oyvindberg force-pushed the blog-values-all-the-way-down branch 2 times, most recently from fb695dd to f97a901 Compare May 19, 2026 23:33
Adds the first blog post and two convenience constructors used in
its examples:

- New post site/blog/2026-05-20-values-all-the-way-down.mdx,
  authors entry, and blog plugin entries in docusaurus.config.js.
- Rename RemoteDataStore.always() to RemoteDataStore.of() — more
  conventional name (mirrors Promise.of/Iterable.of style).
- Add RemoteDataStore.fromValue(data) shorthand for
  RemoteDataStore.of(RemoteData.success(data)) — the most common
  case in tests and Storybook stories.
- Update docs/landing to use the new names.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@oyvindberg oyvindberg force-pushed the blog-values-all-the-way-down branch from f97a901 to d812793 Compare May 20, 2026 21:49
@oyvindberg oyvindberg merged commit 017ff23 into master May 20, 2026
1 check passed
@oyvindberg oyvindberg deleted the blog-values-all-the-way-down branch May 20, 2026 21:56
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