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

New home for reliability metrics #10

Closed
wants to merge 2 commits into from

Conversation

EdmondChuiHW
Copy link

@EdmondChuiHW EdmondChuiHW commented Mar 6, 2024

Moved to #16

@EdmondChuiHW EdmondChuiHW marked this pull request as ready for review March 6, 2024 20:59
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*
* @generated by xplat/js/react-native-github/scripts/debugger-frontend/gen-type-defs.js
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whats the latest on that? Will we sync these files manually for now?

Copy link
Author

@EdmondChuiHW EdmondChuiHW Mar 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah friendship ended with with code gen, ⌘ + C is now my best friend.

Edited to "@​generated by WWW D54582949" instead. I still like the VSCode hover warning so people know this isn't the source of truth

image

* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*
* @generated by WWW D54582949
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally this should be a signedsource comment rather than a diff reference. You can put a diff reference in a text file, or just in the commit message when updating any of these files' contents. This way there would be a clear source of truth for the latest WWW diff that touches these definitions. (Especially in the case of partial updates)

Comment on lines +12 to +19
export const RNReliabilityMetrics = ((): RNReliabilityMetrics => {
function sendEvent(_event: ReactNativeChromeDevToolsEvent): void {
}

return {
sendEvent,
};
})();
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not

Suggested change
export const RNReliabilityMetrics = ((): RNReliabilityMetrics => {
function sendEvent(_event: ReactNativeChromeDevToolsEvent): void {
}
return {
sendEvent,
};
})();
export const RNReliabilityMetrics: RNReliabilityMetrics = {
sendEvent(_event: ReactNativeChromeDevToolsEvent): void {}
};

?

Also, reusing the exact same name for a type and value seems problematic.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also: How are we going to actually inject a sendEvent handler here?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This plan was for this to be a pub/sub API, so sending the actual events won't be here:

EdmondChuiHW@ecf72b6#diff-c62722ca9646ac9ec9e205faf447976c33eccbea2ce1a39791bf6f95d5041233R17

The closure style is my muscle memory for private variables + singleton; I will change it to a class + instance export instead as JS has real private fields now.

Will rework this PR to focus only on what are Reliability Metrics, how are safe defaults included, and the actual listener wiring (similar to facebook/react#22276)

@EdmondChuiHW EdmondChuiHW marked this pull request as draft March 8, 2024 23:58
hoxyq added a commit that referenced this pull request Mar 9, 2024
# Summary

Accidentally added in #10

# Test plan

N / A

# Upstreaming plan

<!-- Pick one: -->

- [ ] This commit should be sent as a patch to the upstream `devtools-frontend` repo. I've reviewed the [contribution guide](https://docs.google.com/document/d/1WNF-KqRSzPLUUfZqQG5AFeU_Ll8TfWYcJasa_XGf7ro/edit#heading=h.9kj7femz1xg5).
- [x] This commit is React Native-specific and cannot be upstreamed.
hoxyq added a commit that referenced this pull request Mar 9, 2024
# Summary

Accidentally added in #10

# Test plan

N / A

# Upstreaming plan

<!-- Pick one: -->

- [ ] This commit should be sent as a patch to the upstream `devtools-frontend` repo. I've reviewed the [contribution guide](https://docs.google.com/document/d/1WNF-KqRSzPLUUfZqQG5AFeU_Ll8TfWYcJasa_XGf7ro/edit#heading=h.9kj7femz1xg5).
- [x] This commit is React Native-specific and cannot be upstreamed.
@EdmondChuiHW EdmondChuiHW deleted the types branch March 12, 2024 01:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants