-
Notifications
You must be signed in to change notification settings - Fork 0
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
Import React Concurrent Mode Profiler #37
Conversation
Implement parallel lanes
Disable parcel caching to fix tooltips
Enable Flow in VS Code by adding flow-bin, .flowconfig and VS code settings
Based on CRA's setup.
This reverts commit e027a56.
* Move constants to constants.js * Reorg, typo fixes * Move more helper funcs to canvasUtils * Move canvas code to canvas * Move helper functions into utils * Run prettier, fix CLI script command * remove unused imports in app.js, rename utils.js * Update renderCanvas.js * prettier CLI fix, move constants to canvas
Add types for canvas files
* Upgrade Prettier * Copy React's Prettier config * Customize prettier config to allow CSS/JSON prettifying and ignore folders * yarn prettier * Downgrade to Prettier 1.19.1 and run prettier
* Copy React's ESLint config * Add ESLint etc deps and lint script Copied from React, but we also upgrade all of them except eslint-config-fbjs. * Delete all irrelevant ESLint rules * Run yarn lint --fix * Fix lint * Replace single quotes in lint stript with double quotes * Add newline at end of .eslintignore
* Add GitHub Actions workflow Adds CI workflow to run `yarn lint`, `yarn test`, and `yarn build`. `yarn flow` excluded for now as we still have many typecheck failures. Based on: - Default Node.js workflow - https://github.com/actions/cache/blob/master/examples.md#node---yarn * Prettify node.js.yml * Configure test script to pass with no tests Tests are currently failing as there are no tests in the codebase. This commit adds `--passWithNoTests` to make Jest not error. This commit should be reverted once there are tests in our codebase. * Revert "Configure test script to pass with no tests" This reverts commit bd57b9ea82328fb3765b91b7847eb99f51b7aae4. * Fix lint in new files on master
* Unexport unnecessary exported vars in src/canvas * Remove unused App.css classes * Extract CanvasPage from App.js and clean up now-non-nullable types * Wrap App in React.StrictMode * Extract automatic ImportPage from App.js * Wrap App updates in batchedUpdates
`preprocessDataV2` previously took the `ts` value of the first timeline event, following `preprocessData`. However, this is problematic with Chrome performance data, as Chrome sticks a bunch of metadata events (i.e. `ph === 'M'`) with `ts === 0`. This caused the computed React events and measures to have enormous `timestamp` values, since they were now offset from 0 instead of being offset from the first event. This commit fixes this issue by taking the `ts` value of the first event with a non-zero and non-undefined `ts`. This fix was implemented with reference to the trace event doc: https://docs.google.com/document/d/1CvAClvFfyA5R-PhYUmn5OOQtYMH4h6I0nSsKchNAySU/preview 1. V2 measures now appear correctly in WIP (not pushed) canvas with V2 data. 1. CI. Tests still passing.
Fix preprocessDataV2 to prevent enormous React timestamps
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we keep the sample profile in? It makes sense for dev purposes but they're pretty big in size, almost around the size of the whole package. Not sure how the React team would feel about it.
Good question, let's ask the React team on the final PR. I think we'll want to keep it around as the demo profile for MLH-Fellowship/scheduling-profiler-prototype#82. It's lazily loaded anyway so at least it won't bloat the main bundle |
892711a
to
42a59e6
Compare
Merged upstream: facebook#19634 |
Summary
This PR imports the concurrent mode profiler project into
packages/react-devtools-scheduling-profiler
, with history 🎉Broadly follows the approach of facebook#16381.
Resolves MLH-Fellowship/scheduling-profiler-prototype#134.
Import Details
Notes
build
andstart
scripts were failing with this error: No "exports" main resolved in @babel/helper-compilation-targets/package.json babel/babel#11216 (comment). I've followed the maintainer's recommendation and updated all@babel/*
packages across the repository, excluding fixtures. We can easily revert this if there's a better solution.css-loader
config differences can be backported into the other devtools packages later.index.html
file into thedist
folder usingHtmlWebpackPlugin
. This means that thedist
folder can be served directly, and can likely be deployed to Vercel without a need for anow.json
file.Major differences with the version in the original repo:
title
has been renamed to "React Concurrent Mode Profiler".Process
Similar to facebook#16381, the goal of this import is to preserve history from https://github.com/MLH-Fellowship/scheduling-profiler-prototype. Verified that
git log --follow
worked as expected on imported files.Prepare fork for merge
Import into React
cd ../react git remote add profiler-importable ../profiler-merge git fetch --all git checkout -b scheduling-profiler-import git merge --allow-unrelated-histories profiler-importable/importable git remote rm profiler-importable
Checklist
toWarnDev
utilityTest Plan
yarn lint
yarn test
yarn flow dom
yarn build
cd dist
serve
(using https://www.npmjs.com/package/serve)yarn start
works