Real unit test (isolation, no children render)
Calls:
- constructor
- render
Привет всем!
Сегодня 27 сентября 2015 годя я заканчиваю вести твиттер Backend Secret. Возможно, неделя получилась несколько малоактивной - изнь вносила свои коррективы. Тем не менее, мне очень понравилось общаться со всем вами. Я решил сделать темой недели разработку API и несколько разбавить разговоры о темах, связанных с Девопсом.
Для начала я поделился отличным видео от Dan Gebhardt об эволюции REST API. Я считаю, что это - одно из лучших видео по теме.
Ден - один из соавторов спецификации json-api - сегодня это стандарт де факто для REST API и я надеюсь, что вслед за Rails, Node, Python, PHP, Ember и Backbone он придет и на другие платформы.
Затем мы поговорили о том, какие технологии вы бы выбрали сегодня для разработки API-серверов. Больше всего люди рекомендовали Django REST и Ruby on Rails, но упоминались так же и Node, и Go. В целом все согласились, что самым лучшим вариантом будет та технология и платформа, с которой уже знако
var Dispatcher = require('the-dispatcher'), | |
Immutable = require('immutable'), | |
NotificationConstants = require('../constants/notification_constants'), | |
UserConstants = require('../constants/user_constants'), | |
UploadConstants = require('../constants/upload_constants'), | |
StylesheetConstants = require('../constants/stylesheet_constants'), | |
makeStore = require('makestore'); | |
/** | |
* The Notification Store does nothing but store recent actions |
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
* { | |
font-size: 12pt; | |
font-family: monospace; | |
font-weight: normal; | |
font-style: normal; | |
text-decoration: none; | |
color: black; | |
cursor: default; | |
} |
/** .... **/ | |
var $ = require("gulp-load-plugins")(); | |
var gulp = require("gulp"); | |
function handleError(task) { | |
return function(err) { | |
$.util.log($.util.colors.red(err)); | |
$.notify.onError(task + " failed, check the logs..")(err); | |
}; |
Create a Meteor app and put the client_/server_ files in a client/server directories. Also, create a public dir to save the uploaded files.
function WebmailViewModel() { | |
// Data | |
var self = this; | |
self.folders = ['Inbox', 'Archive', 'Sent', 'Spamh']; | |
self.chosenFolderId = ko.observable(); | |
self.chosenFolderData = ko.observable(); | |
self.chosenMailData = ko.observable(); | |
// Behaviours | |
self.goToFolder = function(folder) { location.hash = folder }; |
The script below is triggered every day from my Mac. I use Hazel to move the tar.gz to an external hard disk once it's finished. This happens every day without me noticing. You can exclude folders if you want to. You probably want to exclude giant cache folders.
You should have a similar script.
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/ | |
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating | |
// requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel | |
// MIT license | |
(function() { | |
var lastTime = 0; | |
var vendors = ['ms', 'moz', 'webkit', 'o']; |