Commit Graph

3736 Commits

Author SHA1 Message Date
Kevin Old e8ef06783a Update warning calls to use %s #2870 2015-01-26 21:39:43 -06:00
Paul O’Shannessy c6d1904f24 Merge pull request #2951 from mzabriskie/semicolon
Provide warning when using styles containing a semicolon
2015-01-26 18:32:57 -08:00
Jim c3522b80a5 Merge pull request #2920 from jsfb/move-proptype-validation
Move propType validation to element instead of class.
2015-01-26 17:21:01 -08:00
Sebastian Markbåge 46ae2f4e55 Merge pull request #2952 from sebmarkbage/typescript
Add Basic TypeScript Class Test
2015-01-26 17:19:18 -08:00
Jim 6ee5299b4a Move propType validation to element instead of class.
Conflicts:
	src/classic/element/ReactElementValidator.js
2015-01-26 17:16:49 -08:00
Sebastian Markbage f837cc289e Move component class instantiation into ReactCompositeComponent
We need to move instantiation into the mount phase for context purposes.

To do this I moved the shallow rendering stuff into ReactTestUtils and
reused more of the existing code for it by instantiating a noop child.

Everywhere we refer to the "type" we should pass it to ReactNativeComponent
to resolve any string value into the underlying composite.
2015-01-26 17:16:21 -08:00
mzabriskie ae5a124745 Using %s in warning message 2015-01-26 18:09:21 -07:00
mzabriskie fca0fdc115 Better tests 2015-01-26 18:08:51 -07:00
Sebastian Markbage 6c145c31f5 Add Basic TypeScript Class Test
As part of the new class effort it is now possible to define React
Components using any type of generic JavaScript class syntax.

This includes TypeScript classes. This test ensures that we don't regress
that support, and also serves as an example for using React in TypeScript.
TypeScript provides a good demo of where we think property initializers
are going.

We don't have any official *type* support for TypeScript yet.

This test trails the ReactES6Class-test file. Some manual tweaking is
required when converting tests.
2015-01-26 16:59:11 -08:00
mzabriskie b6edbae3fc Renaming assertValidStyle to warnValidStyle 2015-01-26 17:50:35 -07:00
mzabriskie 94fb463c06 Moar tests 2015-01-26 17:45:51 -07:00
mzabriskie 05e2bc6b5c Fixing lint failures 2015-01-26 17:41:54 -07:00
mzabriskie 4054bb13cd Provide warning when using styles containing a semicolon 2015-01-26 17:33:44 -07:00
Paul O’Shannessy 96058a10ee Merge pull request #2939 from patlaughlin/patch-1
Update 06-transferring-props.md
2015-01-26 16:32:09 -08:00
Sebastian Markbåge d750cf7401 Merge pull request #2942 from sebmarkbage/metamatchers
Add Meta Matchers for Testing Tests
2015-01-26 16:05:40 -08:00
Sebastian Markbage 3bbf6ce1a5 Add Meta Matchers for Testing Tests
This adds a matcher called toEqualSpecsIn which executes two test suites,
without reporting the result. It then compares the specs and the number
of expects executed by each spec.

This will be used to ensure that tests written in other languages test the
same thing as the base line, ES6 classes.

Sets up CoffeeScript equivalence test.
2015-01-26 15:50:57 -08:00
Sebastian Markbåge e6672a3a03 Merge pull request #2944 from sebmarkbage/coffeescript
Add CoffeeScript Class Test
2015-01-26 11:10:18 -08:00
Sebastian Markbage 5f150822e6 Add CoffeeScript Class Test
As part of the new class effort it is now possible to define React
Components using any type of generic JavaScript class syntax.

This includes CoffeeScript. This test ensures that we don't regress that
support, and also serves as an example for using React in CoffeeScript.

This test fail trails the ReactES6Class-test file. Some manual tweaking is
required when converting tests.
2015-01-26 02:19:35 -08:00
Patrick Laughlin 51e0610a62 Update 06-transferring-props.md 2015-01-25 22:03:57 -05:00
Sebastian Markbåge 4486a17c24 Merge pull request #2933 from sebmarkbage/pendingcontext
Remove _pendingContext
2015-01-24 21:54:36 -08:00
Sebastian Markbage adabfe2f49 Remove _pendingContext
There is no way to queue an update to a context so there is no need for
this field. The only way to get a new context is from above.

Soon _pendingElement will get the same treatment. Once _setPropsInternal
can be removed.
2015-01-24 20:09:14 -08:00
Sebastian Markbåge 1c90efbf7c Merge pull request #2923 from sebmarkbage/dropcomponentmixin
Replace ReactComponentMixin with ReactReconciler
2015-01-23 18:06:50 -08:00
Sebastian Markbage 690409a912 Replace ReactComponentMixin with ReactReconciler
Instead of putting the shared code in a base class method, we use a wrapper
call around all invokations. That way they're free to add code before AND
after the non-shared code.

That way we ensure that component extensions don't need to implement
ReactComponentMixin and do super() calls into it. This helps to create a
tighter API for custom component extensions.

