Commit Graph

33 Commits

Author SHA1 Message Date
Adlai Holler 0f440130b6 Standardize project indentation settings on 2 spaces
Summary:
Hi React Native folks! Love your work!

To make contributing easier, this sets the indentation settings of all the Xcode projects to 2 spaces to match their contents.
Closes https://github.com/facebook/react-native/pull/15275

Differential Revision: D5526462

Pulled By: javache

fbshipit-source-id: cbf0a8a87a1dbe31fceed2f0fffc53839cc06e59
2017-07-31 05:20:03 -07:00
Liu Zhanhong 6b29fe78c4 Avoid creating a new Path instance for performance
Summary:
New a Path instance will cause a slice call to exist path.

```js
// react-native/Libraries/ART/ARTSerializablePath.js
if (path instanceof SerializablePath) {
  this.path = path.path.slice(0);
}
```

Most of d3's APIs can set context when we don't want to use d3's build-in path object. And in RN envirenment, we must use RN's path instance. So we can use RN's path as a context in d3 avoiding doing conversions from svg's path string to arrays. But with existing code, when Shape receive a `d` proprety, it new a path instance and will cause calling slice in a very large array.

Typical usage is as follows

```js
import React from 'react';
import { View, ART } from 'react-native';
import { line } from 'd3-shape';
import { scaleLinear } from 'd3-scale';

const { Path, Surface, Shape } = ART;
const width = 360;
const height = 300;
const data = [5,2,7,6,9,1,8,4,3];
const x = scaleLinear().range([0, width]).domain([0, data.length]);
const y = scaleLinear().range([height, 0]).domain([0, 9]);
const myline = line()
    .x(function(d, i) {
      return x(i);
    })
    .y(function(d) { return y(d); });

// use RN's ART Path
const path = Path();
myline.context(path)(data);

class TestArt extends React.Component {
  render() {
    return (
      <View>
        <Surface width={width} height={height}>
          <Shape
            stroke="red"
            d={
              // use RN's ART Path
              path
              // use d3's path
              // myline(data)
            }
          />
        </Surface>
      </View>
    );
  }
}
```
Closes https://github.com/facebook/react-native/pull/14551

Differential Revision: D5398653

Pulled By: javache

fbshipit-source-id: 1264acfb8844b60584604a664e0474f9e212d1d1
2017-07-11 11:18:56 -07:00
david 7cddaa02d6 call toString on fontWeight else throws error if passed an integer
Summary:
expects a string, throws error NSNumber cannot be converted to NSString if passed an integer, added toString() method to allow integers, and keep consistency, fontSize allows int.
Closes https://github.com/facebook/react-native/pull/10483

Differential Revision: D5128581

Pulled By: shergin

fbshipit-source-id: 21b1ddd35210c8f061506d71b936cc0ff490d999
2017-05-25 01:34:53 -07:00
Daniel Farrell 32eab54781 Apple TV Support: Add tvOS build support for ART library
Summary:
The ART library backend did not get build support for tvOS when other libraries did.  We are writing an application that will run on tvOS, and wanted to use ART, so it was important to have this. This PR adds that build support.

Verified that this builds and works on tvOS simulator for development of this project.
Closes https://github.com/facebook/react-native/pull/12547

Differential Revision: D4925864

Pulled By: lacker

fbshipit-source-id: f72c650d7620e9c7f59d9ae68cfc39f0e7bab12b
2017-04-20 16:15:38 -07:00
Brian Vaughn 6564edce5e Ran PropTypes -> prop-types codemod against Libraries/FBReactKit/js/react-native-github
Reviewed By: acdlite

Differential Revision: D4876709

fbshipit-source-id: 3a5e92bfc74287b7a9054546c438580bed0147af
2017-04-12 16:15:15 -07:00
Mike Grabowski 6feffe1de0 Better error for ART <Group />
Summary: Fixes #3815

Differential Revision: D4295976

Pulled By: javache

fbshipit-source-id: 034690d3bee75217d820d3361136a410a812cd2c
2016-12-07 17:13:42 -08:00
Pieter De Baets 59407f3660 Redo exported headers and include paths for opensource
Summary:
Xcode really sucks, per some discussion on e1577df1fd and https://developer.apple.com/library/content/technotes/tn2215/_index.html, if you use the headers phase, and mark headers in your static library as public, they will actually end up in the final package that's built and you can't submit to the app store! This changes our xcode setup to use a copy files phase instead.

