-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[ENG-4153]Use empty string for None values in rx.input
and rx.el.input
#4521
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
3de01d1
Use empty string for None values in `rx.input` and `rx.el.input`
ElijahAhianyo 302b810
fix tests
ElijahAhianyo 6b20287
fix pyi scripts
ElijahAhianyo 76034a1
use nullish coalescing operator
ElijahAhianyo 768e15a
fix unit tests
ElijahAhianyo 1cddb88
use ternary operator so old browsers and dynamic components tests pass
ElijahAhianyo 31462ad
address comment on doing this only for optionals
ElijahAhianyo 437d421
Fix tests
ElijahAhianyo fb8e28c
pyright!
ElijahAhianyo 7286ec5
fix comments
ElijahAhianyo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
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.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
It seems like adding a ternary to every
value
prop on every text input is a bit excessive. maybe we can checkisoptional(value._var_type)
and apply the ternary in that case.This does potentially create an issue where the Var is not typed optional, but still ends up with a
None
value, however the fix for that is to improve the annotation of the Var.I know it's probably negligible and maybe not worth optimizing for, but perhaps we should profile text field re-render time with and without a ternary in the
value
?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.
This would be great and keep the generated code simpler and faster for values which will never be None
I agree, we should not bother too much about wrongly annotated vars.
While profiling is a great idea, I think it's a bit overkill if we only do this for optional values. However, I do not want to stop anyone from doing that :D