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.
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
Remove single view assumptions from
window.dart
#38453Remove single view assumptions from
window.dart
#38453Changes from 33 commits
5f9cbb0
1f5376a
def8a49
ee1d3a3
59a1b34
559ab5c
3ef5f40
368ec15
570cc18
109c396
b08531d
d8425c2
6a8fd2e
4c659b1
48832da
9504d93
bdb74d2
4453c99
5103c3a
184e658
864a0ee
0ae4700
56e558c
278f724
ce6db62
23be98b
40922b5
75d1cbe
e8df09f
0209cf6
ec25975
8199e72
b3164c8
d42d9ec
5c2e0a9
12d4871
15ebe59
1f71e01
6d531ba
3a70482
2a4f807
9f4ac26
b2b410e
4bbd09d
82defe4
8fa153b
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Ultimately, it's up to you, but I would probably do the rename (with deprecation) in a separate PR that's dedicated to just that. That may make it easier to land these two changes and potentially roll back if there are issues.
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.
Sounds like a good idea. I'd like to address all the feedback and get an LGTM before I cherry-pick the commits from this PR into another one.
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.
Deprecate the
window
parameter in the copyWith functions as well? That one will also need to be removed at some point, right?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.
5c2e0a9
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.
copy with should do something with the window property instead of silently ignoring it.
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 probably assert that at least one of window, view is null
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.
Added 7d2ad3e.
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.
move the private field below the getter. Our style is to have the following order: getter, private field, setter. The setter may be optional, though.
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.
Sure thing.
Is that documented somewhere?
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 actually couldn't find this in the style guide, but it is something we try to follow. We should add it.
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.
Deprecate window param?
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.
5c2e0a9
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.
assert here that at most of view, window is not-null.
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.
0
seems to have a special meaning here that's not documented.The code looks like it's trying to access the "first" element in a list, but that's not what's happening.
viewData
(and previously_windows
) is a map, and the key0
is basically a special hard-coded key that's shared between here and:engine/lib/web_ui/lib/src/engine/window.dart
Lines 366 to 367 in bb40152
I suggest we make that explicit through a constant (e.g.
const int kSingletonViewId = 0
), and stop using literal0
elsewhere.(I know this existed before your PR, but I wanted to recommend it since you are working on this part of the code anyway).
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.
8fa153b