Skip to content

Commit

Permalink
Minor optimisation and instructions on how to clone project and run t…
Browse files Browse the repository at this point in the history
…ests (#1498)

* Since children.toArray() creates a new array ctx !== children will always be true

* Comment on development in README
  • Loading branch information
jhsware authored and Havunen committed Dec 9, 2019
1 parent 82092b8 commit fb9d5fe
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -975,6 +975,17 @@ const alias = require('@rollup/plugin-alias');

Inferno always wants to deliver great performance. In order to do so, it has to make intelligent assumptions about the state of the DOM and the elements available to mutate. Custom namespaces conflict with this idea and change the schema of how different elements and attributes might work, so Inferno makes no attempt to support namespaces. Instead, SVG namespaces are automatically applied to elements and attributes based on their `tag name`.

## Development
If you want to contribute code, fork this project and submit a PR from your fork. To run browser tests you need to build the repos. A complete rebuild of the repos can take >5 mins.

```sh
$ git clone git@github.com:infernojs/inferno.git
$ cd inferno && npm i
$ npm run test:node
$ npm run build
$ npm run test:browser
```

## Community

There is an [Inferno Slack](https://infernojs.slack.com). You can join via [inferno-slack.herokuapp.com](https://inferno-slack.herokuapp.com).
Expand Down
4 changes: 2 additions & 2 deletions packages/inferno-compat/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ const Children = {
return children;
}
children = Children.toArray(children);
if (ctx && ctx !== children) {
if (ctx) {
fn = fn.bind(ctx);
}
return children.map(fn);
Expand All @@ -89,7 +89,7 @@ const Children = {
return;
}
children = Children.toArray(children);
if (ctx && ctx !== children) {
if (ctx) {
fn = fn.bind(ctx);
}
for (let i = 0, len = children.length; i < len; ++i) {
Expand Down

0 comments on commit fb9d5fe

Please sign in to comment.