57

A into Calypso - WordPress.com · 2016-06-30 · A into Calypso WordCamp EU 2016, Vienna. @ ... WordPress.com. API ←→ Client. Matt Mullenweg “A lot of people thought we should

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

Page 1: A into Calypso - WordPress.com · 2016-06-30 · A into Calypso WordCamp EU 2016, Vienna. @ ... WordPress.com. API ←→ Client. Matt Mullenweg “A lot of people thought we should
Page 2: A into Calypso - WordPress.com · 2016-06-30 · A into Calypso WordCamp EU 2016, Vienna. @ ... WordPress.com. API ←→ Client. Matt Mullenweg “A lot of people thought we should

A into CalypsoWordCamp EU 2016, Vienna

Page 3: A into Calypso - WordPress.com · 2016-06-30 · A into Calypso WordCamp EU 2016, Vienna. @ ... WordPress.com. API ←→ Client. Matt Mullenweg “A lot of people thought we should

@matias_venturaMatías Ventura

matiasventura.com

Page 4: A into Calypso - WordPress.com · 2016-06-30 · A into Calypso WordCamp EU 2016, Vienna. @ ... WordPress.com. API ←→ Client. Matt Mullenweg “A lot of people thought we should
Page 5: A into Calypso - WordPress.com · 2016-06-30 · A into Calypso WordCamp EU 2016, Vienna. @ ... WordPress.com. API ←→ Client. Matt Mullenweg “A lot of people thought we should

WordPress.com

Page 6: A into Calypso - WordPress.com · 2016-06-30 · A into Calypso WordCamp EU 2016, Vienna. @ ... WordPress.com. API ←→ Client. Matt Mullenweg “A lot of people thought we should

API ←→ Client

Page 7: A into Calypso - WordPress.com · 2016-06-30 · A into Calypso WordCamp EU 2016, Vienna. @ ... WordPress.com. API ←→ Client. Matt Mullenweg “A lot of people thought we should

Matt Mullenweg

“A lot of people thought we should keep this proprietary, but throughout my life I’ve learned that

the more you give away, the more you get back.”

*

Page 8: A into Calypso - WordPress.com · 2016-06-30 · A into Calypso WordCamp EU 2016, Vienna. @ ... WordPress.com. API ←→ Client. Matt Mullenweg “A lot of people thought we should

{ Calypso }github.com/Automattic/wp-calypso

Page 9: A into Calypso - WordPress.com · 2016-06-30 · A into Calypso WordCamp EU 2016, Vienna. @ ... WordPress.com. API ←→ Client. Matt Mullenweg “A lot of people thought we should

Single-Page App

Written in JavaScript

Driven by WP.com REST APIAnd some of WP-API

Page 10: A into Calypso - WordPress.com · 2016-06-30 · A into Calypso WordCamp EU 2016, Vienna. @ ... WordPress.com. API ←→ Client. Matt Mullenweg “A lot of people thought we should

Speed

Page 11: A into Calypso - WordPress.com · 2016-06-30 · A into Calypso WordCamp EU 2016, Vienna. @ ... WordPress.com. API ←→ Client. Matt Mullenweg “A lot of people thought we should
Page 12: A into Calypso - WordPress.com · 2016-06-30 · A into Calypso WordCamp EU 2016, Vienna. @ ... WordPress.com. API ←→ Client. Matt Mullenweg “A lot of people thought we should
Page 13: A into Calypso - WordPress.com · 2016-06-30 · A into Calypso WordCamp EU 2016, Vienna. @ ... WordPress.com. API ←→ Client. Matt Mullenweg “A lot of people thought we should

A declarative view layer written in pure JavaScript that simplifies the process of

building complex UIs.

React

Page 14: A into Calypso - WordPress.com · 2016-06-30 · A into Calypso WordCamp EU 2016, Vienna. @ ... WordPress.com. API ←→ Client. Matt Mullenweg “A lot of people thought we should

Just Render() React will be smart about updating the DOM.