I've also changed the header include path to be $(BUILT_PRODUCTS_DIR)/include, which is added to the include path by Xcode by default, so 3rd party libraries should not be impacted by these changes anymore.

Reviewed By: mkonicek

Differential Revision: D4291607

fbshipit-source-id: 969b9ebcbeb8161f85427f8c429e198d9d0fae30
2016-12-07 15:28:29 -08:00
Pieter De Baets 5ee8b41d56 Remove REACT_HEADERS from RN BUCK file
Reviewed By: emilsjolander

Differential Revision: D4231819

fbshipit-source-id: 78c1316d8e2bd8d9c0947b1c1c4dc857b74824ae
2016-12-05 10:43:33 -08:00
David Aurelio 3683beb88a RN: Update React (2/2)
Reviewed By: kentaromiura

Differential Revision: D4026114

fbshipit-source-id: 67808af91454d95941fea01eef58a4d9086f46e1
2016-11-04 05:43:44 -07:00
Pieter De Baets 07553d0f1c Update React Native minimum OS version to iOS8
Reviewed By: majak

Differential Revision: D3723143

fbshipit-source-id: 482f9820370b752d937e6df7f74c33d53a0a2e7d
2016-09-01 19:43:47 -07:00
Pieter De Baets c5a44b7ca3 Move font helpers to RCTFont
Reviewed By: majak

Differential Revision: D3662804

fbshipit-source-id: 2c03a094a74c617c0d6172e327bd77d23d0d44c2
2016-08-05 12:44:20 -07:00
Ben Alpert a2fb703bbb Convert from React.createClass to ES6 classes
Reviewed By: cpojer

Differential Revision: D3619143

fbshipit-source-id: e14e81468d467437ee3d79c34c34b7780a46ca1c
2016-07-26 01:13:31 -07:00
David Aurelio bd60d828c5 Remove `node_modules/react` from the list of discoverable haste modules
Summary: This removes `node_modules/react` from the list of directories that are used for haste module resolutions. Modules required from React are now imported with `require('react/lib/…')`.

Reviewed By: astreet

Differential Revision: D3509863

fbshipit-source-id: 32cd34e2b8496f0a6676dbe6bb1eacc18124c01e
2016-07-05 06:44:33 -07:00
Nick Lockwood b0fed416cb Fixed ART views
Summary: Fixed ART views, which were broken by the zIndex diff

Reviewed By: wwjholmes

Differential Revision: D3403679

fbshipit-source-id: cc3cdccd19c21223ce6bddeda3d914937ecb73b6
2016-06-08 00:13:30 -07:00
Scott Foggo 50d6de9448 Check if either array is null before diffing
Reviewed By: sebmarkbage

Differential Revision: D3219392

fb-gh-sync-id: fd6ef2e2c2d7b661a06c857b25b007701340e20a
fbshipit-source-id: fd6ef2e2c2d7b661a06c857b25b007701340e20a
2016-04-25 13:28:31 -07:00
Sebastian Markbage 0db5439892 Update the Spectrum downstream and add the new cloneWithProps dependency
Reviewed By: aglemann

Differential Revision: D3167482

fb-gh-sync-id: b8c9933e629b049b15f9ebaf885817086866893b
fbshipit-source-id: b8c9933e629b049b15f9ebaf885817086866893b
2016-04-13 17:11:38 -07:00
Scott Foggo 24f03af0c3 Implement clipping rectangle for ReactNativeART
Reviewed By: sebmarkbage, taomin

Differential Revision: D3140869

fb-gh-sync-id: 0da27705c4cfca7a1fcae12eed11a7335a62631f
fbshipit-source-id: 0da27705c4cfca7a1fcae12eed11a7335a62631f
2016-04-11 19:19:17 -07:00
Nick Lockwood 336984214f Fixed ART background color
Summary:
public
Disabling background color propagation had the unexpected effect of turning ART views black. This diff re-enabled propagation for ART views.

Reviewed By: jingc

Differential Revision: D2816402