This provides the first step towards moving these methods to static
methods which allows to use a different dispatch mechanism instead of
virtual method calls. E.g. pattern matching.
2015-01-23 17:27:42 -08:00
Ben Alpert ac7677bb11 Update .mailmap for me 2015-01-23 11:10:22 -08:00
Sebastian Markbåge 0e108b180a Merge pull request #2918 from sebmarkbage/fixcontexts
Move Component Class Instantiation into ReactCompositeComponent
2015-01-23 10:41:47 -08:00
Sebastian Markbage 9abd1133c9 Pass context to the constructor
This should reenable reading this.context from getInitialState.

Added a bunch of tests for this too.
2015-01-23 10:09:45 -08:00
Sebastian Markbage 766a79c695 Move component class instantiation into ReactCompositeComponent
We need to move instantiation into the mount phase for context purposes.

To do this I moved the shallow rendering stuff into ReactTestUtils and
reused more of the existing code for it by instantiating a noop child.

Everywhere we refer to the "type" we should pass it to ReactNativeComponent
to resolve any string value into the underlying composite.
2015-01-23 10:09:45 -08:00
Kirk Steven Hansen 3d37c95533 Typo in first commit. 2015-01-22 23:34:14 -06:00
Kirk Steven Hansen b4007e85b8 Updated tutorial to be more clear about the dependence on the --harmony flag. 2015-01-22 23:30:02 -06:00
Sebastian Markbåge 8616a6f60e Merge pull request #2919 from sebmarkbage/removecreateref
Remove React.createRef API
2015-01-22 19:13:55 -08:00
Sebastian Markbage a3a464c8fc Remove React.createRef API
This API was removed so this won't work.
2015-01-22 19:11:11 -08:00
Ben Alpert f9821de909 Merge pull request #2917 from spicyj/ref-composite
Switch first-class refs to use functions
2015-01-22 18:19:05 -08:00
Ben Alpert 322bde6eb0 Switch first-class refs to use functions
Closes #1373.

Test Plan: jest
2015-01-22 18:10:25 -08:00
Jim 734aedb977 Merge pull request #2892 from jsfb/fbme-url-for-dangerouslySetInnerHtml
Added fb.me url to error message.
2015-01-22 17:07:28 -08:00
Ben Alpert a534264c1e Merge pull request #2916 from spicyj/ref-composite
Move ref code to ReactCompositeComponent
2015-01-22 16:01:51 -08:00
Ben Alpert 9c3d6b8881 Move ref code to ReactCompositeComponent
You can only get a ref to a ReactCompositeComponent, so move the ref code here which gives us more flexibility to put it at the correct time in the lifecycle.

There should be no behavior change in this commit.

Test Plan: jest
2015-01-22 15:36:59 -08:00
Paul O’Shannessy 3d109aa11b Merge pull request #2915 from zpao/lint-fixup
Fix a couple small lint issues
2015-01-22 14:56:25 -08:00
Paul O’Shannessy c33d443c0b Fix a couple small lint issues
These aren't caught by eslint yet :(
2015-01-22 14:39:08 -08:00
Sebastian Markbåge 8a5c5ba69d Merge pull request #2913 from sebmarkbage/typewarning
Add warning when accessing .type on a component class
2015-01-22 13:39:07 -08:00
Sebastian Markbage 1ed1d7a158 Add warning when accessing .type on a component class
Since we removed the wrapper factory around classes, the class is just
the class now so there is no need for this indirection property.
2015-01-22 13:26:34 -08:00
Paul O’Shannessy 6588a84a0f Merge pull request #2765 from zpao/jsxtransformerlinenumber
Check for lineNumber support before using it
2015-01-22 12:58:51 -08:00
Jim b94adc9724 Added fb.me url to error message. 2015-01-22 12:56:52 -08:00
Paul O’Shannessy f8a214137a Merge pull request #2903 from tendant/merge-conflicts-in-translation
Update documents for Chinese translation
2015-01-22 12:55:53 -08:00
Paul O’Shannessy 92e361709c [docs] Use current date in copyright footer
This will be based on the site generation time, making doc generation
slightly less deterministic but that's ok. Now we won't depend on
helpful community members updating it for us (#2874) when we forget,
it'll just happen naturally the next time the site is generated.
2015-01-22 12:50:52 -08:00
Jim 54b565de93 Merge pull request #2518 from jsfb/documentation-for-dangerouslySetInnerHtml
Document justification for dangerouslySetInnerHTML, fixes #2256
2015-01-22 10:52:47 -08:00
Ben Alpert 76e1d5a542 Merge pull request #2902 from swestwood/patch-2
Correctly highlight changed line in tutorial.
2015-01-22 08:27:29 -08:00
Lei 943c2aa77a Add Chinese translation of reusable-components 2015-01-21 19:43:24 -08:00
Lei 833fcb6593 Add Chinese translation of multiple-components 2015-01-21 19:34:40 -08:00
Paul O’Shannessy 6247f30103 Merge pull request #2890 from amykyta/patch-1
Update 02.1-jsx-in-depth.md
2015-01-21 19:07:01 -08:00
Timothy Yung b403af192d Merge pull request #2900 from wincent/test-desc-fix
Fix inaccurate spec description
2015-01-21 18:56:33 -08:00