Skip to content

Conversation

@spmonahan
Copy link
Contributor

@spmonahan spmonahan commented Aug 16, 2023

Previous Behavior

Lint rules allow access to global window and document objects in the React eslint config.

New Behavior

Lint rules disallow access to global window and document objects in the React eslint config. This PR primarily affects FUIv8 (@fluentui/react) but also has some changes for FUIv9 (@fluentui/react-components).

The gist of this change is that React components should always get references to window and document via context rather than accessing the global directly. However, to preserve existing behavior we will still always fall back to accessing the globals if necessary.

For Fluent v8 I've introduced some new helpers:

  1. useDocumentEx/WindowEx(): This is a thin wrapper over useDocument/Window(), that aligns the types of these hooks with accessing document/window directly (i.e., these new wrappers won't returned undefined according to their types). This allows these hooks to be a easy drop-in replacement for document or window direct access.
  2. getDocumentEx/WindowEx(): Same as the hooks above but for reading from class component Context.

All React components have been updated to use these helpers. Non-React utility code has been updated to take document/window parameters as needed and fallback to the existing getDocument()/getWindow() utility functions if necessary. In some cases we still directly access document/window in fallback cases to avoid cyclic dependencies.

Related Issue(s)

@spmonahan spmonahan requested a review from a team as a code owner August 16, 2023 17:38
@github-actions github-actions bot added this to the August Project Cycle Q4 2023 milestone Aug 16, 2023
@spmonahan
Copy link
Contributor Author

spmonahan commented Aug 16, 2023

What I've seen from running this locally:

v8

Enabling this reveals 84 issues. NOTE: most issues only have a single link provided despite having multiple issues. Run yarn workspace @fluentui/react lint to see all the issues.

AutoFill.tsx

Used to test focus.

ChoiceGroup.

Used to look for focus.

Coachmark

Used to register for events and read measurements.

Also used to test DOM relationships.

ColorRectangle

Used to register for events

ComboBox

Used for focus management

DetailsList

Used for focus management

DocumentCard

Used for window management.

And event subscriptions

Dropdown

Used for setTimeout and focus management

FocusTrapZone

Used for event management

KeytipLayer

Used for event management

And querying for elements

List

Used for events

MarqueeSelection

Used to query the DOM

Nav

document.createElement()

OverflowSet

Used for focus management

Panel

Used for event management

ScrollablePane

Used for event management

SelectedItemsList

DOM manipulation

Slider

Event management

Sticky

Focus management

SwatchColorPicker

Focus management

Tooltip

devicePixelRatio

This is interesting because devicePixelRatio will likely be the same in many cases but for users with multiple monitors different windows may have different values.

Focus management

BasePicker

Focus management

DraggableZone

Event management

cssColor

Style computation

positioning

Measurement

SelectionZone

Event management

v9

Most issues are in Storybook stories. We could exclude stories from this lint rule but it seems to me stories are a good place to use this feature since they are documentation.

react-shared-contexts

ProviderContext references document but this is probably something we'd add an exception for since it's falling back to a default value for the context value others should consume.

react-tree

createHTMLElementWalker should probably be updated to get document via context.

react-utilities

canUseDOM references window and document (well window.document). This may also be an exception because we only care about the existence of the globals here and don't do anything with them. For a multi-window scenario this code should present no problems because both windows will have the global values.

useOnClickOutside has two instances of window (1, 2) that should be updated.

@fabricteam
Copy link
Collaborator

fabricteam commented Aug 16, 2023

Perf Analysis (@fluentui/react-components)

No significant results to display.

All results

Scenario Render type Master Ticks PR Ticks Iterations Status
Avatar mount 627 656 5000
Button mount 332 327 5000
Field mount 1113 1123 5000
FluentProvider mount 711 714 5000
FluentProviderWithTheme mount 83 86 10
FluentProviderWithTheme virtual-rerender 64 63 10
FluentProviderWithTheme virtual-rerender-with-unmount 75 72 10
MakeStyles mount 842 868 50000
Persona mount 1771 1722 5000
SpinButton mount 1376 1381 5000

@codesandbox-ci
Copy link

codesandbox-ci bot commented Aug 16, 2023

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit fe4085f:

Sandbox Source
@fluentui/react 8 starter Configuration
@fluentui/react-components 9 starter Configuration

@fabricteam
Copy link
Collaborator

fabricteam commented Aug 16, 2023

Perf Analysis (@fluentui/react-northstar)

Perf tests with no regressions
Scenario Current PR Ticks Baseline Ticks Ratio
ListNestedPerf.default 336 296 1.14:1
PortalMinimalPerf.default 90 81 1.11:1
AccordionMinimalPerf.default 83 77 1.08:1
ButtonSlotsPerf.default 313 292 1.07:1
AvatarMinimalPerf.default 114 108 1.06:1
ListWith60ListItems.default 382 359 1.06:1
TextAreaMinimalPerf.default 299 281 1.06:1
AlertMinimalPerf.default 160 153 1.05:1
BoxMinimalPerf.default 195 186 1.05:1
FormMinimalPerf.default 226 215 1.05:1
LabelMinimalPerf.default 218 207 1.05:1
RadioGroupMinimalPerf.default 263 251 1.05:1
TextMinimalPerf.default 204 195 1.05:1
MenuMinimalPerf.default 499 479 1.04:1
CarouselMinimalPerf.default 265 258 1.03:1
DialogMinimalPerf.default 445 431 1.03:1
DropdownManyItemsPerf.default 393 382 1.03:1
HeaderMinimalPerf.default 207 200 1.03:1
ListMinimalPerf.default 306 298 1.03:1
ReactionMinimalPerf.default 206 200 1.03:1
AnimationMinimalPerf.default 300 295 1.02:1
ButtonMinimalPerf.default 88 86 1.02:1
FlexMinimalPerf.default 155 152 1.02:1
ItemLayoutMinimalPerf.default 717 700 1.02:1
MenuButtonMinimalPerf.default 958 937 1.02:1
RosterPerf.default 1569 1543 1.02:1
SegmentMinimalPerf.default 195 191 1.02:1
SkeletonMinimalPerf.default 201 197 1.02:1
IconMinimalPerf.default 383 374 1.02:1
TableManyItemsPerf.default 1104 1083 1.02:1
TreeWith60ListItems.default 87 85 1.02:1
ButtonOverridesMissPerf.default 631 627 1.01:1
ChatMinimalPerf.default 429 423 1.01:1
DatepickerMinimalPerf.default 3515 3473 1.01:1
DropdownMinimalPerf.default 1428 1417 1.01:1
LayoutMinimalPerf.default 201 199 1.01:1
SplitButtonMinimalPerf.default 2252 2221 1.01:1
TooltipMinimalPerf.default 1266 1248 1.01:1
TreeMinimalPerf.default 473 469 1.01:1
ChatDuplicateMessagesPerf.default 153 153 1:1
ProviderMergeThemesPerf.default 632 630 1:1
SliderMinimalPerf.default 715 717 1:1
StatusMinimalPerf.default 397 396 1:1
CardMinimalPerf.default 319 323 0.99:1
CheckboxMinimalPerf.default 1122 1137 0.99:1
GridMinimalPerf.default 186 188 0.99:1
HeaderSlotsPerf.default 451 454 0.99:1
InputMinimalPerf.default 519 524 0.99:1
PopupMinimalPerf.default 339 343 0.99:1
TableMinimalPerf.default 235 237 0.99:1
CustomToolbarPrototype.default 1443 1452 0.99:1
ToolbarMinimalPerf.default 520 526 0.99:1
DividerMinimalPerf.default 200 204 0.98:1
EmbedMinimalPerf.default 1806 1852 0.98:1
LoaderMinimalPerf.default 183 187 0.98:1
ProviderMinimalPerf.default 191 194 0.98:1
RefMinimalPerf.default 111 115 0.97:1
AttachmentMinimalPerf.default 81 84 0.96:1
AttachmentSlotsPerf.default 609 635 0.96:1
ChatWithPopoverPerf.default 181 192 0.94:1
ImageMinimalPerf.default 209 222 0.94:1
ListCommonPerf.default 366 390 0.94:1
VideoMinimalPerf.default 421 465 0.91:1

@fabricteam
Copy link
Collaborator

fabricteam commented Aug 16, 2023

📊 Bundle size report

Package & Exports Baseline (minified/GZIP) PR Change
react-calendar-compat
Calendar Compat
141.324 kB
36.821 kB
141.128 kB
36.799 kB
-196 B
-22 B
react-menu
Menu (including children components)
140.176 kB
43.004 kB
140.248 kB
43.039 kB
72 B
35 B
react-menu
Menu (including selectable components)
142.862 kB
43.51 kB
142.934 kB
43.545 kB
72 B
35 B
react-popover
Popover
119.46 kB
37.714 kB
119.538 kB
37.754 kB
78 B
40 B
Unchanged fixtures
Package & Exports Size (minified/GZIP)
global-context
createContext
510 B
330 B
global-context
createContextSelector
537 B
342 B
priority-overflow
createOverflowManager
4.341 kB
1.81 kB
react-accordion
Accordion (including children components)
92.983 kB
28.418 kB
react-badge
Badge
27.264 kB
8.808 kB
react-badge
CounterBadge
28.165 kB
9.101 kB
react-badge
PresenceBadge
25.67 kB
9.313 kB
react-button
Button
40.074 kB
11.292 kB
react-button
CompoundButton
47.43 kB
12.787 kB
react-button
MenuButton
44.848 kB
12.668 kB
react-button
SplitButton
52.862 kB
14.254 kB
react-button
ToggleButton
57.122 kB
13.194 kB
react-card
Card - All
92.955 kB
26.977 kB
react-card
Card
87.781 kB
25.462 kB
react-card
CardFooter
13.423 kB
5.481 kB
react-card
CardHeader
15.666 kB
6.235 kB
react-card
CardPreview
14.374 kB
5.854 kB
react-checkbox
Checkbox
37.505 kB
12.327 kB
react-dialog
Dialog (including children components)
94.473 kB
28.28 kB
react-divider
Divider
21.179 kB
7.839 kB
react-field
Field
22.788 kB
8.639 kB
react-image
Image
16.096 kB
6.317 kB
react-input
Input
27.247 kB
9.194 kB
react-jsx-runtime
Classic Pragma
1.049 kB
531 B
react-jsx-runtime
JSX Dev Runtime
4.14 kB
1.741 kB
react-jsx-runtime
JSX Runtime
4.734 kB
1.983 kB
react-label
Label
14.508 kB
5.857 kB
react-link
Link
17.4 kB
6.977 kB
react-message-bar
MessageBar (all components)
25.54 kB
9.102 kB
react-overflow
hooks only
12.598 kB
4.754 kB
react-portal
Portal
12.4 kB
4.541 kB
react-positioning
usePositioning
25.305 kB
9.162 kB
react-progress
ProgressBar
17.788 kB
6.986 kB
react-provider
FluentProvider
22.831 kB
8.429 kB
react-radio
Radio
31.266 kB
10.267 kB
react-radio
RadioGroup
15.704 kB
6.35 kB
react-select
Select
28.968 kB
10.269 kB
react-slider
Slider
38.349 kB
12.595 kB
react-spinbutton
SpinButton
37.133 kB
11.856 kB
react-spinner
Spinner
23.762 kB
8.556 kB
react-switch
Switch
33.731 kB
10.899 kB
react-text
Text - Default
17.065 kB
6.645 kB
react-text
Text - Wrappers
20.237 kB
6.965 kB
react-textarea
Textarea
31.306 kB
10.549 kB
react-theme
Single theme token import
69 B
89 B
react-theme
Teams: all themes
34.611 kB
7.295 kB
react-theme
Teams: Light theme
19.282 kB
5.486 kB
react-toast
Toast (including Toaster)
92.725 kB
27.876 kB
react-tooltip
Tooltip
52.466 kB
18.466 kB
react-utilities
SSRProvider
180 B
159 B
🤖 This report was generated against fccf16cffd5a6833a5232a543815f5146d886439

@size-auditor
Copy link

size-auditor bot commented Aug 16, 2023

Asset size changes

Project Bundle Baseline Size New Size Difference
office-ui-fabric-react fluentui-react-ShimmeredDetailsList 235.752 kB 236.485 kB ExceedsBaseline     733 bytes
office-ui-fabric-react fluentui-react-DetailsList 225 kB 225.717 kB ExceedsBaseline     717 bytes
office-ui-fabric-react fluentui-react-Pickers 285.568 kB 286.254 kB ExceedsBaseline     686 bytes
office-ui-fabric-react fluentui-react-Dropdown 225.518 kB 226.18 kB ExceedsBaseline     662 bytes
office-ui-fabric-react fluentui-react-CommandBar 195.406 kB 196.046 kB ExceedsBaseline     640 bytes
office-ui-fabric-react fluentui-react-Panel 192.784 kB 193.394 kB ExceedsBaseline     610 bytes
office-ui-fabric-react fluentui-react-ComboBox 243.086 kB 243.695 kB ExceedsBaseline     609 bytes
office-ui-fabric-react fluentui-react-MarqueeSelection 71.512 kB 72.119 kB ExceedsBaseline     607 bytes
office-ui-fabric-react fluentui-react-KeytipLayer 98.432 kB 99.03 kB ExceedsBaseline     598 bytes
office-ui-fabric-react fluentui-react-Keytips 101.186 kB 101.781 kB ExceedsBaseline     595 bytes
office-ui-fabric-react fluentui-react-ColorPicker 127.848 kB 128.409 kB ExceedsBaseline     561 bytes
office-ui-fabric-react fluentui-react-SwatchColorPicker 184.315 kB 184.817 kB ExceedsBaseline     502 bytes
office-ui-fabric-react fluentui-react-Dialog 203.272 kB 203.738 kB ExceedsBaseline     466 bytes
office-ui-fabric-react fluentui-react-TimePicker 233.283 kB 233.744 kB ExceedsBaseline     461 bytes
office-ui-fabric-react fluentui-react-SelectedItemsList 224.864 kB 225.31 kB ExceedsBaseline     446 bytes
office-ui-fabric-react fluentui-react-FloatingPicker 234.458 kB 234.884 kB ExceedsBaseline     426 bytes
office-ui-fabric-react fluentui-react-Breadcrumb 194.308 kB 194.734 kB ExceedsBaseline     426 bytes
office-ui-fabric-react fluentui-react-Facepile 204.22 kB 204.643 kB ExceedsBaseline     423 bytes
office-ui-fabric-react fluentui-react-DocumentCard 209.31 kB 209.731 kB ExceedsBaseline     421 bytes
office-ui-fabric-react fluentui-react-Nav 181.676 kB 182.093 kB ExceedsBaseline     417 bytes
office-ui-fabric-react fluentui-react-Coachmark 88.68 kB 89.05 kB ExceedsBaseline     370 bytes
office-ui-fabric-react fluentui-react-PersonaCoin 109.94 kB 110.307 kB ExceedsBaseline     367 bytes
office-ui-fabric-react fluentui-react-Persona 109.94 kB 110.307 kB ExceedsBaseline     367 bytes
office-ui-fabric-react fluentui-react-Tooltip 82.46 kB 82.827 kB ExceedsBaseline     367 bytes
office-ui-fabric-react fluentui-react-PositioningContainer 69.889 kB 70.243 kB ExceedsBaseline     354 bytes
office-ui-fabric-react fluentui-react-GroupedList 131.161 kB 131.483 kB ExceedsBaseline     322 bytes
office-ui-fabric-react fluentui-react-GroupedListV2 118.849 kB 119.171 kB ExceedsBaseline     322 bytes
office-ui-fabric-react fluentui-react-DraggableZone 33.04 kB 33.345 kB ExceedsBaseline     305 bytes
office-ui-fabric-react fluentui-react-Modal 89.885 kB 90.171 kB ExceedsBaseline     286 bytes
office-ui-fabric-react fluentui-react-ChoiceGroup 63.054 kB 63.339 kB ExceedsBaseline     285 bytes
office-ui-fabric-react fluentui-react-DatePicker 178.312 kB 178.594 kB ExceedsBaseline     282 bytes
office-ui-fabric-react fluentui-react-ExtendedPicker 94.788 kB 95.041 kB ExceedsBaseline     253 bytes
office-ui-fabric-react fluentui-react-OverflowSet 30.791 kB 31.044 kB ExceedsBaseline     253 bytes
office-ui-fabric-react fluentui-react-Sticky 31.867 kB 32.113 kB ExceedsBaseline     246 bytes
office-ui-fabric-react fluentui-react-Color 7.498 kB 7.737 kB ExceedsBaseline     239 bytes
office-ui-fabric-react fluentui-react-ThemeGenerator 12.106 kB 12.34 kB ExceedsBaseline     234 bytes
office-ui-fabric-react fluentui-react-TeachingBubble 198.371 kB 198.599 kB ExceedsBaseline     228 bytes
office-ui-fabric-react fluentui-react-ContextualMenu 149.395 kB 149.62 kB ExceedsBaseline     225 bytes
office-ui-fabric-react fluentui-react-Grid 174.346 kB 174.569 kB ExceedsBaseline     223 bytes
office-ui-fabric-react fluentui-react-ButtonGrid 174.346 kB 174.569 kB ExceedsBaseline     223 bytes
office-ui-fabric-react fluentui-react-SearchBox 181.41 kB 181.633 kB ExceedsBaseline     223 bytes
office-ui-fabric-react fluentui-react-SpinButton 185.089 kB 185.312 kB ExceedsBaseline     223 bytes
office-ui-fabric-react fluentui-react-MessageBar 183.035 kB 183.258 kB ExceedsBaseline     223 bytes
office-ui-fabric-react fluentui-react-Pivot 182.68 kB 182.903 kB ExceedsBaseline     223 bytes
office-ui-fabric-react fluentui-react-Button 188.601 kB 188.811 kB ExceedsBaseline     210 bytes
office-ui-fabric-react fluentui-react-ScrollablePane 53.331 kB 53.538 kB ExceedsBaseline     207 bytes
office-ui-fabric-react fluentui-react-Keytip 76.957 kB 77.157 kB ExceedsBaseline     200 bytes
office-ui-fabric-react fluentui-react-Slider 55.4 kB 55.575 kB ExceedsBaseline     175 bytes
office-ui-fabric-react fluentui-react-List 37.758 kB 37.929 kB ExceedsBaseline     171 bytes
office-ui-fabric-react fluentui-react-WeeklyDayPicker 98.664 kB 98.816 kB ExceedsBaseline     152 bytes
office-ui-fabric-react fluentui-react-Rating 78.892 kB 79.043 kB ExceedsBaseline     151 bytes
office-ui-fabric-react fluentui-react-Calendar 118.623 kB 118.774 kB ExceedsBaseline     151 bytes
office-ui-fabric-react fluentui-react-FocusZone 53.163 kB 53.313 kB ExceedsBaseline     150 bytes
office-ui-fabric-react fluentui-react-Callout 79.208 kB 79.355 kB ExceedsBaseline     147 bytes
office-ui-fabric-react fluentui-react-FocusTrapZone 15.643 kB 15.775 kB ExceedsBaseline     132 bytes
office-ui-fabric-react fluentui-react-Utilities 71.577 kB 71.697 kB ExceedsBaseline     120 bytes
office-ui-fabric-react fluentui-react-HoverCard 92.178 kB 92.281 kB ExceedsBaseline     103 bytes
office-ui-fabric-react fluentui-react-Selection 41.107 kB 41.202 kB ExceedsBaseline     95 bytes
office-ui-fabric-react fluentui-react-ResponsiveMode 7.967 kB 8.058 kB ExceedsBaseline     91 bytes
office-ui-fabric-react fluentui-react-KeytipData 13.522 kB 13.585 kB ExceedsBaseline     63 bytes
office-ui-fabric-react fluentui-react-Positioning 21.148 kB 21.203 kB ExceedsBaseline     55 bytes
office-ui-fabric-react fluentui-react-Viewport 22.933 kB 22.945 kB ExceedsBaseline     12 bytes
office-ui-fabric-react fluentui-react-DragDrop 8.393 kB 8.343 kB BelowBaseline     -50 bytes

ExceedsTolerance Over Tolerance (1024 B) ExceedsBaseline Over Baseline BelowBaseline Below Baseline New New Deleted  Removed 1 kB = 1000 B

Baseline commit: 4dc9e5be60b6ce6f3f6c72c6da39bf19a504f524 (build)

@fabricteam
Copy link
Collaborator

fabricteam commented Aug 16, 2023

🕵 fluentuiv9 No visual regressions between this PR and main

@fabricteam
Copy link
Collaborator

fabricteam commented Aug 16, 2023

Perf Analysis (@fluentui/react)

No significant results to display.

All results

Scenario Render type Master Ticks PR Ticks Iterations Status
BaseButton mount 630 639 5000
Breadcrumb mount 1658 1688 1000
Checkbox mount 1675 1723 5000
CheckboxBase mount 1450 1475 5000
ChoiceGroup mount 2854 2885 5000
ComboBox mount 642 660 1000
CommandBar mount 6223 6110 1000
ContextualMenu mount 12035 12106 1000
DefaultButton mount 729 759 5000
DetailsRow mount 2211 2125 5000
DetailsRowFast mount 2191 2164 5000
DetailsRowNoStyles mount 1985 2007 5000
Dialog mount 2797 2607 1000
DocumentCardTitle mount 230 223 1000
Dropdown mount 2007 1989 5000
FocusTrapZone mount 1105 1143 5000
FocusZone mount 1067 1064 5000
GroupedList mount 41609 41452 2
GroupedList virtual-rerender 17769 19829 2
GroupedList virtual-rerender-with-unmount 50501 50593 2
GroupedListV2 mount 233 230 2
GroupedListV2 virtual-rerender 214 215 2
GroupedListV2 virtual-rerender-with-unmount 225 225 2
IconButton mount 1070 1060 5000
Label mount 329 337 5000
Layer mount 2711 2665 5000
Link mount 401 402 5000
MenuButton mount 934 932 5000
MessageBar mount 21292 21253 5000
Nav mount 1906 1940 1000
OverflowSet mount 775 787 5000
Panel mount 2036 1787 1000
Persona mount 742 730 1000
Pivot mount 860 882 1000
PrimaryButton mount 818 852 5000
Rating mount 4580 4506 5000
SearchBox mount 896 917 5000
Shimmer mount 1855 1858 5000
Slider mount 1305 1322 5000
SpinButton mount 2840 2803 5000
Spinner mount 384 401 5000
SplitButton mount 1797 1828 5000
Stack mount 400 410 5000
StackWithIntrinsicChildren mount 884 867 5000
StackWithTextChildren mount 2630 2604 5000
SwatchColorPicker mount 6184 6118 5000
TagPicker mount 1464 1459 5000
Text mount 364 365 5000
TextField mount 938 911 5000
ThemeProvider mount 826 812 5000
ThemeProvider virtual-rerender 589 575 5000
ThemeProvider virtual-rerender-with-unmount 1282 1260 5000
Toggle mount 626 602 5000
buttonNative mount 194 191 5000

'@griffel/hook-naming': 'error',
'@griffel/no-shorthands': 'error',
'@griffel/styles-file': 'error',
'no-restricted-globals': [
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Probably worth considering being more restrictive. I don't believe these rules prohibit using requestAnimationFrame for example.

Window API

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Follow up question: how should we get a reference to window and document?

Fluent ships a WindowProvider package that is a React context with two hooks: useWindow() and useDocument(). This package can be used with either Fluent v8 or v9 (or anything else for that matter).

Fluent v9 has a useFluent() hook that provides access to "targetDocument". This method is specific to Fluent v9.

While useFluent() does not provide a way to get a "targetWindow", document.defaultView provides a way to access the window object for a document so perhaps we already have everything we need. This needs further investigation.

@layershifter
Copy link
Member

v9

react-shared-contexts

ProviderContext references document but this is probably something we'd add an exception for since it's falling back to a default value for the context value others should consume.

Yes, this should be an exception.

react-tree

createHTMLElementWalker should probably be updated to get document via context.

Good catch, indeed. FYI @bsunderhus

react-utilities

canUseDOM references window and document (well window.document). This may also be an exception because we only care about the existence of the globals here and don't do anything with them. For a multi-window scenario this code should present no problems because both windows will have the global values.

Yes, this should be an exception.

useOnClickOutside has two instances of window (1, 2) that should be updated.

  • getWindowEvent(window) we should be careful there (as it's not very well tested thing), but probably it should be updated
  • window.setTimeout should be updated

FYI @ling1726

@spmonahan
Copy link
Contributor Author

@layershifter

Based on

window.setTimeout should be updated

are you of the opinion that we should disallow direct access to any Window API (e.g., requestAnimationFrame, etc)?

@layershifter
Copy link
Member

are you of the opinion that we should disallow direct access to any Window API (e.g., requestAnimationFrame, etc)?

I don't think that we have this issue anymore, but sometime ago we had an issue when "root" document was not actually displayed and some timers (requestAnimationFrame ?) were not fired properly. However, I have not seen any reports related to this in v9.

For now, we probably can keep it as it i.e do nothing. Does it make sense?

@spmonahan spmonahan force-pushed the lint/disallow-window-and-document branch 2 times, most recently from c233dc2 to fe4085f Compare October 31, 2023 23:24
@spmonahan
Copy link
Contributor Author

Closing in favor of #30063 and #29962

@spmonahan spmonahan closed this Dec 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants