-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
fix: Update ExtractedNodeRequestData to include valid query_params for tracesSampler #3715
Conversation
I think the safer change would be to fix the implementation in
It should not pass |
size-limit report
|
Not sure how feasible it is, so cc @lobsterkatie @AbhiPrasad @iker-barriocanal |
The And it has the downside of forcing users to check the type in runtime before using it, because you can get 1 of 3 types... harder to use than our original state. |
@rhcarvalho - The type change was made to match the unified SDK spec. If we can only pass it as a string, we'll have to artificially construct a string of the form Thoughts?
For any given framework, it should always be the same type, so no type-checking ought to be necessary. Can you think of an instance where that wouldn't be true? |
An object is easier to deal with than a query string, and if the spec allows it... |
Yes, an object might be easy to work with, but a union type not as much. Because it is not always an object, user code needs to handle all possible types. |
The spec is what Relay accepts, doesn't necessarily mean that SDKs should send data in all possible types.
Hmm, I don't think that's the case in TS. See https://www.typescriptlang.org/play?#code/GYVwdgxgLglg9mABMAFAQwE4HMBciDOUGMYWiAPgUSVgNoC6DFiA3orQNYCmAnnocVL1+1UgG5EAXwCUrAFCJFiCAnxwANlwB06uFnTYtJACZcAHgHlUAcjTXp0sXMly5oSLASJ9mXFUFYsiwKSipgapo6egZYRmCmljZ2Dk4ubijWAFZoYFwwGHD2Tvq2AF55UFxFrkA function f(arg: string | string[][] | { [key: string]: string; }) {
console.log(arg.indexOf('a'));
}
function g(arg: string) {
console.log(arg.indexOf('a'));
}
f('janeiro');
g('azeite');
So even though you expect that under certain circumstances (e.g. in |
My comments just reflect my views on usability and compatibility, but I don't have a strong stance on this, please feel free to disagree and move on with any decision. |
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.
I say we go with it and revisit only if someone complains.
Fixes #3714
Fwiw we should somehow unify
ExtractedNodeRequestData
andRequest
types, as they are almost identical.It should™ be a non-breaking change, as the broader type includes
string
and it's never used directly by the user.