npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

ember-cli-react-fork

v2.0.1

Published

Use React component hierarchies in your Ember app.

Readme

Note: This is a fork of https://github.com/AltSchool/ember-cli-react due to its inactivity. It uses the same addon name so it is almost a drop-in replacement.

ember-cli-react-fork

Circle CI code style: prettier

Use clean React component hierarchies inside your Ember app.

Install

Install the addon in your app:

yarn add --dev ember-cli-react-fork
# OR
npm i -D ember-cli-react-fork

# This triggers addon blueprint to do necessary setup
ember generate ember-cli-react

NOTE: ember-cli-react relies on a custom resolver to discover components. If you have installed ember-cli-react with the standard way then you should be fine. Otherwise, you will need to manually update the first line of app/resolver.js to import Resolver from 'ember-cli-react/resolver';.

ember-browserify has been replaced with ember-auto-import. To migrate to 1.0, there are several steps you need to take:

  1. Remove ember-browserify from your project's package.json (if no other addon is using).
  2. Install latest ember-cli-react and make sure blueprint is run ember generate ember-cli-react.
  3. Remove npm: prefix from all import statements.

Then you should be good to go :)

Usage

Write your React component as usual:

// app/components/say-hi.jsx
import React from 'react';

const SayHi = props => <span>Hello {props.name}</span>;

export default SayHi;

Then render your component in a handlebars template:

{{say-hi name="Alex"}}

NOTE: Currently, ember-cli-react recognizes React components with .jsx extension only.

Block Form

Your React component can be used in block form to allow composition with existing Ember or React components.

{{#react-panel}}
  {{ember-say-hi name="World!"}}
{{/react-panel}}

The children of react-panel will be populated to props.children.

Note that if the children contains mutating structure (e.g. {{if}}, {{each}}), you need to wrap them in a stable tag to work around this Glimmer issue.

{{#react-panel}}
  <div>
    {{#if isComing}}
      {{ember-say-hi name="World!"}}
    {{else}}
      See ya!
    {{/if}}
  </div>
{{/react-panel}}

Although this is possible, block form should be used as a tool to migrate Ember to React without the hard requirement to start with leaf components. It is highly recommended to have clean React component tree whenever possible for best performance.

PascalCase File Naming

You can name your React component files using either the Ember convention of kebab-case or the React convention of PascalCase .

{{!-- Both `user-avatar.jsx` and `UserAvatar.jsx` work --}}
{{user-avatar}}

Referencing your React components with PascalCase in handlebars is also supported when invoked using react-component.

{{!-- OK! --}}
{{react-component "user-avatar"}}

{{!-- OK! --}}
{{react-component "UserAvatar"}}

{{!-- Single worded components are OK too! --}}
{{react-component "Avatar"}}

React Components are Prioritized

Whenever there is a conflict, component files with React-style convention will be used.

Examples:

  • When both SameName.jsx and same-name.jsx exist, SameName.jsx will be used
  • When both SameName.jsx and same-name.js (Ember) exist, SameName.jsx will be used

Known issue

If an Ember component and a React component has exactly the same name but different extension (same-name.js and same-name.jsx), the file with .js extension will be overwritten with the output of same-name.jsx. We are still looking at ways to resolve this.

A More Complete Example

A more complete example which demonstrates data binding and how to handle actions from within React components.

app/templates/application.hbs

{{todo-list
  onToggle=(action onToggle)
  todos=model
}}

Completed {{completedTodos.length}} todos

app/components/todo-list.jsx

import React from 'react';
import TodoItem from './todo-item';

export default function(props) {
  return (
    <ul>
      {props.todos.map(todo => {
        return <TodoItem key={todo.id} todo={todo} onToggle={props.onToggle} />;
      })}
    </ul>
  );
}

app/components/todo-item.jsx

import React from 'react';
import ReactDOM from 'react-dom';

export default class TodoItem extends React.Component {
  render() {
    let todo = this.props.todo;

    return (
      <li>
        <input
          type="checkbox"
          checked={todo.isComplete}
          onChange={this.props.onToggle.bind(null, todo.id)}
        />
        <span>{todo.text}</span>
      </li>
    );
  }
}

What's Missing

There is no React link-to equivalent for linking to Ember routes inside of your React code. Instead pass action handlers that call transitionTo from an Ember route or component.

In order to create minified production builds of React you must set NODE_ENV=production.