-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Description
Provide a general summary of the issue here
This one function, getOwnerWindow, references typeof global, which is only defined by @types/node (and is not a dependency).
π€ Expected Behavior?
Projects that do not build for Node should be able to use React ARIA.
π― Current Behavior
Projects that do not build for Node must install and include @types/node in order to build, due to this one function.
π Possible Solution
- Remove
typeof globaland keep it as justWindow. - Include
/// <reference types="node" />at the top of thedomHelpers.tsfile so that its definition is included in that file but not required by consumers to install project-wide.
a. Possibly add@types/nodeas a dependency of@react-aria/utils.
I prefer option 1; but if this is really needed, then please go with option 2 so that @types/node does not need to be project-wide for consumers.
π¦ Context
When using React ARIA as a dependency of a non-Node project, this creates a build error: Cannot find name 'global'..
π₯οΈ Steps to Reproduce
- Create a new project.
- Configure TypeScript to not use external types and to check libaries.
{ "compilerOptions": { "skipLibCheck": false, "typeRoots": [], "types": [] } } - Install React ARIA as a dependency.
- Import a React ARIA component.
tsc
Version
latest
What browsers are you seeing the problem on?
Other
If other, please specify.
build environment
What operating system are you using?
Linux
π§’ Your Company/Team
No response
π· Tracking Issue
No response
Metadata
Metadata
Assignees
Labels
No labels