Commit Graph
19463 Commits
Author SHA1 Message Date
Tim Yung 83a840656c Fix Markup Rendering in IE
This fixes known browser bugs with rendering markup using `innerHTML` in IE ([[http://support.microsoft.com/kb/276228 | here is an example of one]]).

This is a subset of what `HTML` (and jQuery) does, and we should eventually consider pulling it out into a separate module to reduce code duplication. For now, this is the minimal set of changes needed to unbreak React in production.

We can afford to use a subset of what `HTML` does because we have the luxury of knowing that the markup is generated sanely with proper closing tags, etc.
2013-07-16 11:37:26 -07:00
Tim Yung ed54fff204 Controlled <select> and <option> Components
This implements a `<select>` component that supports `value` and `defaultValue`. It also changes `<option>` to warn when the `selected` prop is supplied.
2013-07-16 11:37:04 -07:00
Jordan Walke 5d4f903482 [React Children] Step Three: New test case for traverseChildren.
If we're going to build utilities off of this, we should have good test
coverage.
2013-07-16 11:36:53 -07:00
Jordan Walke 946029c921 [React Children] Step Two: Use traverseChildren to perform mapChildren
Use the new `traverseChildren` utility to perform `mapChildren`.
The goal is to get as close to the bavior of the semantics of
`Array.prototype.map`, but also in a way that understands deeply nested arrays
and objects.
2013-07-16 11:36:11 -07:00
Jordan Walke f4321f8624 [React Children] Step One: Refactor flattenChildren
Refactoring `flattenChildren` so that the traversal code is reusable
for other purposes.
2013-07-16 11:35:43 -07:00
Paul O’Shannessy 46d05b1191 Sync vendor modules from FB.
Biggest win here is that we'll strip out the console.error from
EventListener and we won't need to suggest people use a console
polyfill with the minified build.
2013-07-15 21:04:43 -07:00
Ben Newman 558e8ca312 Merge pull request #193 from benjamn/use-populist-for-testing
Fix tests
2013-07-15 16:42:57 -07:00
Ben Newman b763d7d029 Use a separate grunt/config/jsx config file for tests.
No longer injecting __MOCK__ as a global constant (it's just a config
property now).

Turns out the `grunt jsx:debug` task was never necessary for tests.
2013-07-15 19:41:40 -04:00
Ben Newman 2d61639f90 Store dirtyMocks array globally so it can survive dumpCache().
When require("mock-modules").dumpCache() is called, all mock functions
previously created continue to refer to the old dirtyMocks array.

If we replace that array with a new one, those mock functions will never
have their .mockClear() methods called again.

The upstream version of mocks.js pulls a similar global trick, and I never
understood why until now.
2013-07-15 19:41:40 -04:00
Ben Newman 204796868d Enable module.exports mocking in react-test.js.
We don't currently attempt to mock modules automatically, but we do
respect require("mock-modules").mock, .dontMock, and .dumpCache.

I'm going to keep investigating auto-mocking, since that would move us
much closer to the behavior used within Facebook.

Closes #154.
Closes #155.
2013-07-15 19:41:40 -04:00
Ben Newman 37014e1002 Call require("mock-modules").register in every mockable module.
Mocking happens only when config.constants.__MOCK__ is true.
2013-07-15 18:10:49 -04:00
Ben Newman c6c4657f83 Use populist v0.1.2 to bundle test modules instead of browserify.
This will allow full support for mocking, dumpCache, and correct line
numbers in error messages.
2013-07-15 18:10:49 -04:00
Ben Newman f457394362 Remove remaining calls to ReactCompositeComponent.autoBind.
This is causing console.warning spew in the open source tests.
2013-07-15 15:09:01 -07:00
Tim Yung 2b97c608f8 Normalize DefaultDOMPropertyConfig
For consistency, use lowerCamelCase for all props in `DefaultDOMPropertyConfig`.
2013-07-15 15:08:46 -07:00
Paul O’Shannessy 15493530f1 Revert "Update LICENSE"
This reverts commit dd1d49b360.

The license is actually supposed to look like that. That section is
boilerplate for others to apply the license to their own work. See
immediately above...

> To apply the Apache License to your work, attach the following
> boilerplate notice, with the fields enclosed by brackets "[]"
> replaced with your own identifying information. (Don't include
> the brackets!)
2013-07-15 10:40:27 -07:00
Pete Hunt dd1d49b360 Update LICENSE 2013-07-15 00:28:36 -07:00
petehunt e9e8934577 fix markup bugs 2013-07-14 18:46:50 -07:00
petehunt 2397e35cdd switch to guides 2013-07-14 18:43:33 -07:00
petehunt 0e585d8102 put it all together 2013-07-14 18:42:39 -07:00
petehunt 6009934176 cleanup some files, move tutorial 2013-07-14 18:35:59 -07:00
petehunt b20c2641d4 move docs around, add likebutton 2013-07-14 18:31:46 -07:00
petehunt 445a0dac37 tweak the source 2013-07-14 18:25:51 -07:00
petehunt 33abe80b59 scaling up fix 2013-07-14 18:00:17 -07:00
petehunt d7cf1c509b delete old docs 2013-07-14 17:57:39 -07:00
petehunt 7d97f26870 add more examples 2013-07-14 17:52:25 -07:00
petehunt b2107ba80b update and move tutorial 2013-07-14 17:49:07 -07:00
petehunt d0c431a2a3 Fix comma 2013-07-14 17:15:28 -07:00
Pete Hunt ab7ef4ed3b Update 08-working-with-your-environment.md 2013-07-14 17:07:58 -07:00
petehunt 204edb4a27 fix some links 2013-07-14 17:07:57 -07:00
Pete Hunt 3c742d50b6 Update 03-interactivity-and-dynamic-uis.md 2013-07-14 17:07:57 -07:00
Pete Hunt 1c51cc34cd Update 02.1-jsx-in-depth.md 2013-07-14 17:07:57 -07:00
Pete Hunt 64b9b55a0d Update 02.2-jsx-gotchas.md 2013-07-14 17:07:57 -07:00
Pete Hunt f9741b0728 Update 01-motivation.md 2013-07-14 17:07:57 -07:00
petehunt 3085254a91 reorg 2013-07-14 17:07:57 -07:00
petehunt 0de35588c1 jsx gotchas, reference 2013-07-14 17:07:57 -07:00
petehunt 21ea1ac61e add working with your environment section 2013-07-14 17:07:57 -07:00
petehunt 4fccaa514b @vjeux comments 2013-07-14 17:07:57 -07:00
petehunt 13ad0c500b antipatterns 2013-07-14 17:07:57 -07:00
petehunt 126a7f5c11 more jsx handholding 2013-07-14 17:07:57 -07:00
petehunt bb3bd76fe9 Reorg docs, write a lot of content, import a lot of stuff from dex 2013-07-14 17:07:57 -07:00
petehunt 4bbdcdb0b8 another comment 2013-07-14 17:07:57 -07:00
petehunt d294a7f30f more scaling up 2013-07-14 17:07:57 -07:00
petehunt de8d0e35a2 more state machiens 2013-07-14 17:07:57 -07:00
petehunt faa84b5b85 further improvements 2013-07-14 17:07:57 -07:00
petehunt e1e5f17b27 link to blog 2013-07-14 17:07:57 -07:00
petehunt 0e63000b5c even better toc 2013-07-14 17:07:57 -07:00
petehunt 151997b1e1 Start on section 04 2013-07-14 17:07:57 -07:00
petehunt a36bcd33c6 more toc 2013-07-14 17:07:57 -07:00
petehunt 9194fea915 Add table of contents info 2013-07-14 17:07:57 -07:00
petehunt 67d9891926 add seconds 02.1 and 03 2013-07-14 17:07:56 -07:00