当前位置: 首页 > 软件库 > 程序开发 > >

ember-react-components

Render React components in Ember
授权协议 MIT License
开发语言 JavaScript
所属分类 程序开发
软件类型 开源软件
地区 不详
投 递 者 谭绍晖
操作系统 跨平台
开源组织
适用人群 未知
 软件概览

ember-react-components

Consume React components in Ember

This addon is a proof-of-concept for an approach to rendering React components in Ember. It is almost entirely inspired by a blog post by Sivakumar Kailasam, from which the general idea was borrowed.

Installation

ember install ember-react-components @ember-decorators/babel-transforms

Compatibility

This addon requires Ember CLI 2.15 or higher.

Usage

This addon provides an ES6 class decorator that allows a React element to be rendered in Ember.

As an example, you can create a component like this:

// app/components/my-react-component.js
import React from 'react';
import WithEmberSupport from 'ember-react-components';

@WithEmberSupport
export default class extends React.Component {
  render() {
    const { name } = this.props;

    return (
      <p>Hello, {name}</p>
    );
  }
}

And render it like this:

{{my-react-component name='Alex'}}

That would create a component that renders Hello, Alex.

Options

  • outputFile option imports react and react-dom into a separate file than /assets/vendor.js. This is useful if your entire Ember application doesn't require react. The separate file containing react and react-dom can be imported via a template or initializer.
// ember-cli-build.js
let app = new EmberApp(defaults, {
  'ember-react-components': {
    outputFile: '/assets/react.js'
  }
});

What all is this addon doing?

  • Provides imports for react and react-dom
  • Hooks up a bunch of necessary babel transforms
  • Provides a decorator for creating a thin wrapper around your React components that bridge the gap between the two libraries

Is this production ready?

It does work, but you should be really careful about including both the Ember and React libraries in your application since that's quite a lot of JavaScript to ship to your users.

License

This project is licensed under the MIT License.

  • 最近公司主项目用到了 ember + ember-cli,虽然当前前端业内推崇 react , 但是接触到 ember-cli 过后,被 ember-cli 的工程化震撼到了,相比于 react, 前者算是一个 lib , 而后者更应该算是一个框架,这篇文章的主题不打算完整的介绍一下 ember,出于公司需要建一个公共组件库的目的, 这里介绍一下 ember-addon 相关的技术细节 为什么需要

  • Redux和React 一起使用 From the very beginning, we need to stress that Redux has no relation to React. You can write Redux apps with React, Angular, Ember, jQuery, or vanilla JavaScript. 复制代码 从一开始,我们需要强调Red

  • react 库 在2020/2021年成为JavaScript开发人员的必备技能(Must-Have Skill as a JavaScript Developer in 2020/2021) There are more than 50,000 job openings to React in the USA alone! Moreover, the demand for react devel

  • 脚手架 创建脚手架:create-react-app 技术框架为:react、webpack、es6、eslint 创建项目并启动 第一步,全局安装:npm install create-react-app -g/ yarn add create-react-app -g 第二步,切换到想创项目的目录,使用命令:create-react-app hello-react 第三步,进入项目文件夹:cd

 相关资料
  • Ember检查器是一个浏览器插件,用于调试Ember应用程序。 灰烬检查员包括以下主题 - S.No. 灰烬检查员方式和描述 1 安装Inspector 您可以安装Ember检查器来调试您的应用程序。 2 Object Inspector Ember检查器允许与Ember对象进行交互。 3 The View Tree 视图树提供应用程序的当前状态。 4 检查路由,数据选项卡和库信息 您可以看到检查

  • 英文原文: http://emberjs.com/guides/getting-ember/index/ Ember构建 Ember的发布管理团队针对Ember和Ember Data维护了不同的发布方法。 频道 最新的Ember和Ember Data的 Release,Beta 和 Canary 构建可以在这里找到。每一个频道都提供了一个开发版、最小化版和生产版。更多关于不同频道的信息可以查看博客

  • ember-emojione ember-emojione is your emoji solution for Ember, based on the EmojiOne project. EmojiOne version 2 is used, which is free to use for everyone (CC BY-SA 4.0), you're only required to giv

  • Ember 3D Ember 3D is an Ember addon for using Three.js - an easy to use, lightweight, javascript 3D library. It is designed to: Prescribe a solid file structure to Three.js code using ES6 modules. Ena

  • Ember Table An addon to support large data set and a number of features around table. Ember Table canhandle over 100,000 rows without any rendering or performance issues. Ember Table 3.x supports: Emb

  • vscode-ember This is the VSCode extension to use the Ember Language Server. Features All features currently only work in Ember-CLI apps that use classic structure and are a rough first draft with a lo