software-mansion / react-native-gesture-handler

Declarative API exposing platform native touch and gesture system to React Native.
https://docs.swmansion.com/react-native-gesture-handler/
MIT License
6.13k stars 982 forks source link

Fix Pressable props export #3036

Closed j-piasecki closed 3 months ago

j-piasecki commented 3 months ago

Description

The current output for commonjs is

"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
Object.defineProperty(exports, "PressableProps", {
  enumerable: true,
  get: function () {
    return _PressableProps.PressableProps;
  }
});
Object.defineProperty(exports, "default", {
  enumerable: true,
  get: function () {
    return _Pressable.default;
  }
});

var _PressableProps = require("./PressableProps");

var _Pressable = _interopRequireDefault(require("./Pressable"));

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
//# sourceMappingURL=index.js.map

While PressableProps doesn't exist as it only exports types. This may be causing problems (like in Expensify atm).

This PR changes it to only export types, which are stripped resulting in

"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
Object.defineProperty(exports, "default", {
  enumerable: true,
  get: function () {
    return _Pressable.default;
  }
});

var _Pressable = _interopRequireDefault(require("./Pressable"));

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
//# sourceMappingURL=index.js.map

Test plan

Build the library and check generated files