Commit Graph

30 Commits

Author SHA1 Message Date
Ian Mobley
adb4937be9 move filename back to newline 2018-04-02 19:42:46 -07:00
Ian Mobley
d1713bc842 Convert react-loadable/webpack test to commonJS
It doesn't look like destructuring will work when using require.
2018-04-02 19:27:04 -07:00
Ian Mobley
fac20c19eb quotes consistency 2018-04-02 10:10:57 -07:00
Ian Mobley
781b4af34b Convert to match commonJS export syntax.
I'm not entirely sure how to get the interfaces to export as well, but
they're not really necessary beside for checking sanity of arguments.
2018-04-02 09:06:19 -07:00
Ian Mobley
2af878bd6b Add types for ReactLoadablePlugin, getBundles 2018-04-01 16:13:26 -07:00
Andy Hanson
45c9246c09 Remove esModuleInterop from tsconfigs (no longer mandatory) 2018-02-14 14:55:13 -08:00
Forbes Lindesay
8f8f6c4392 [react] Use HTMLDialogElement for the dialog node (#23053)
* [react] Use HTMLDialogElement for the dialog node

* Actually add the `open` property

* This update requires typescript 2.6

* Update dependents of react to also require typescript 2.6
2018-02-12 12:55:52 +00:00
Andy
2a9d2f8d59 Convert more "import *" to "import =" (#23446) 2018-02-05 18:27:31 -08:00
Andy
bef4d2b27d Enable "esModuleInterop" in all tsconfigs (#23354) 2018-02-05 11:01:56 -08:00
Tomek Łaziuk
5f07b0f39b [react-loadable] ability to import types which were unavailable (#23218)
* import/export

* contributors

* fix namespace
2018-01-31 12:15:55 -08:00
Ian Ker-Seymer
9f041991c6 Make react-loadable export an assignment (#22340)
* Make react-loadable export an assignment

`react-loadable` does *not* actually have a default export. This can be shown
by running:

```
> var L = require('react-loadable')
undefined
> L
{ [Function: Loadable]
  Map: [Function: LoadableMap],
  Capture:
   { [Function: Capture]
     propTypes: { report: [Function: bound checkType] },
     childContextTypes: { loadable: [Function: bound checkType] } },
  preloadAll: [Function],
  preloadReady: [Function] }
```

As a result, when attempting to use this with commonjs modules, an error error
is thrown when `allowSyntheticDefaultExports` is set.

```
TypeError: react_loadable_1.default is not a function
```

This PR exports the module as an assignment, so now `import * as Loadable from
'react-loadable'` should be used to import the module.

I am not entirely sure that I have used the best pattern for typings here; but
my goal was to export the proper assignment yet still allow all of the
namespace to be accessible via `(i.e.) Loadable.LoadingComponentProps`. If there
is a better way, please let me know and I will be happy to adjust!

* Use import assignment in react-loadable tests
2018-01-10 10:13:35 -08:00
Sami Jaber
054b82ad16 fix JSDoc formatting 2017-11-23 14:23:16 -05:00
Sami Jaber
00cf286abb react-loadable - add types of new SSR features 2017-11-23 13:24:43 -05:00
Andy
947a8fb761 Enable strictFunctionTypes (#20373) 2017-10-06 14:03:03 -07:00
Andy
ccdb9e03d1 Add tslint disables for no-unnecessary-generics (#19564) 2017-09-05 09:14:04 -07:00
Andy
5d6c651a1a Apply stricter lint rules (#19063) 2017-08-17 14:53:41 -07:00
Diogo Franco
2b0d0375e6 Add react-loadable TS2.4 tests (#17965)
* Add tests using import() to react-loadable

* Fix lint errors in react-loadable tests

* Add comment to react-loadable to clarify a common issue
2017-07-31 14:48:19 -07:00
Diogo Franco (Kovensky)
ce695b0743 Revert "Make render optional in react-loadable"
This reverts commit 668fb871ae.
2017-07-12 14:21:06 +09:00
Mohsen Azimi
668fb871ae Make render optional in react-loadable
Reference: https://github.com/thejameskyle/react-loadable#example
2017-07-10 10:45:41 -07:00
John Reilly
07352da21a Merge pull request #17288 from tkrotoff/react-default-type-arguments
Change React.Component<P, S> to React.Component<P = {}, S = {}>
2017-06-22 19:18:47 +01:00
Diogo Franco
127d50604e Add missing type annotation 2017-06-21 18:31:26 +09:00
Diogo Franco
9b9e8dd26d react-loadable: Only default is a valid key by default
Having it be an indexed type prevents use with dynamic import.
2017-06-21 17:44:16 +09:00
Tanguy Krotoff
b81d97133a Merge branch 'master' into react-default-type-arguments 2017-06-20 22:39:06 +02:00
Tanguy Krotoff
ea9de8a518 Replace React.Component<(.*), (any|void|\{\}|null)> by React.Component<$1>
+ many manual adjustments
2017-06-19 13:35:50 +02:00
Tanguy Krotoff
eeb262e1d8 Update react to TypeScript 2.3 2017-06-19 13:34:54 +02:00
Oden
0554c5aa25 Fix missed replacement. 2017-06-19 01:11:35 -07:00
Oden
081c004d03 Fix Map loader docs. 2017-06-19 00:28:21 -07:00
Oden
294e98d261 Use React.ComponentType 2017-06-19 00:24:18 -07:00
Oden
f10aa9bbdc Update react-loadable types for v4.
Changes: https://github.com/thejameskyle/react-loadable/pull/46
2017-06-16 20:21:58 -07:00
Diogo Franco
bf2a72285c Add type definitions for react-loadable (#16118)
* Add definitions for react-loadable

* Add react-loadable/babel

* Add explicit export
2017-04-26 08:05:55 -07:00