Compile with:
webpack --config vendor.webpack.config.js
webpack --config app.webpack.config.jsUse with the following index.html
| module.exports = [ | |
| { method: 'GET', path: '/users', handler: function () {} }, | |
| { method: 'GET', path: '/users/{id}', handler: function () {} } | |
| ]; | |
| --- | |
| var cart = require('./cart'); | |
| var user = require('./user'); |
Compile with:
webpack --config vendor.webpack.config.js
webpack --config app.webpack.config.jsUse with the following index.html
| #!/bin/sh | |
| # Which md files to compile | |
| declare -a arr=("hybrid-recommender" "text-matching" "pre-populated-recommenders") | |
| # Now loop through the above array | |
| for i in "${arr[@]}" | |
| do | |
| # Where to store the documentation |
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
| module.exports = function(grunt) { | |
| require('time-grunt')(grunt); | |
| // Project configuration. | |
| grunt.initConfig({ | |
| pkg: grunt.file.readJSON('package.json'), | |
| CHANGELOG: '', | |
| // add tiapp.xml changes to the repo | |
| gitadd: { | |
| versionBump: { | |
| options: { |
| Floor(N) -> ${N-(N%1)} | |
| Ceiling(N) -> ${N+(1-(N%1))%1} | |
| Round(N) -> ${N+((N%1>0.5)?(1-(N%1))%1:-(N%1))} |
| // In app.js or main.js or whatever: | |
| // var myApp = angular.module('askchisne', ['ngSanitize', 'ngAnimate', 'ui.bootstrap', 'ui.bootstrap.tpls']); | |
| // This filter makes the assumption that the input will be in decimal form (i.e. 17% is 0.17). | |
| myApp.filter('percentage', ['$filter', function ($filter) { | |
| return function (input, decimals) { | |
| return $filter('number')(input * 100, decimals) + '%'; | |
| }; | |
| }]); |
| // Q sample by Jeff Cogswell | |
| /*=========== | |
| We want to call these three functions in sequence, one after the other: | |
| First we want to call one, which initiates an ajax call. Once that | |
| ajax call is complete, we want to call two. Once two's ajax call is | |
| complete, we want to call three. | |
| BUT, we don't want to just call our three functions in sequence, as this quick |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <title></title> | |
| <style> | |
| .is-active { | |
| color: red; | |
| } | |
| </style> |
| var myApp = angular.module('myApp', []); | |
| myApp.directive('googleplace', function() { | |
| return { | |
| require: 'ngModel', | |
| link: function(scope, element, attrs, model) { | |
| var options = { | |
| types: [], | |
| componentRestrictions: {} | |
| }; |