Mailspring/internal_packages/composer-templates/lib
Ben Gotow 7452705c31 refactor(composer): Make session, draft available everywhere
Summary:
Up until now, we've been requiring that every plugin control in the composer take the draftClientId, retreive the session, listen to it, build state from the draft, etc. This is a huge pain and is hard to explain to newcomers becaus it frankly makes no sense.

In 0.3.45 we made it so that the ComposerView always has a non-null draft and session. (It isn't rendered until they're available). In this diff, I just pass those through to all the plugins and remove all the session retrieval cruft.

Almost none of the buttons have state of their own, which I think is appropriate.

They do render on every keystroke, but they were already running code (to recompute their state) on each keystroke and profiling suggests this has no impact.

Prepare for immutable

In preparation for Immutable models, make the draft store proxy returns a !== draft if any changes have been made. This means you can safely know that a draft has changed if `props.draft !== nextProps.draft`

Test Plan: Run tests

Reviewers: juan, evan

Reviewed By: juan, evan

Differential Revision: https://phab.nylas.com/D2902
2016-04-19 16:05:15 -07:00
..
main.es6 es6(*): convert 20+ source files used in example packages to ES2016 2016-02-29 18:47:22 -08:00
preferences-templates.jsx fix(templates): Convert to ES6 and allow creation of new templates 2016-04-01 14:30:43 -07:00
template-composer-extension.es6 fix(syncback): Bidirectional transforms, ready-to-send saved state 2016-03-16 19:27:12 -07:00
template-editor.es6 fix(templates): fix a null check bug in template contentedtable ext 2016-03-10 19:06:15 -08:00
template-picker.jsx fix(focus): Remove focusedField in favor of imperative focus, break apart ComposerView 2016-04-04 15:22:01 -07:00
template-status-bar.jsx refactor(composer): Make session, draft available everywhere 2016-04-19 16:05:15 -07:00
template-store.es6 fix(require): Move more requires to new electron format 2016-04-13 15:35:01 -07:00