Commit Graph
2106 Commits
Author SHA1 Message Date
Ben Alpert 382be4e9e9 Improve error for nested render calls
In the future we could consider wrapping the entire public API (renderComponent, setProps, setState, etc) in this check but this should do for now.

Test Plan: grunt test
2014-04-12 15:37:48 -07:00
Cheng LouandPaul O’Shannessy 8855d6153e Revamp and fix PropTypes
This uses the return value (an Error or nothing) to indicate whether a prop passes validation or not. It used to be done through calling `console.warn` as a side-effect, except this didn't work well with and `oneOfType`, which calls each validator.

The solution was to insert a `.weak` prop to each validator to suppress the warning message. This is overkill and also doesn't work well in because it increases the potential API surface. Plus, letting the validators warn it can't be easily used for logging, especially for custom validators.

So `.weak` is no longer needed: fixes https://github.com/facebook/react/issues/863.

Backward compatibility for custom validators: since they didn't return anything and directly call `console.warn` or something, this doesn't break them.

Improvements:

  - `arrayOf`, `oneOfType` and `oneOf` got better message now, since they can get hold of their validator's message and output that instead of a generic `warning: bla`.
  - More complete tests, including testing custom types and `isRequired` on everything.

Bug fixes:

  - oneOfType(...).isRequired didn't work. The workaround was to use `oneOfType(a.isRequired, b.isRequired, ...)`. This means `oneOfType(a.isRequired, b)` doesn't make sense. The new version simply makes `oneOfType(...).isRequired` possible.
  - `oneOf([true])` worked for 'true' boolean because it converted everything to string before comparing. It no longer does.
- `oneOf([true]).isRequired` didn't work.

