Commit Graph

391 Commits

Author SHA1 Message Date
Paul O’Shannessy 47ee780caf [lint] fix consistent-returns 2015-01-13 15:26:33 -08:00
Paul O’Shannessy 847357e42e [lint] Fix reasonable lines to 80
I don't agree with 80 on principal but it's what we have for now.

This fixes the reasonable cases. Most of the long lines are in docblocks
with long type information or containing links.
2015-01-13 15:26:33 -08:00
Paul O’Shannessy e27da99731 [lint] Fix majority of issues eslint found 2015-01-13 15:26:33 -08:00
Paul O’Shannessy df2ddc5dfa [lint] convert to single quotes 2015-01-13 15:26:33 -08:00
Paul O’Shannessy df64a67b7f codemod "use strict" to 'use strict' for better linting 2015-01-13 15:26:32 -08:00
Sebastian Markbage ff032dc857 Introducing ReactComponentBase base class
This is the base class that will be used by ES6 classes.

I'm only moving setState and forceUpdate to this base class and the other
functions are disabled for modern classes as we're intending to deprecate
them. The base classes only have getters that warn if accessed. It's as if
they didn't exist.

ReactClass now extends ReactComponentBase but also adds the deprecated
methods. They are not yet fully deprecated on the ReactClass API.

I added some extra tests to composite component which we weren't testing
to avoid regressions.