Page 15: A into Calypso - WordPress.com · 2016-06-30 · A into Calypso WordCamp EU 2016, Vienna. @ ... WordPress.com. API ←→ Client. Matt Mullenweg “A lot of people thought we should
Page 16: A into Calypso - WordPress.com · 2016-06-30 · A into Calypso WordCamp EU 2016, Vienna. @ ... WordPress.com. API ←→ Client. Matt Mullenweg “A lot of people thought we should

Not a framework

Page 17: A into Calypso - WordPress.com · 2016-06-30 · A into Calypso WordCamp EU 2016, Vienna. @ ... WordPress.com. API ←→ Client. Matt Mullenweg “A lot of people thought we should

Library (view layer)

Page 18: A into Calypso - WordPress.com · 2016-06-30 · A into Calypso WordCamp EU 2016, Vienna. @ ... WordPress.com. API ←→ Client. Matt Mullenweg “A lot of people thought we should

ReactSass

page.js

wpcom.js

redux

webpack WP-API

Components socket.io

Page 19: A into Calypso - WordPress.com · 2016-06-30 · A into Calypso WordCamp EU 2016, Vienna. @ ... WordPress.com. API ←→ Client. Matt Mullenweg “A lot of people thought we should

Development Values

Page 20: A into Calypso - WordPress.com · 2016-06-30 · A into Calypso WordCamp EU 2016, Vienna. @ ... WordPress.com. API ←→ Client. Matt Mullenweg “A lot of people thought we should

0. We do it all for the user

Page 21: A into Calypso - WordPress.com · 2016-06-30 · A into Calypso WordCamp EU 2016, Vienna. @ ... WordPress.com. API ←→ Client. Matt Mullenweg “A lot of people thought we should

1. We optimize for iterating quickly

Page 22: A into Calypso - WordPress.com · 2016-06-30 · A into Calypso WordCamp EU 2016, Vienna. @ ... WordPress.com. API ←→ Client. Matt Mullenweg “A lot of people thought we should

2. We are here for the long haul

See “Our Approach to Data”

Page 23: A into Calypso - WordPress.com · 2016-06-30 · A into Calypso WordCamp EU 2016, Vienna. @ ... WordPress.com. API ←→ Client. Matt Mullenweg “A lot of people thought we should

3. We don’t trust ourselves to be perfect

Page 24: A into Calypso - WordPress.com · 2016-06-30 · A into Calypso WordCamp EU 2016, Vienna. @ ... WordPress.com. API ←→ Client. Matt Mullenweg “A lot of people thought we should

4. We are in it together

Page 25: A into Calypso - WordPress.com · 2016-06-30 · A into Calypso WordCamp EU 2016, Vienna. @ ... WordPress.com. API ←→ Client. Matt Mullenweg “A lot of people thought we should

When developers and designers care about all the flows, not just where their particular section

ends, the work as a whole begins to shine.

Page 26: A into Calypso - WordPress.com · 2016-06-30 · A into Calypso WordCamp EU 2016, Vienna. @ ... WordPress.com. API ←→ Client. Matt Mullenweg “A lot of people thought we should

1. Performance 2. Composition 3. Calypso as a framework

Page 27: A into Calypso - WordPress.com · 2016-06-30 · A into Calypso WordCamp EU 2016, Vienna. @ ... WordPress.com. API ←→ Client. Matt Mullenweg “A lot of people thought we should

Code SplittingWith size comes

Page 28: A into Calypso - WordPress.com · 2016-06-30 · A into Calypso WordCamp EU 2016, Vienna. @ ... WordPress.com. API ←→ Client. Matt Mullenweg “A lot of people thought we should
Page 29: A into Calypso - WordPress.com · 2016-06-30 · A into Calypso WordCamp EU 2016, Vienna. @ ... WordPress.com. API ←→ Client. Matt Mullenweg “A lot of people thought we should
Page 30: A into Calypso - WordPress.com · 2016-06-30 · A into Calypso WordCamp EU 2016, Vienna. @ ... WordPress.com. API ←→ Client. Matt Mullenweg “A lot of people thought we should
Page 31: A into Calypso - WordPress.com · 2016-06-30 · A into Calypso WordCamp EU 2016, Vienna. @ ... WordPress.com. API ←→ Client. Matt Mullenweg “A lot of people thought we should

