Skip to content

Commit

Permalink
more docs updates
Browse files Browse the repository at this point in the history
  • Loading branch information
lelandrichardson committed Sep 26, 2017
1 parent 8a5932a commit 94ec3ce
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 0 deletions.
30 changes: 30 additions & 0 deletions CONTRIBUTING.md
Expand Up @@ -75,6 +75,36 @@ Enzyme uses [lerna](https://github.com/lerna/lerna) to structure its repo, and h
to publish out of this one repo. We use lerna's "independent" mode, which means that the versioning
of each package in the repo is versioned independently.

We are waiting on [this issue](https://github.com/lerna/lerna/issues/955) to be fixed, so that
`peerDependencies` do not get updated with patch updates.

Until this issue is fixed, we will publish each package manually instead of with `lerna publish`. In
order to do this, we will:

For enzyme:

```bash
# ... update version in enzyme/package.json, make changes to CHANGELOG, etc.
cd packages/enzyme
git commit -m v{version}
git tag -a -m v{version}
git push --follow-tags
npm publish
```

For other packages

```bash
# ... update version in {package}/package.json, make changes to CHANGELOG, etc.
cd packages/{package}
git commit -m "{package}: v{version}"
git tag -a -m "{package}: v{version}"
git push --follow-tags
npm publish
```

Once we are able to use `lerna publish`, the process will be as follows:

Lerna by default will only publish packages that have changed since the last release. It will also
create a tagged commit for each release.

Expand Down
29 changes: 29 additions & 0 deletions docs/guides/migration-from-2-to-3.md
Expand Up @@ -422,6 +422,7 @@ We have updated Enzyme to consider node "equality" in a semantically identical w
treats nodes. More specifically, we've updated Enzyme's algorithms to treat `undefined` props as
equivalent to the absence of a prop. Consider the following example:

<!-- eslint react/prop-types: 0, react/prefer-stateless-function: 0 -->
```js
class Foo extends React.Component {
render() {
Expand All @@ -444,3 +445,31 @@ const wrapper = shallow(<Foo />);
wrapper.equals(<div />); // => true
wrapper.equals(<div className={undefined} id={undefined} />); // => true
```

## Lifecycle methods

Enzyme v2.x had an optional flag that could be passed in to all `shallow` calls which would make it
so that more of the component's lifecycle methods were called (such as `componentDidMount` and
`componentDidUpdate`).

With Enzyme v3, we have now turned on this mode by default, instead of making it opt-in. It is now
possible to *opt-out* instead. Additionally, you can now opt-out at a global level.

If you'd like to opt out globally, you can run the following:

```js
import Enzyme from 'enzyme';

Enzyme.configure({ disableLifecycleMethods: true });
```

This will default enzyme back to the previous behavior globally. If instead you'd only like to opt
enzyme to the previous behavior for a specific test, you can do the following:

```js
import { shallow } from 'enzyme';

// ...

const wrapper = shallow(<Component />, { disableLifecycleMethods: true });
```

0 comments on commit 94ec3ce

Please sign in to comment.