I also added some test for ES6 classes. These are not testing the new
state initialization process. That's coming in a follow up.
2015-01-13 10:54:19 -08:00
Paul O’Shannessy 5394acdb4b Merge pull request #2799 from stkb/master
Wrap setInnerHTML in Windows 8 apps (Fixes #441)
2015-01-07 16:47:32 -08:00
Paul O’Shannessy 4772967e29 Remove period from findDOMNode test filename 2015-01-07 15:16:31 -08:00
Jim e5b3f9aefa Merge pull request #2520 from jsfb/warn-for-dangerouslySetInnerHtml
Added checks for incorrect usage of innerHTML. Fixes #1370
2015-01-05 13:39:16 -08:00
Jim f507ba3c2b Minor updates to findDOMNode, as per additional post-commit CR feedback. 2015-01-05 13:26:35 -08:00
Steve Baker 9c55b961d3 code formatting fixes 2015-01-05 18:21:53 +01:00
Steve Baker 3287ea52fe Wrap setInnerHTML in Windows 8 apps 2015-01-02 20:28:58 +01:00
Dylan Harrington 159ba54b8c Fix typo in warning message for invalid reused markup 2014-12-29 01:55:16 -08:00
Paul O’Shannessy 20c43d4ec8 Fixup jsdoc for findDOMNode 2014-12-23 15:56:05 -08:00
Paul O’Shannessy 3fec78638d v0.13.0-alpha.1
Bumping version numbers so we can push to npm.
2014-12-23 12:04:23 -08:00
Jim e0725341cf Merge pull request #2646 from jsfb/getDOMNode-becomes-findDOMNode
Added findDOMNode, as we move toward deprecating getDOMNode
2014-12-22 13:05:49 -08:00
Sebastian Markbage cea2c38733 Separate createElement and JSX tests
This essentially copies all classic element creation tests to the modern
JSX tests. The classic tests doesn't use JSX and modern tests do.

The idea is that the JSX tests can start dropping dynamic checks once
we have Flow support for those features. JSX won't be necessary for
dropping dynamic checks. Plain object will also work. Flow will also not
be necessary for JSX. However, the tests should test for the suggested
combination (JSX + Flow).

This also moves some misplaced tests to ReactDOM and Validator.

Note that the modern tests uses ES6 classes. I will add separate tests for
those. However, these are not guaranteed to have .displayName so all our
error messages should check .name if available instead. This should be
better abstracted but I just adhoc fix this for now.
2014-12-18 16:13:29 -08:00
Jim b46a6ce4bb Added findDOMNode, as we move toward deprecating getDOMNode 2014-12-18 13:55:44 -08:00
Paul O’Shannessy c46dadea55 Remove deprecated methods since 0.12 shipped 2014-12-14 14:19:44 -08:00
Paul O’Shannessy 80ed4d870a Merge pull request #2690 from salier/before-input
Combine BeforeInput and Composition event plugins
2014-12-11 17:08:26 -08:00
Isaac Salier-Hellendag 9ad0e1d846 Update BeforeInputEventPlugin.js 2014-12-10 11:36:39 -05:00
Isaac Salier-Hellendag ddaf215b03 Combine BeforeInput and Composition event plugins
In order to improve support for Chinese and Japanese IME input in
Internet Explorer, use a fallback composition state to determine
inserted text. IE composition events are mostly okay, except for
certain punctuation characters that are ignored. Using the fallback, we
can detect these characters.

The fallback is also useful for emitting `beforeInput` events, so it
makes sense to simply combine these plugins.

This change also incorporates a recent change to the Google Input Tools
browser extension that exposes a `data` field via the `detail` object
on the custom composition events it emits.
2014-12-10 11:32:53 -05:00
Paul O’Shannessy 739baa9092 Fix new lint errors
We'll get to lint parity soon and then not need to do this.
2014-12-08 12:18:41 -08:00
Paul O’Shannessy 5c1589b81e Merge pull request #2658 from ianobermiller/margin-attrs
Support marginHeight and marginWidth attributes
2014-12-04 19:02:34 -08:00
Paul O’Shannessy dd844bffc0 Merge pull request #2489 from cody/form
Add Attributes formAction, formEncType, formMethod and formTarget
2014-12-04 19:01:32 -08:00
Ian Obermiller 9d7467e225 Don't need MUST_USE_ATTRIBUTE for margin(Width|Height) 2014-12-04 11:02:35 -08:00
Ian Obermiller 96bd155cbd Support marginHeight and marginWidth attributes
marginHeight and marginWidth are used on iframes to set the default body margin inside the iframe.
2014-12-04 07:35:17 -08:00
Isaac Salier-Hellendag 6b46e80bb9 Use getSelection in IE where available
IE9+ has support for window.getSelection, but we’re still using
document.selection for IE9/10. Only use the old IE selection API if the
modern one is unavailable.
2014-12-03 14:03:26 -08:00
Árni Hermann Reynisson fdffec73c3 Use String.charAt for character by index lookup
Using object property accessor for string character lookup breaks in
non-modern browsers.
2014-12-03 14:49:55 +00:00
Paul O’Shannessy bd6b10887a Remove unused require from ReactDOM-test
This happened internally in a codemod
2014-12-02 14:39:19 -08:00
Jim aef7c4d1a1 Added checks for incorrect usage of innerHTML. Fixes #1370 2014-12-01 11:10:52 -08:00
Árni Hermann Reynisson a352b94f57 Give context aware message if markup reuse fails
The context is an extra message with comparison of where server and
client markup started to differ.
2014-12-01 10:15:07 +00:00
Paul O’Shannessy 45a19a290c Merge pull request #2553 from mhuggins/headers-attribute
Permit th `headers` attribute
2014-11-26 11:15:21 -08:00
Jim 3a8fb5fc1e Merge pull request #2597 from jsfb/render-into-document
Replaced document.createElement with ReactTestUtil
2014-11-25 15:35:26 -08:00
Paul O’Shannessy b7b74b7efe Fix lint warnings, style fixups
Followup work for recent PRs
2014-11-25 15:06:30 -08:00
Jim 89fafad255 Replaced document.createElement with ReactTestUtils.renderIntoDocument where container was not subsequently utilized.
Fixes #1250
2014-11-25 12:06:22 -08:00
Ben Alpert 582bc932e5 Merge pull request #2583 from spicyj/style-example
Add example for how to use `style` properly
2014-11-21 14:27:32 -08:00
Ben Alpert 1c5443175c Add example for how to use style properly
Test Plan: jest
2014-11-21 12:10:59 -08:00
Ben Alpert c6ed9df7f3 Merge pull request #2582 from spicyj/rendercomponent
Finish renaming renderComponent -> render
2014-11-21 11:54:36 -08:00
Ben Alpert d4e32a7b2c Finish renaming renderComponent -> render
Test Plan: jest
2014-11-20 23:07:58 -08:00
Ben Alpert c4b9b938cf Update variable name and doc type to be accurate
Test Plan: Crossed fingers.
2014-11-20 23:03:03 -08:00
Jim 7768d91363 Removed context paremeter to renderToString/renderToStaticMarkup. 2014-11-19 15:16:23 -08:00
yungsters fc7cf2ff63 Replace mountDepth with isTopLevel
Summary:
After #2570, `mountDepth` is only used to enforce that `setProps` and `replaceProps` is only invoked on the top-level component. This replaces `mountDepth` with a simpler `isTopLevel` boolean set by `ReactMount` which reduces the surface area of the internal API and removes the need to thread `mountDepth` throughout React core.

Reviewers: @sebmarkbage @zpao

Test Plan:
Ran unit tests successfully:

```
npm run jest
```
2014-11-19 13:13:08 -08:00
Sebastian Markbage 13ed0317fa Remove some invariants and deadcode
These are not necessary if we enable type checks. Static or dynamic.

They're distracting my greppability.

Also, some dead code in shallow rendering.
2014-11-18 13:04:56 -08:00
yungsters bda199de04 Preserve Implicit Method Names
Summary:
Changes the way we instrument methods for `ReactPerf` so that developer tools can assign implicit method names to measured functions.

Reviewers: @zpao @sebmarkbage
2014-11-18 12:48:58 -08:00
Matt Huggins 9a472ca8f1 Permit th attribute 2014-11-18 07:52:25 -07:00
Sebastian Markbage 5951a131db Move ComponentEnvironment out of ReactComponent
We currently have three DOM specific hooks that get injected. I move those
out to ReactComponentEnvironment. The idea is to eventually remove this
injection as the reconciler gets refactored.

There is also a BackendIDOperation which is specific to the DOM component
itself so I move this injection to be more specific to the DOMComponent.

E.g. it makes sense for it to be injectable for cross-worker DOM operations
but it doesn't make sense for ART components.
2014-11-17 17:21:41 -08:00
Jim 081feeb2dd Added warning if owner-based and parent-based contexts differ. 2014-11-17 17:02:20 -08:00
Sebastian Markbage fb17e8ca56 Ensure that all internal instances have consistent properties
Use preventExtensions so that we can't add expando properties to internal
instances. This ensures that the hidden class is kept more consistent.
2014-11-17 12:54:21 -08:00
Sebastian Markbage bc4dd411b0 Move _pendingX into ReactCompositeComponent
Since setProps can no longer be called on anything but composites, we can
move this complexity into ReactCompositeComponent.
2014-11-17 12:54:21 -08:00