Preloading

Page 32: A into Calypso - WordPress.com · 2016-06-30 · A into Calypso WordCamp EU 2016, Vienna. @ ... WordPress.com. API ←→ Client. Matt Mullenweg “A lot of people thought we should
Page 33: A into Calypso - WordPress.com · 2016-06-30 · A into Calypso WordCamp EU 2016, Vienna. @ ... WordPress.com. API ←→ Client. Matt Mullenweg “A lot of people thought we should
Page 34: A into Calypso - WordPress.com · 2016-06-30 · A into Calypso WordCamp EU 2016, Vienna. @ ... WordPress.com. API ←→ Client. Matt Mullenweg “A lot of people thought we should

<AsyncLoad>

github.com/Automattic/wp-calypso/pull/5356IN PROGRESS

Page 35: A into Calypso - WordPress.com · 2016-06-30 · A into Calypso WordCamp EU 2016, Vienna. @ ... WordPress.com. API ←→ Client. Matt Mullenweg “A lot of people thought we should

Why do components

matter?

Page 36: A into Calypso - WordPress.com · 2016-06-30 · A into Calypso WordCamp EU 2016, Vienna. @ ... WordPress.com. API ←→ Client. Matt Mullenweg “A lot of people thought we should

<Site>

What is a component?

Page 37: A into Calypso - WordPress.com · 2016-06-30 · A into Calypso WordCamp EU 2016, Vienna. @ ... WordPress.com. API ←→ Client. Matt Mullenweg “A lot of people thought we should

JSX + Sass

Page 38: A into Calypso - WordPress.com · 2016-06-30 · A into Calypso WordCamp EU 2016, Vienna. @ ... WordPress.com. API ←→ Client. Matt Mullenweg “A lot of people thought we should

Live components gallery

Page 39: A into Calypso - WordPress.com · 2016-06-30 · A into Calypso WordCamp EU 2016, Vienna. @ ... WordPress.com. API ←→ Client. Matt Mullenweg “A lot of people thought we should

<Site>

<Sidebar> <SitePopover>

<EditorGroundControl>

Composition

Page 40: A into Calypso - WordPress.com · 2016-06-30 · A into Calypso WordCamp EU 2016, Vienna. @ ... WordPress.com. API ←→ Client. Matt Mullenweg “A lot of people thought we should

<Site>

Components define app level semantics.

NATIVE HTML

<header>APP

Page 41: A into Calypso - WordPress.com · 2016-06-30 · A into Calypso WordCamp EU 2016, Vienna. @ ... WordPress.com. API ←→ Client. Matt Mullenweg “A lot of people thought we should

<Site>

App Components and their impact on collaboration.

<Post>

<Comments><DraftsList>

Page 42: A into Calypso - WordPress.com · 2016-06-30 · A into Calypso WordCamp EU 2016, Vienna. @ ... WordPress.com. API ←→ Client. Matt Mullenweg “A lot of people thought we should

Defines a language that transcends the medium, one which can be applied to mobile, the web, and desktop.

Page 43: A into Calypso - WordPress.com · 2016-06-30 · A into Calypso WordCamp EU 2016, Vienna. @ ... WordPress.com. API ←→ Client. Matt Mullenweg “A lot of people thought we should

Using Calypso as a Framework

Page 44: A into Calypso - WordPress.com · 2016-06-30 · A into Calypso WordCamp EU 2016, Vienna. @ ... WordPress.com. API ←→ Client. Matt Mullenweg “A lot of people thought we should

ReactSass

page.js

wpcom.js

redux

webpack WP-API

COMPONENTS