(see #1294)
2014-04-09 18:50:53 -07:00
Cheng LouandPaul O’Shannessy 5a9d0c6a12 Update invalid render error message
forgot to update the message following the previous diff on rendering null.
2014-04-09 18:50:11 -07:00
Tim YungandPaul O’Shannessy 356e85cd6a Separate performanceNow into own project 2014-04-09 18:50:11 -07:00
Josh YudakenandPaul O’Shannessy 5c9d616735 Add start property that is used by the <ol> tag
Property was missing
2014-04-09 17:50:34 -07:00
Ben Alpert 4f1ca0ee96 Merge pull request #1381 from marcinkwiatkowski/master
fix typo in 09.4-test-utils.md
2014-04-09 10:05:40 -07:00
Paul O’Shannessy bff6d50796 Merge pull request #1364 from spicyj/key-collisions-2
Ignore children with clashing keys
2014-04-08 18:11:36 -07:00
Marcin Kwiatkowski 5167b7a5b2 fix typo in 09.4-test-utils.md 2014-04-09 01:31:02 +01:00
Paul O’Shannessy debd3318c7 Merge pull request #1379 from fkling/patch-1
Update 05-reusable-components.md
2014-04-08 15:45:19 -07:00
Felix Kling af79caf1aa Update 05-reusable-components.md
`any` also seems to accept primitive values, not only objects. And since we already have `React.PropType.object`, the description was confusing.
2014-04-08 15:43:24 -07:00
Christopher Chedeau 009be62906 Document multiple ways to insert comments in JSX 2014-04-08 15:24:09 -07:00
Paul O’Shannessy ccafb030cb Merge pull request #813 from spicyj/e-view-detail
Normalize view and detail properties
2014-04-08 14:23:46 -07:00
Ben Alpert 348399a594 Let early returns do their thing 2014-04-08 14:08:16 -07:00
Ben Alpert 4d62e1ef59 Don't fail if target.ownerDocument is null
See f71dbab.
2014-04-08 14:08:16 -07:00
Ben Alpert 5fa001b12c Normalize view and detail properties 2014-04-08 14:08:16 -07:00
Cheng LouandPaul O’Shannessy f0f59877aa Make rendering to null work and make it injectable
This allows render to return `null`. Under the hood, this renders a `script` tag.

closes #1127
2014-04-08 10:12:18 -07:00
Paul O'ShannessyandPaul O’Shannessy af3c04b43b Warn better for key issues
We weren't warning for key issues at the top level (renderComponent)
level at all. This makes us do that, even if it's not quite perfect.

closes #1351
2014-04-07 18:18:50 -07:00
Karl MikkelsenandPaul O’Shannessy f0a8a397ac Link to Events from Forms
closes #1372
2014-04-07 17:47:41 -07:00
Paul O’Shannessy 127e964808 Merge pull request #1362 from spicyj/cb-queue
Make MountReady more reusable, reduce allocations
2014-04-07 15:46:34 -07:00
Paul O’Shannessy 7f9ab471ac Merge pull request #1365 from akre54/unminified-docs-js
Serve unminified react.js on docs site
2014-04-07 15:42:50 -07:00
Ben Alpert 216fcdeb42 Ignore children with clashing keys
Fixes #566.
2014-04-07 13:50:42 -07:00
Paul O’Shannessy 40cbc074ee Move complementary tools to wiki for easier management. 2014-04-07 12:56:38 -07:00
Pete Hunt b75d11c603 Merge pull request #1356 from petehunt/server-rendering-example2
React server rendering example
2014-04-08 07:27:58 +12:00
Ben Alpert 6cafc638fa Don't forcibly wrap lines in git commit messages 2014-04-06 23:17:51 -07:00
Adam Krebs a6211a0fd8 Serve unminified react on docs site. Fixes #1359 2014-04-07 02:13:59 -04:00
Ben Alpert ec6da04f6a Make MountReady more reusable, reduce allocations
Test Plan:
grunt test
2014-04-06 17:06:12 -07:00
petehunt 9a78db3457 Initial add
Add readme

remove gitignore

fix graphic
2014-04-04 18:47:33 -07:00
Daniel Lo NigroandBen Alpert 21de5c816f ReactJS.NET blog post
Closes #1354.
2014-04-04 13:23:24 -07:00
Ben Alpert ed0ef164c0 Fix appearance of code blocks in lists 2014-04-04 12:55:43 -07:00
Jeff Morrison 9c2b9b1eb6 Merge pull request #970 from syranide/jsxws
Normalize whitespace for transformed JSX code
2014-04-04 10:20:43 -07:00
Paul O’Shannessy 0617696ae4 Merge pull request #1251 from davidxi/patch-1
Update jasmine-support.js
2014-04-03 18:41:59 -07:00
Paul O’Shannessy ed6f8aea77 Merge pull request #1258 from fisherwebdev/master
TodoMVC Flux Example
2014-04-03 15:10:42 -07:00
Paul O’Shannessy 4f6800c2a4 Merge pull request #1306 from twobit/master
Add dx and dy attributes for SVG text
2014-04-03 15:05:44 -07:00
Paul O’Shannessy 00aa33446b Merge pull request #1325 from venmo/add-scrolling-attribute
Add scrolling attribute for <iframe>
2014-04-03 09:56:07 -07:00
Paul O’Shannessy 079749bac6 Merge pull request #1338 from chenglou/tip-children
[Docs][Tips] Entry on this.props.children and tweak component ref entry
2014-04-03 09:30:53 -07:00
Paul O’Shannessy 0aba933911 Merge pull request #1313 from spicyj/ms-prefix
Support `ms` vendor prefix when generating markup
2014-04-03 09:25:41 -07:00
Ben Alpert 67ff4e5050 Add acknowledgement to Christopher Aue 2014-04-03 07:33:32 -07:00
Ben Alpert 2d66fc4518 Add callback to setProps docs 2014-04-02 15:01:50 -07:00
Sebastian MarkbageandPaul O’Shannessy b44761135e Remove toJSON
This was temporarily needed since clone on mount introduced a cyclic reference
in __DEV__. This reverts that change since we now have descriptors.

To avoid a problem where toJSON may collide.
2014-04-01 17:07:57 -07:00
Paul O’Shannessy 8ccb363a8e Merge pull request #1308 from chenglou/pure
add `ReactComponentWithPureRenderMixin` to addons
2014-04-01 14:32:18 -07:00
Ben Alpert e86f7671a0 Merge pull request #1345 from kmeht/referenceDoc
[docs] Amend "References to components" tip to mention descriptors.
2014-04-01 13:40:22 -07:00
Kunal Mehta 93a033a94f Remove erroneous line about static methods. 2014-04-01 13:36:56 -07:00
Kunal Mehta d236a0538d Simplify comment. 2014-04-01 13:04:09 -07:00
Kunal Mehta da27fb049a [docs] Amend "References to components" tip to mention descriptors. 2014-04-01 11:42:15 -07:00
Paul O’Shannessy c8fc3e38ab Merge pull request #1329 from irae/transition-group-leftovers
Remove leftovers from ReactTransitionGroup rewrite
2014-04-01 10:16:53 -07:00
Paul O’Shannessy a2ed61ee66 Update mailmap post 0.10 (see #1283) 2014-04-01 09:30:08 -07:00
Cheng Lou dc7242c786 [Docs][Tips] Entry on this.props.children and tweak component ref entry
Component ref entry wasn't registered in nav_tips.
2014-03-31 19:13:16 -07:00
Ben Alpert f63d0fe2b4 Merge pull request #1336 from Daniel15/making-zpao-happy
[Docs] Consistent use of self-closing tags in layout
2014-03-30 22:43:15 -07:00
Daniel Lo Nigro 306209be9e [Docs] Consistent use of self-closing tags in layout 2014-03-30 22:42:02 -07:00
Ben Newman 60d16be90b Merge pull request #1330 from spicyj/clone-imm
Clone objects in immutable tests.
2014-03-30 19:25:56 -04:00