The smell is stubbing the System Under Test (SUT).
Hi Nicholas,
I saw you tweet about JSX yesterday. It seemed like the discussion devolved pretty quickly but I wanted to share our experience over the last year. I understand your concerns. I've made similar remarks about JSX. When we started using it Planning Center, I led the charge to write React without it. I don't imagine I'd have much to say that you haven't considered but, if it's helpful, here's a pattern that changed my opinion:
The idea that "React is the V in MVC" is disingenuous. It's a good pitch but, for many of us, it feels like in invitation to repeat our history of coupled views. In practice, React is the V and the C. Dan Abramov describes the division as Smart and Dumb Components. At our office, we call them stateless and container components (view-controllers if we're Flux). The idea is pretty simple: components can't
For latest settings refer to this comment
For previous settings check this Gist revisions
- always read and follow Homebrew formulae installation instructions
I upgraded a small app from ember-cli from 0.1.11 to 0.2.0 today. It took a couple hours. Here are some notes.
First, I read the release notes.
I recommend committing your changes right before running ember init
. That way, you can accept all the overwrites and easily discard the ones you don't want. kellyselden maintains a repo called ember-cli-output that tracks the changes in what ember init
generates over time. You can find the v0.2.0 changes here.
require 'openssl' | |
class MessageEncryptor | |
class << self | |
include OpenSSL | |
def delivering_email(message) | |
encrypted_message = sign_and_encrypt(message.encoded, message.to) | |
overwrite_body(message, encrypted_message) | |
overwrite_headers(message, encrypted_message) |
#!/usr/bin/ruby | |
require 'pty' | |
cmd = ARGV.first | |
begin | |
PTY.spawn( cmd ) do |stdin, stdout, pid| | |
begin | |
stdin.each do |line| |
module BootstrapSelectHelper | |
def bootstrap_select(value, attrs) | |
# Example | |
# bootstrap_select(@user.full_name, :from => 'task_user_id') | |
id = attrs[:from] | |
find(".selectpicker[data-id='#{id}']").click | |
find('.inner.selectpicker li', text: value).click | |
end | |
end |
This post is also on my blog, since Gist doesn't support @ notifications.
Components are taking center stage in Ember 2.0. Here are some things you can do today to make the transition as smooth as possible:
- Use Ember CLI
- In general, replace views + controllers with components
- Only use controllers at the top-level for receiving data from the route, and use
Ember.Controller
instead ofEmber.ArrayController
orEmber.ObjectController
- Fetch data in your route, and set it as normal properties on your top-level controller. Export an
Ember.Controller
, otherwise a proxy will be generated. You can use Ember.RSVP.hash to simulate setting normal props on your controller.