preactjs / preactjs/preact-devtools

Display "Context updated" as a rerender reason

Open
#471 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
345
Forks
39
PR merge metrics
No merged PRs in 30d

Description

My understanding is that when a component updates because of a context change (e.g. Context.Consumer rerenders), the devtools will show "Force updated" since internally that is how Preact propagates context changes.

It'd be nice if devtools instead could show something like "Context updated" instead, and if using modern context maybe even which context updated (e.g. show the context ID?)

This might be harder to do in V10 but perhaps in v11 we could have a CONTEXT_UPDATE flag that devtools can read to show the correct render reason?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No files or tests are named. Start by tracing how devtools identifies and displays rerender reasons for Context.Consumer updates, then determine how a distinct context-update signal could be exposed in the relevant Preact version. Done means context-triggered renders display "Context updated" rather than "Force updated", with the context ID only if the design supports it.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
devtools
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.