Extend and improve propTypes. Optimize javascript hidden classes and inline caching in V8.

Add lengthAdjust and textLength text / tspan attributes.
This commit is contained in:
Mikael Sand
2017-07-25 04:07:04 +03:00
parent 4cfdfd9bf2
commit fddb4008d1
5 changed files with 137 additions and 49 deletions
+2 -7
View File
@@ -2,7 +2,7 @@ import React from 'react';
import PropTypes from 'prop-types';
import createReactNativeComponentClass from 'react-native/Libraries/Renderer/shims/createReactNativeComponentClass';
import extractText from '../lib/extract/extractText';
import {pathProps, fontProps} from '../lib/props';
import {textProps} from '../lib/props';
import {TSpanAttibutes} from '../lib/attributes';
import extractProps from '../lib/extract/extractProps';
import Shape from './Shape';
@@ -11,12 +11,7 @@ import Shape from './Shape';
export default class extends Shape {
static displayName = 'TSpan';
static propTypes = {
...pathProps,
...fontProps,
dx: PropTypes.string,
dy: PropTypes.string,
};
static propTypes = textProps;
//noinspection JSUnusedGlobalSymbols
static childContextTypes = {
+2 -7
View File
@@ -2,7 +2,7 @@ import React from 'react';
import PropTypes from 'prop-types';
import createReactNativeComponentClass from 'react-native/Libraries/Renderer/shims/createReactNativeComponentClass';
import extractText from '../lib/extract/extractText';
import {pathProps, fontProps} from '../lib/props';
import {textProps} from '../lib/props';
import {TextAttributes} from '../lib/attributes';
import extractProps from '../lib/extract/extractProps';
import Shape from './Shape';
@@ -10,12 +10,7 @@ import Shape from './Shape';
export default class extends Shape {
static displayName = 'Text';
static propTypes = {
...pathProps,
...fontProps,
dx: PropTypes.string,
dy: PropTypes.string,
};
static propTypes = textProps;
//noinspection JSUnusedGlobalSymbols
static childContextTypes = {
+2 -9
View File
@@ -4,7 +4,7 @@ import createReactNativeComponentClass from 'react-native/Libraries/Renderer/shi
import {TextPathAttributes} from '../lib/attributes';
import extractText from '../lib/extract/extractText';
import Shape from './Shape';
import {pathProps, fontProps} from '../lib/props';
import {textPathProps} from '../lib/props';
import extractProps from '../lib/extract/extractProps';
import TSpan from './TSpan';
@@ -13,14 +13,7 @@ const idExpReg = /^#(.+)$/;
export default class extends Shape {
static displayName = 'Span';
static propTypes = {
...pathProps,
...fontProps,
href: PropTypes.string.isRequired,
method: PropTypes.oneOf(['align', 'stretch']),
spacing: PropTypes.oneOf(['auto', 'exact']),
startOffset: PropTypes.string
};
static propTypes = textPathProps;
render() {
let {children, href, startOffset, ...props} = this.props;