Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Practical React in Marionette application
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
mthenw
April 10, 2015
Programming
630
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
More Decks by mthenw
See All by mthenw
How to make better technical decisions
mthenw
0
97
Globally distributed applications with Serverless Framework
mthenw
1
190
The State of Serverless
mthenw
0
760
The State of Serverless (PCUG)
mthenw
0
250
Apex: The Holy Grail of AWS Lambda
mthenw
0
220
Microservices on AWS ECS
mthenw
8
850
Working with single-threaded event loop
mthenw
1
370
Bingo Bango Mongo
mthenw
6
440
Are you Redis? Introduction to Redis.
mthenw
2
760
Other Decks in Programming
See All in Programming
関数型プログラミングのメリットって何だろう?
wanko_it
0
180
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
300
OSINT for SRE: 学術論文とポストモーテムから探る システム障害の共通パターン / SRE NEXT 2026
tomoyk
1
4k
【やさしく解説 設計編・中級 #6】良いアーキテクチャとは ~ 一本の登り道の、行き先 ~
panda728
PRO
0
170
AIを活用したE2Eテスト実装効率化のあゆみ / ebisu-mobile-14-kotetu
kotetuco
0
170
Laravelで学ぶ Webアプリケーションチューニング入門/web_application_tuning_101
hanhan1978
4
1k
Hatena Engineer Seminar #37「言語モデルの活用に関する研究」
slashnephy
0
530
継続モナドとリアクティブプログラミング
yukikurage
3
610
Go言語とトイモデルで学ぶTransformerの気持ち / fukuokago23-transformer
monochromegane
0
130
JAWS-UG横浜 #102 AWSサ終供養LT会 成仏できない AWS サービスたち 〜本日、三体供養します〜
maroon1st
0
210
Laravel Boostに学ぶ、AIにPHPを書かせる技術 〜OSSの実装から蒸留するエージェント制御の王道〜
kentaroutakeda
3
500
はてなアカウント基盤 State of the Union
cockscomb
1
1.3k
Featured
See All Featured
For a Future-Friendly Web
brad_frost
183
10k
How to Talk to Developers About Accessibility
jct
2
410
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
400
Practical Orchestrator
shlominoach
191
11k
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.4k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
3k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
2k
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
1
2.8k
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
590
The Limits of Empathy - UXLibs8
cassininazir
1
520
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
770
Google's AI Overviews - The New Search
badams
0
1.1k
Transcript
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!