[DevTools] Add initial APIs for logging instrumentation events under feature flag #22276
+234
−110
Conversation
|
This is a great start! Thanks for the detailed right up and for committing a no-op as a starting point. That made the review a lot easier. Added a couple of nits and thoughts, but I'm happy with this 👍🏼 |
|
@bvaughn I think i addressed all of your feedback. will land unless you have additional comments |
...s/react-devtools-shared/src/config/DevToolsFeatureFlags.extension-oss.js
Outdated
Show resolved
Hide resolved
|
Okay |
…nder feature flag
50263d3
into
facebook:main
34 checks passed
34 checks passed
ci/circleci: yarn_test--r=experimental --env=development --persistent
Your tests passed on CircleCI!
Details
ci/circleci: yarn_test--r=stable --env=development --persistent
Your tests passed on CircleCI!
Details
ci/circleci: yarn_test--r=www-classic --env=development --variant=false
Your tests passed on CircleCI!
Details
ci/circleci: yarn_test--r=www-classic --env=development --variant=true
Your tests passed on CircleCI!
Details
ci/circleci: yarn_test--r=www-classic --env=production --variant=false
Your tests passed on CircleCI!
Details
ci/circleci: yarn_test--r=www-classic --env=production --variant=true
Your tests passed on CircleCI!
Details
ci/circleci: yarn_test--r=www-modern --env=development --variant=false
Your tests passed on CircleCI!
Details
ci/circleci: yarn_test--r=www-modern --env=development --variant=true
Your tests passed on CircleCI!
Details
ci/circleci: yarn_test--r=www-modern --env=production --variant=false
Your tests passed on CircleCI!
Details
ci/circleci: yarn_test--r=www-modern --env=production --variant=true
Your tests passed on CircleCI!
Details
ci/circleci: yarn_test_build---project=devtools -r=experimental
Your tests passed on CircleCI!
Details
ci/circleci: yarn_test_build--r=experimental --env=development
Your tests passed on CircleCI!
Details
ci/circleci: yarn_test_build--r=experimental --env=production
Your tests passed on CircleCI!
Details
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Summary
This commit is being used as proposal for adding a logger (
Logger) that allows us to records events happening in the DevTools runtime. In particular, a version of this code was used for collecting profiling data to measure runtime the performance ofparseHookNames.API
The
Loggermodule exposes 2 main functions:registerEventLogger: This function allows the caller to register a callback that listens to any log events being emitted from the DevTools runtime.logEvent: This function allows the DevTools runtime to log any relevant events. The events that can be logged are statically enforced via Flow, and they can be extended to log different types of events (e.g. other performance or usage metrics).Both of these functions only work under the new DevTools feature flag:
enableLogger, and are no-ops if the flag is not enabled.As of this commit, the feature flag is completely disabled in every build, and the code being committed is only illustrating how the logger can be used: we are logging an event for measuring the duration for
parseHookNames, and we are registering a logger when initializing the DevTools extension. The registered logger is currently a no-op, and in a follow up PR we will add an implementation that actually records those events for internal builds of DevTools only (not open source builds).Test Plan