Граф коммитов

11 Коммитов

Автор SHA1 Сообщение Дата
Valentin Shergin 08d6cb19c4 RCTRefreshControl was renamed to PullToRefreshView (for Paper)
Summary:
The component RCTRefreshControl was renamed to PullToRefreshView (for Paper). Now only old Objective-C class names have the old name, which is okay.

Changelog: [Internal] [Changed] - The internal name of PullToRefresh component was changed from `RCTRefreshControl` to `PullToRefreshView` (No public API changes)

Reviewed By: rickhanlonii

Differential Revision: D17456225

fbshipit-source-id: a8db99ddd507377d8c98b26707a3b9fae483d20c
2019-10-14 20:49:48 -07:00
Eli White 1b4eaeb184 Migrate NativeComponentType from codegenNativeComponent to HostComponent #1
Summary:
We need to migrate to HostComponent, this is the first batch.

Changelog:
[Internal] Migrate NativeComponentType from codegenNativeComponent to HostComponent

Reviewed By: rickhanlonii

Differential Revision: D17562879

fbshipit-source-id: ce1993b64a79cede3598c89ddff0dadf07fde92f
2019-09-25 11:44:38 -07:00
Logan Daniels 9127fb51fc Manual fixes for xplat/js/react-native-github
Summary:
Need to add explicit type annotations in these areas to unblock types-first architecture for Flow. These are locations the codemod could not automatically handle.

I'll call out areas I need a close eye on in the comments.

Reviewed By: panagosg7

Differential Revision: D16659053

fbshipit-source-id: 167dd2abe093019b128676426374c1c62cf71e7f
2019-08-09 10:11:15 -07:00
Michał Osadnik 61e95e5cbf Force WithDefault not to be an optional value
Summary:
`WithDefault` appears not to be required to be prefixed with `?` because it's option value per se.

Fixed tests, removed `?` where needed, updated snapshots and review them. Added mechanism fro throwing error when `?WithDefault` found. Add tests for it.

Reviewed By: rubennorte

Differential Revision: D16048463

fbshipit-source-id: f55ed7454aacf0b8c42944a9b5c1037ad1b360fe
2019-07-02 03:30:55 -07:00
Michał Osadnik 75d01075d4 Allow primitivies without default values
Summary:
It's not needed to keep required providing default values even if they are not actually relevant.

Here I add a support for `null`, `0` of `false` instead by default and remove throwing errors if no other default value provided.

Reviewed By: rubennorte

Differential Revision: D16049047

fbshipit-source-id: bc4961af3873190568f2753fc4ec975354896df5
2019-07-01 07:51:25 -07:00
Michał Osadnik 0f83dfab8e Transform BubbleEvent and DirectEvent into DirectEventHandler and BubblingEventHandler
Summary:
It appears that `(e: BubblingEvent<T>) = mixed` exists only in given context and it's pointless to keep in this way. It could be simplified to `BubblingEventHandler<T>` without any negative consequences and that's the motivation of this diff.

The only tradeoff of this decision is leaving an opportunity to declare Bubbling/Direct event in the top of the file bc then analysing the code becomes much more difficult. However, it's not used anywhere so it's not a problem now and probably any time.

Also, changes the names to `DirectEventHandler` and `BubblingEventHandler` which are more related to current state. The names were updated in many places in code.

Reviewed By: rubennorte

Differential Revision: D16054571

fbshipit-source-id: 741d075eb46b80bac8eb73a6b30fc0b448cb3902
2019-07-01 05:13:53 -07:00
Rick Hanlon 0cb512f536 Fix PullToRefresh onRefresh event
Summary: The onRefresh event is a DirectEvent not a BubblingEvent

Reviewed By: PeteTheHeat

Differential Revision: D15969475

fbshipit-source-id: 049a6ffc74306246e8dbc3acdce5b0b26e849fc7
2019-06-24 11:57:13 -07:00
Rick Hanlon 940a7d5a51 s/PullToRefresh/PullToRefreshView
Summary: Renames PullToRefresh to PullToRefreshView to correct a previous mistake so that this matches the Schema file

Reviewed By: cpojer

Differential Revision: D15960975

fbshipit-source-id: 575e526df2efdfa260f3cbbb4b0764998a91ade0
2019-06-24 04:59:13 -07:00
Rick Hanlon b063c41782 Generate PullToRefreshView
Summary: Adds the codgen types and generated view config for PullToRefresh

Reviewed By: TheSavior

Differential Revision: D15900138

fbshipit-source-id: ee2c179317749182aaf6d3b90c8379ce06a82b9c
2019-06-21 03:35:40 -07:00
Rick Hanlon efec97f2be Add view config babel plugin
Summary:
This diff adds a babel plugin for the generated view configs which will inline them in the file instead of needing to check the view configs in (fb only)

The way it works is:
- babel reads the code
- looks for type alias `CodegenNativeComponent` in `*NativeComponet.js` files
- run the flow parser on the file source to create a schema
- run the schema into codegen to get the view config source code
- inject the generated source code back into the NativeComponent.js file
- remove the original export
- profit

After this diff we will remove the `js1 build viewconfigs` command and the checked-in NativeViewConfig.js files

Note: since this plugin is not published to open source, for now OSS will continue using the `requireNativeComponent` function

Reviewed By: cpojer

Differential Revision: D15516062

fbshipit-source-id: a8efb077773e04fd9753a7036682eeaae9175e09
2019-06-07 12:31:36 -07:00
Rick Hanlon 9f8305a837 Add view config for PullToRefresh
Summary:
Adds the generated view config for PullToRefresh

Note: we're not using this view config yet, the component is in the process of being renamed (see TODO)

Reviewed By: rubennorte

Differential Revision: D15485870

fbshipit-source-id: a163ac371181dcc990093e3cd995d7dd9058b26a
2019-05-24 09:21:28 -07:00