Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Practical React in Marionette application
Search
mthenw
April 10, 2015
Programming
660
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Practical React in Marionette application
meet.js Poznań
mthenw
April 10, 2015
Transcript
29 slides
Practical React In Marionette application
@mthenw
None
Egnyte Web UI
Egnyte Web UI Backbone/Marionette require.js karma/jasmine JSHint/JSCS underscore templates
not so much unit tests a lot of HTML duplication
overcomplicated business logic two-way binding (rivets.js)
New feature - Audit Reports
None
DataGrid PoC
None
DataGrid PoC less code reusable components easy to test
React + Marionette
no revolution
React Bridge
var ReactBridge = Backbone.Marionette.ItemView.extend({ template: "#react-bridge-template", initialize: function (options) {
this.options = options; }, onRender: function () { React.render(this.initializeComponent(this.options), this.el); }, onClose: function () { React.unmountComponentAtNode(this.el); } });
var Grid = ReactBridge.extend({ initializeComponent: function (options) { return DataGridComponent({
title: "Cool Grid", desc: "with awesome data", collection: options.collection, ... }); } });
App.Settings.layout.content.show( new Grid({collection: collection}) );
None
Model Component model’s attributes as props update on change getModel().set(..,
..)
Best practises
Best practises JSX
var Header = React.createClass({ render() { return ( <header className={
`${this.props.classNamePrefix}-header content-header` }> <div> <h1 key="header"><span>{ this.t(this.props.title) }</span></h1> <span className="desc" key="desc">{ this.t(this.props.desc) }</span> { filters } <div className="actions" key="actions">{ actions }</div> </div> </header> ); } }); var Header = React.createClass({ render() { return ( React.createElement( "header", {className: `${this.props.classNamePrefix}-header content-header`}, React.createElement("div", null, React.createElement("h1", {key: “header"}, React.createElement("span", null, this.t(this.props.title) )), React.createElement("span", {className: "desc", key: "desc"}, this.t(this.props.desc) ), filters, React.createElement("div", {className: "actions", key: "actions"}, actions ) ) ) ); } });
Best practises JSX small components beware of using state
var DataGrid = React.createClass({ render() { return <div className="datagrid" >
<Header /> <Notifications /> <Table /> <Pagination /> </div>; } });
Best practises JSX small components even smaller components beware of
using state
var Icon = React.createClass({ render() { return <i className={"icon-" +
this.props.icon} />; } });
Best practises JSX small components even smaller components beware of
using state no revolution
+1
Thanks!
More Decks by mthenw
See All by mthenw
How to make better technical decisions
mthenw
0
110
Globally distributed applications with Serverless Framework
mthenw
1
220
The State of Serverless
mthenw
0
790
The State of Serverless (PCUG)
mthenw
0
270
Apex: The Holy Grail of AWS Lambda
mthenw
0
240
Microservices on AWS ECS
mthenw
8
870
Working with single-threaded event loop
mthenw
1
380
Bingo Bango Mongo
mthenw
6
450
Are you Redis? Introduction to Redis.
mthenw
2
780
Other Decks in Programming
See All in Programming
Apache Airflow Introduction
leew
1
100
そのデザイントークン、Flutterでも同じ見た目になりますか?
nakamizu
0
510
[Kotlin Fest 2026] eBPF Tracing for Kotlin
takehaya
1
410
Kiro Crewによる開発体験ーKiro CrewでStrands Decider 2B に関する技術検証をやってみた
satoshi256kbyte
1
230
Distance field of Julia set
kinakomoti321
0
330
AWS CDKを理解するために公式の定義を深掘って解説してみる / Understanding AWS CDK by Digging into Its Official Definition
akihisaikeda
3
360
例外からRich Errorsまで Kotlinエラーハンドリングの進化を読み解く
shiita0903
0
250
Math.sumPreciseから学ぶ、ECMAScript仕様の数値の種類
syumai
0
1.2k
ビジネスロジックを堅牢に~Scala 3のドメインプリミティブ~
j5ik2o
0
240
Proxmox x Talos Linux x Terraform で実現するなんかいい感じの Kubernetes クラスタ / A Sleek Kubernetes Cluster Powered by Proxmox, Talos Linux, and Terraform
nnaka2992
0
320
止まらない比較を止める — 余帰納法で無限ストリームを比べる
tarao
0
220
社内AIエージェント「Askワンバン」における コストチューニングの取り組み
t0yohei
0
180
Featured
See All Featured
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
690
Docker and Python
trallard
47
4.3k
How to Grow Your eCommerce with AI & Automation
katarinadahlin
PRO
2
360
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
2
690
Faster Mobile Websites
deanohume
310
32k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
18k
Building AI with AI
inesmontani
PRO
1
1.4k
Ecommerce SEO: The Keys for Success Now & Beyond - #SERPConf2024
aleyda
1
2.3k
Un-Boring Meetings
codingconduct
0
510
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
700
The Invisible Side of Design
smashingmag
301
52k
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
70
69k