Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show commit priority levels in Profiler UI (if available) #274

Merged
merged 4 commits into from
May 20, 2019

Conversation

bvaughn
Copy link
Owner

@bvaughn bvaughn commented May 15, 2019

Note that this PR is blocked by React PR 15664 and unit tests are expected to fail unless using a version of React built from from the devtools-commit-priority-level branch.

What was the priority of this commit?

Some commits are high priority. Others are pre-rendering offscreen work. Up until now though, the Profiler has treated them all the same.

Here's an example app:

function PriorityLevels() {
  const [count, setCount] = useState(0);

  const startSequence = useCallback(() => {
    setCount(1);
    next(() => setCount(2));
  }, []);

  return (
    <Fragment>
      <h1>Priority Levels</h1>
      <button onClick={startSequence}>start sequence</button>
      {count >= 1 && <Text>One</Text>}
      {count >= 2 && <Text>Two</Text>}
      {count >= 2 && (
        <div hidden>
          <Text>Three</Text>
        </div>
      )}
    </Fragment>
  );
}

const Text = ({ children }) => children;

And here's what the UI could look like:
priority-Kapture 2019-05-15 at 15 21 57

@bvaughn bvaughn changed the title [WIP] Show commit priority levels in Profiler UI (do not merge) Show commit priority levels in Profiler UI (do not merge) May 19, 2019
@bvaughn bvaughn changed the title Show commit priority levels in Profiler UI (do not merge) Show commit priority levels in Profiler UI (if available) May 20, 2019
@bvaughn bvaughn force-pushed the commit-priority-level branch from 285d033 to d440380 Compare May 20, 2019 16:54
@bvaughn bvaughn merged commit f1561e9 into master May 20, 2019
@bvaughn bvaughn deleted the commit-priority-level branch May 20, 2019 16:57
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