Giter VIP home page Giter VIP logo

ember-cli-react's People

Contributors

alexgb avatar benshine avatar ember-tomster avatar levrik avatar pswai avatar zendern avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ember-cli-react's Issues

Cleanup redundant files

There are some files that are probably not in use anymore. We can consider removing them to streamline this repo.

Some that I notice:

  • .gitkeep
  • .travis.yml (or circle.yml depending on which one to keep)
  • .jshintrc
  • .eslintrc.js if we go for Prettier #13

A possible solution for the routing issue

I'm just scoping the field, I'm somewhat of an Ember newbie, not using this project (yet), but I noticed that you say that to-link doesn't work, and it reminded me of this approach for generic links:

  • put a click handler around the whole app
  • on click, see if a link was clicked (here's some example code)
  • if the link was one for this website, pass it to the routing mechanism

So in other words, the React component would just have to generate regular <a href="..."/> and it would be injected into Ember.

Broken on ember 3.2

Seems that ember-views/compat/attrs got removed or moved somewhere else on 3.2 (earlier 3.x perhaps too), loading breaks in ember-cli-react/addon/utils/get-mutable-attributes.js

if (isGlimmer) {
  const { MUTABLE_CELL } = Ember.__loader.require('ember-views/compat/attrs');

with

loader.js:12 Uncaught Error: Could not find module ember-views/compat/attrs
    at missingModule (loader.js:12)
    at internalRequire (loader.js:34)
    at Object.requireModule [as require] (loader.js:88)
    at Module.callback (get-mutable-attributes.js:16)
    at Module.exports (loader.js:106)
    at Module._reify (loader.js:143)
    at Module.reify (loader.js:130)
    at Module.exports (loader.js:104)
    at Module._reify (loader.js:143)
    at Module.reify (loader.js:130)

Broken in Ember 2.8

PR #26 seems to have broken tests in Ember 2.8. This is because Ember 2.8 inserts an html comment inside an empty component, which means that our test that expects no child nodes actually has a single child of type comment.

I think the solution here would be to ensure that we only pass children to the react component if there are more than 0 non comment child nodes.

Consider style enforcement with Prettier

With Prettier we are free from being distracted by code style during code reviews. We can also use ESLint but it still requires some decision making.

If we go with Prettier then it's good if we enforce it with lint-staged and husky as recommended here. This has the advantage of being IDE/editor -agnostic and requiring zero-setup.

Here's a outline of what we need to do to deploy Prettier:

  • Remove .jshintrc
  • Add Prettier as dependency and enforce it with lint-staged
  • Use eslint-plugin-prettier to benefit from editor highlighting
  • Make .editorconfig compatible with Prettier, if needed

@alexgb what do you think?

Several warnings at npm install

npm WARN package.json [email protected] No repository field.
npm WARN deprecated [email protected]: react-tools is deprecated. For more information, visit https://fb.me/react-tools-deprecated
npm WARN peerDependencies The peer dependency ember-inflector@^1.9.4 included from ember-data will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency 
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
npm WARN deprecated [email protected]: This package has been discontinued in favor of lodash@^4.0.0.
npm WARN deprecated [email protected]: graceful-fs version 3 and before will fail on newer node releases. Please update to graceful-fs@^4.0.0 as soon as possible.

YieldWrapper still passed in children when there are no child nodes

If there are no child nodes of the component (i.e. it is not being used as a block), there is still a children array passed to the React.createElement containing a YieldWrapper component. We have a component that throws an error (beyond our control) when passed children.

Would it make sense to only create the children/YieldWrapper when childNodes.length > 0 like below? Happy to send a PR.

    let children = props.children;
    if (!children) {
      const childNodes = get(this, 'element.childNodes');
      if (childNodes.length > 0) {
        children = [
          React.createElement(YieldWrapper, {
            key: get(this, 'elementId'),
            nodes: [...childNodes]
          })
        ];
      }
    }

Support of React 18

Hey,

I was able to create a fork of the project and make the library work with React 18.
The thing is I don't know how to run the tests/build in order to check that it passes it.

Let me know of further docs, or lets setup a meeting so I can open a PR that solves it

Use webpack for building => hot loading + imports

I'm thinking that it would be possible to build the react component(s) with webpack, and have webpack include all the dependencies.

This way, the dependencies for React are tree-shaken and work like normally in the React ecosystem, and any shared dependencies can be marked as external globals in the webpack configuration. Furthermore, it can use the hot reload capabilities of webpack and react-hot-loader.

Disadvantage would be having to run 2 processes to develop.

Does that sound reasonable or am I missing something?

Can't use class-properties plugin on fresh install

I'm doing the following:

ember new myapp
ember install ember-cli-react

creating a new app/components/foo-bar/component.jsx:

import React from 'react';

export default class SomeExample extends React.Component {
  state = {
    value: null,
  }
}

But ember chokes on a Build Error (ReactFilter) when it gets to the class property definition in the component.

I'm on ember 3.10:

"devDependencies": {
    "@ember/jquery": "^0.6.0",
    "@ember/optional-features": "^0.7.0",
    "broccoli-asset-rev": "^3.0.0",
    "ember-ajax": "^5.0.0",
    "ember-auto-import": "^1.5.2",
    "ember-cli": "~3.10.0",
    "ember-cli-app-version": "^3.2.0",
    "ember-cli-babel": "^7.7.3",
    "ember-cli-dependency-checker": "^3.1.0",
    "ember-cli-eslint": "^5.1.0",
    "ember-cli-htmlbars": "^3.0.1",
    "ember-cli-htmlbars-inline-precompile": "^2.1.0",
    "ember-cli-inject-live-reload": "^1.8.2",
    "ember-cli-react": "^1.0.2",
    "ember-cli-sri": "^2.1.1",
    "ember-cli-template-lint": "^1.0.0-beta.1",
    "ember-cli-uglify": "^2.1.0",
    "ember-data": "~3.10.0",
    "ember-export-application-global": "^2.0.0",
    "ember-load-initializers": "^2.0.0",
    "ember-maybe-import-regenerator": "^0.1.6",
    "ember-qunit": "^4.4.1",
    "ember-resolver": "^5.0.1",
    "ember-source": "~3.10.0",
    "ember-welcome-page": "^4.0.0",
    "eslint-plugin-ember": "^6.2.0",
    "eslint-plugin-node": "^8.0.1",
    "loader.js": "^4.7.0",
    "qunit-dom": "^0.8.4",
    "react": "^16.8.6",
    "react-dom": "^16.8.6"
  },

The linter also raises an error in that component.jsx file. I've tried explicitly loading that plugin in the babel config in ember-cli-build.js, but to no avail.

Broken on Ember 3.6

Referring a comment in #21, looks like Ember CLI has finally dropped support for broccoli 1. It's time to move to broccoli funnel now.

Needs upgrade for Broccoli

My app currently is stuck on ember v3.14. When I upgrade to Ember 3.15 or later, I get the following error when running ember s:

`WARNING: Invalid Broccoli2 node detected, falling back to broccoli-builder. Broccoli error:

ReactFilter: The .read/.rebuild API is no longer supported as of Broccoli 1.0. Plugins must now derive from broccoli-plugin. https://github.com/broccolijs/broccoli/blob/master/docs/broccoli-1-0-plugin-api.md
used as input node to Analyzer (ember-auto-import-analyzer)
-- created here: --
at new Plugin (/Users/jnate/Projects/BFCore/frontend/node_modules/ember-auto-import/node_modules/broccoli-plugin/dist/index.js:47:36)
at new Analyzer (/Users/jnate/Projects/BFCore/frontend/node_modules/ember-auto-import/js/analyzer.js:72:9)
at AutoImport.analyze (/Users/jnate/Projects/BFCore/frontend/node_modules/ember-auto-import/js/auto-import.js:44:24)
at Object.toTree (/Users/jnate/Projects/BFCore/frontend/node_modules/ember-auto-import/js/index.js:31:59)
at /Users/jnate/Projects/BFCore/frontend/node_modules/ember-cli-preprocess-registry/preprocessors.js:188:26
at Array.forEach ()
at processPlugins (/Users/jnate/Projects/BFCore/frontend/node_modules/ember-cli-preprocess-registry/preprocessors.js:186:11)
at module.exports.preprocessJs (/Users/jnate/Projects/BFCore/frontend/node_modules/ember-cli-preprocess-registry/preprocessors.js:179:10)
at DefaultPackager.processJavascript (/Users/jnate/Projects/BFCore/frontend/node_modules/ember-cli/lib/broccoli/default-packager.js:503:29)
at DefaultPackager.processAppAndDependencies (/Users/jnate/Projects/BFCore/frontend/node_modules/ember-cli/lib/broccoli/default-packager.js:240:35)
-- (end) -----------------

WatcherAdapter's first argument must be an array of SourceNodeWrapper nodes`

It looks like the React addon needs updating, it's still using Broccoli v1. The dependencies of ember-cli-react v1.0.2 are:
broccoli-react "^0.8.0" ember-auto-import "^1.0.1" ember-cli-babel "^6.3.0" react "^15.5.4 || ^16.0.0" react-dom "^15.5.4 || ^16.0.0"
The versions of broccoli-react and ember-auto-import in particular are really old. Perhaps updating them will do the trick?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.