Page 45: A into Calypso - WordPress.com · 2016-06-30 · A into Calypso WordCamp EU 2016, Vienna. @ ... WordPress.com. API ←→ Client. Matt Mullenweg “A lot of people thought we should

i18n

App State

App Components

preloading

SSR

UI Components

Offline(?)

calypso

Page 46: A into Calypso - WordPress.com · 2016-06-30 · A into Calypso WordCamp EU 2016, Vienna. @ ... WordPress.com. API ←→ Client. Matt Mullenweg “A lot of people thought we should

Build what you need

JS Module

Compilation Webpack + Babel → build.js}JS Module

JS Module

JS Module

Page 47: A into Calypso - WordPress.com · 2016-06-30 · A into Calypso WordCamp EU 2016, Vienna. @ ... WordPress.com. API ←→ Client. Matt Mullenweg “A lot of people thought we should

{ "features": { "reader": false } }

{ "project": “my-project" }

// wp-calypso/client/my-project.js

Page 48: A into Calypso - WordPress.com · 2016-06-30 · A into Calypso WordCamp EU 2016, Vienna. @ ... WordPress.com. API ←→ Client. Matt Mullenweg “A lot of people thought we should
Page 49: A into Calypso - WordPress.com · 2016-06-30 · A into Calypso WordCamp EU 2016, Vienna. @ ... WordPress.com. API ←→ Client. Matt Mullenweg “A lot of people thought we should
Page 50: A into Calypso - WordPress.com · 2016-06-30 · A into Calypso WordCamp EU 2016, Vienna. @ ... WordPress.com. API ←→ Client. Matt Mullenweg “A lot of people thought we should
Page 51: A into Calypso - WordPress.com · 2016-06-30 · A into Calypso WordCamp EU 2016, Vienna. @ ... WordPress.com. API ←→ Client. Matt Mullenweg “A lot of people thought we should
Page 52: A into Calypso - WordPress.com · 2016-06-30 · A into Calypso WordCamp EU 2016, Vienna. @ ... WordPress.com. API ←→ Client. Matt Mullenweg “A lot of people thought we should
Page 53: A into Calypso - WordPress.com · 2016-06-30 · A into Calypso WordCamp EU 2016, Vienna. @ ... WordPress.com. API ←→ Client. Matt Mullenweg “A lot of people thought we should
Page 54: A into Calypso - WordPress.com · 2016-06-30 · A into Calypso WordCamp EU 2016, Vienna. @ ... WordPress.com. API ←→ Client. Matt Mullenweg “A lot of people thought we should

$blue-wordpress: #e14d43; $blue-medium: #69a8bb; $gray: #a0a5aa; $gray-light: #f1f1f1; $gray-dark: #23282d; $orange-jazzy: #f56e28; $orange-fire: $orange-jazzy;

$masterbar-color: $gray-dark; $sidebar-bg-color: $gray-dark; $sidebar-text-color: $white; $sidebar-selected-color: $blue-medium;

Page 55: A into Calypso - WordPress.com · 2016-06-30 · A into Calypso WordCamp EU 2016, Vienna. @ ... WordPress.com. API ←→ Client. Matt Mullenweg “A lot of people thought we should

Config files and feature isEnabled checks.

Notion of “project” definition within Calypso.

Hook within “boot” file to render a different layout.

Declare new sections for webpack to assemble.

Benefit form code-splitting and preloading mechanisms.

****

extend()

*

Page 56: A into Calypso - WordPress.com · 2016-06-30 · A into Calypso WordCamp EU 2016, Vienna. @ ... WordPress.com. API ←→ Client. Matt Mullenweg “A lot of people thought we should

Install Calypso locally and play around with it.

Using it to build a custom project and let us know how it goes.

Add full WP-API support as a library to use instead of wpcom.js.

***

try()

Page 57: A into Calypso - WordPress.com · 2016-06-30 · A into Calypso WordCamp EU 2016, Vienna. @ ... WordPress.com. API ←→ Client. Matt Mullenweg “A lot of people thought we should

Thank you.

@matias_venturamatiasventura.com