fb-gh-sync-id: f2a4c44f3b4a16e04cbf6051391bb8fb1c0a7ed2
2016-01-08 15:42:32 -08:00
James Ide 90c8f37c39 Mark `-[init]` w RCT_NOT_IMPLEMENTED
Summary: ARTBrush.m doesn't defined init but Clang wants it.

Fix #2590
Closes https://github.com/facebook/react-native/pull/2592

Reviewed By: svcscm

Differential Revision: D2656454

Pulled By: nicklockwood

fb-gh-sync-id: c386adfadc30c5a0b642b60d3b7e1991481f1fb9
2015-11-14 06:29:27 -08:00
Brent Vatne 0da2004e88 Expose additional private modules
Summary: - TextInputState as TextInput.State
- Touchable
- flattenStyle as StyleSheet.flatten
- ReactNativeART as ART

Original discussion in #1821
Closes https://github.com/facebook/react-native/pull/3308

Reviewed By: sebmarkbage

Differential Revision: D2527152

Pulled By: javache

fb-gh-sync-id: 19d4ef9d4c0e6587b9f0793e1ca624aebb034f3b
2015-11-05 03:35:18 -08:00
Nick Lockwood c5b990f65f Added lightweight generic annotations
Summary: public

Added lightweight genarics annotations to make the code more readable and help the compiler catch bugs.

Fixed some type bugs and improved bridge validation in a few places.

Reviewed By: javache

Differential Revision: D2600189

fb-gh-sync-id: f81e22f2cdc107bf8d0b15deec6d5b83aacc5b56
2015-11-03 14:49:30 -08:00
Tadeu Zagallo ccd90e25c1 Convert remaining uses of alloc] init] to new]
Summary: public

We moved to using `new` instead of `alloc] init` but there was still some calls
left.

Reviewed By: javache

Differential Revision: D2604679

fb-gh-sync-id: ff7300ecbedb55dd5e93873592598810c9b87808
2015-11-02 08:03:17 -08:00
Nick Lockwood deba13f698 Refactor RCTUIManager
Summary:
Moved the view creation & property binding logic out of RCTUIManager into a separate RCTComponentData class - this follows the pattern used with the bridge.

I've also updated the property  binding to use pre-allocated blocks for setting the values, which is more efficient than the previous system that re-contructed the selectors each time it was called. This should improve view update performance significantly.
2015-08-06 15:49:35 -08:00
Vladislav Alexeev 53fb5b6cee Dynamic Text Sizes for Text component
Summary:
Dynamic Text Sizes for Text component.
Text gains new prop - allowFontScaling (false by default).
There is also AccessibilityManager module that allows you to tune multipliers per each content size category.
2015-07-31 07:42:41 -08:00
Kevin Gozali 2e9d156fad [ReactNative] revert D2233419: 'Dynamic Text Sizes for Text component' 2015-07-14 15:55:06 -08:00
Vladislav Alexeev be2cabc3f8 Dynamic Text Sizes for Text component
Summary:
Dynamic Text Sizes for Text component.
Text gains new prop - allowFontScaling (true by default).
There is also AccessibilityManager module that allows you to tune multipliers per each content size category, but predefined multipliers are there.
This could potentially break some apps so please test carefully.
2015-07-14 03:13:32 -08:00
Nick Lockwood 9229eadff0 Fixed ART Text
Summary:
ART text was crashing due to a bug in the release logic.
2015-07-10 08:31:21 -08:00
Alex Akers aba148061f [React Native] Re-alphabetize file names in Xcode projects
Summary:
Fixes my OCD problems.
2015-07-06 01:57:06 -08:00
Nick Lockwood 5d154f1af4 Fixed deployment targets for React iOS submodules 2015-06-10 06:16:15 -08:00
Spencer Ahrens 11b515b1b0 [ReactNative] clean lint in all of Libraries/ 2015-05-19 13:47:04 -08:00
Krzysztof Magiera ff00e1496c [ReactNative] Rename ReactIOS JS module (and relatives) to ReactNative. 2015-05-13 13:24:35 -07:00
Ben Alpert 63ab6e8281 [react-native] Remove iOS-specific attributes from ART text 2015-04-30 13:23:16 -08:00
Ben Alpert c6af33e796 [react-native] Open-source ReactART for native 2015-04-29 15:21:48 -08:00