Skip to content
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 implicit inclusion of types #1420

Merged
merged 1 commit into from
Apr 1, 2021
Merged

Conversation

jakub-gonet
Copy link
Member

@jakub-gonet jakub-gonet commented Apr 1, 2021

Description

Typescript includes types even if they're not explicitly imported. This behavior makes some declaration types in Gesture Handler include node's typings which isn't desired since React Native shadows some declarations from Node (e.g. setInterval).

We're utilizing types property to prevent TS from including all definitions from node_modules/@types.

Hopefully, finally fixes #1384

References

Test plan

yarn bob builded GenericTouchable.d.ts before and after:

Before

/// <reference types="node" />
import { Component } from 'react';
import { StyleProp, ViewStyle, TouchableWithoutFeedbackProps } from 'react-native';
import { GestureEvent, HandlerStateChangeEvent } from '../../handlers/gestureHandlers';
// (...)

After

import { Component } from 'react';
import { StyleProp, ViewStyle, TouchableWithoutFeedbackProps } from 'react-native';
import { GestureEvent, HandlerStateChangeEvent } from '../../handlers/gestureHandlers';
// (...)

@jakub-gonet jakub-gonet self-assigned this Apr 1, 2021
@jakub-gonet jakub-gonet merged commit 5b9a006 into master Apr 1, 2021
@jakub-gonet jakub-gonet deleted the @kuba/fix-implicit-types branch April 1, 2021 10:59
@soh335
Copy link

soh335 commented Apr 5, 2021

@jakub-gonet Can you release it ?

@TimoGlastra
Copy link

Hi when is the next release scheduled? The node type inclusion is giving me clashes with Node.JS and React Native types. Seems like this would solve it :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

This module unconditionaly includes node.d.ts for RN and this bring incorrect typings in project.
3 participants