Code Monkey home page Code Monkey logo

formidable-react-component-boilerplate's People

Contributors

exogen avatar ryan-roemer avatar

Stargazers

 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  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

formidable-react-component-boilerplate's Issues

Move build deps to devDependencies

Some discussion has happened around this already, but the gist is that we have builder and builder-react-component in dependencies. And most of our current repos, which are pre-Builder, have babel and webpack in their production dependencies. This not only makes installing our stuff extra slow, but I've found that we're more likely to experience version conflicts or the need to completely wipe node_modules just to upgrade or install a new dependency (some tools in the Karma and webpack ecosystem declare peerDependencies that end up getting mad that all our components have webpack as a production dep).

When transpiling with Babel, nearly all the projects I've surveyed do their build in version or prepublish. But that means they don't support git install URLs, because the build artifacts are only present in the NPM package. To support git URLs, we landed on a solution of conditionally building in postinstall. The problem is that even though the build is conditional, the build dependencies like Babel and Webpack are not: everyone installing through NPM has to bear the cost of installing those, too, no matter what. Not to mention that on principle, they just aren't true deps: they aren't require'd anywhere in the package. They're build dependencies!

I'd prefer to align ourselves with what everyone else is doing: building in version or prepublish. Here are a couple options:

  1. Drop our postinstall method and just don't support git URLs. @coopy says they're an antipattern and that the NPM folks recommend publishing under a scoped package name if you need to depend on a fork. Another option would be to check lib into the repo in a branch of your fork, just for the purpose of being git installable.
  2. Use a smarter postinstall that not only builds conditionally, but installs dev dependencies temporarily only when a build is needed. That way the common case of installing via NPM, which already has the build artifacts, never even pulls down the build deps. To test how this would work, I made a helper for exactly this purpose: postinstall-build

As for Bower, I don't know how it works or why our current method is required to support it, so I'll let someone else explain. But I also don't give a hoot about Bower.

Coveralls: Upload all coverage to coveralls.

  • Hook up Coveralls account
  • Add to Travis YML
  • Track that coverage is generated by
    • Client
    • Server
    • Func

Basically like: https://github.com/FormidableLabs/full-stack-testing/blob/master/.travis.yml#L29-L33

  # Manually send coverage reports to coveralls.
  # - Aggregate client results
  # - Single server and func test results
  - ls coverage/client/*/lcov.info coverage/{server,func}/lcov.info | cat
  - cat coverage/client/*/lcov.info coverage/{server,func}/lcov.info | node_modules/.bin/coveralls || echo "Coveralls upload failed"

BUG: Figure out dependencies.

The current repo will fail to build for a npm install --production. In conjunction with #4 , we should correctly audit what should be in dependencies (e.g., add webpack) and devDependencies.

keep component name in a config

Right now anyone using this boilerplate has to change the boilerplate-component to their component name in the src/components/boilerplate-component.jsx, src/index.js, webpack.config.js, and webpack.config.dev.js. Ideally this could be stored in a config file that is written by the generator so that none of this is necessary.

Using a yo generator vs builder-init

I see that this is made with a yeoman generator, not a builder-init template. Any reason to use a yo generator instead of a builder template?

Travis: Node `4.2` install fails

See https://travis-ci.org/FormidableLabs/formidable-react-component-boilerplate/jobs/87699535

  • /home/travis/build/FormidableLabs/formidable-react-component-boilerplate/node_modules/builder-react-component/node_modules/webpack-dev-server/node_modules/socket.io/node_modules/engine.io/node_modules/ws/node_modules/utf-8-validate/build
  • /home/travis/build/FormidableLabs/formidable-react-component-boilerplate/node_modules/builder-react-component/node_modules/webpack-dev-server/node_modules/socket.io/node_modules/engine.io/node_modules/ws/node_modules/bufferutil

Looks like some problem with:

../node_modules/nan/nan_converters_43_inl.h:24:1: error: ‘return_t’ in ‘struct Nan::imp::ToFactory<v8::Int32>’ does not name a type

Add server side unit tests.

Maybe, maybe not (?) (Would be nice to get base validation that you can import into node-land).

  • Coverage.
  • Travis CI.

BUG: `babel-eslint` is not honoring code comment `global` declarations

IMPACT: Control comments like /*global document:false*/ don't work to make eslint happy.

This just randomly happened in build: https://travis-ci.org/FormidableLabs/formidable-react-component-boilerplate/builds/71981956

for a non code change. Nuking node_modules locally and re-installing reproduces the error. This means likely some underlying module is not properly implementing semver / has a new bug.

 $ eslint --ext .js,.jsx -c .eslintrc-react src demo/*.jsx

demo/app.jsx
  15:16  error  "document" is not defined  no-undef

✖ 1 problem (1 error, 0 warnings)

Get rid of gulp, use raw commands

Gulp is a huge dependency that we don't need. Instead, just use package.json commands to do our core:

  • Karma
  • Webpack
  • Lint

commands

Add client unit tests.

Bug: New postinstall build workflow causes errors with npm v2

With a fresh Node v4 or v0.12 installation from nvm, but with npm@2 installed instead of npm@3, an npm install of a module that depends on a module using our new postinstall workflow will fail:

$ git clone [email protected]:FormidableLabs/victory-bar.git
$ cd victory-bar
$ npm install

...fails with this output:

<snip irrelevant peerDependencies complaints>

> [email protected] postinstall /Users/brianbeck/Projects/Formidable/victory-bar/node_modules/victory-animation
> npm run build-lib

|
> [email protected] build-lib /Users/brianbeck/Projects/Formidable/victory-bar/node_modules/victory-animation
> npm run clean-lib && babel --stage 0 src -d lib

\
> [email protected] clean-lib /Users/brianbeck/Projects/Formidable/victory-bar/node_modules/victory-animation
> rimraf lib

sh: rimraf: command not found

<snip npm's ridiculous error epilogue>

The gist is that postinstall is running either before the dependencies (like rimraf) are installed, or just without access to them somehow.

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.