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
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
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
93
Globally distributed applications with Serverless Framework
mthenw
1
180
The State of Serverless
mthenw
0
750
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
360
Bingo Bango Mongo
mthenw
6
440
Are you Redis? Introduction to Redis.
mthenw
2
760
Other Decks in Programming
See All in Programming
LLMによるContent Moderationの本番運用の裏側と品質担保への挑戦
suikabar
3
780
ローカルLLMを使ってB2Bサービスを作っていての学び
yaotti
0
210
ADKを使って簡単にAIエージェントを作ってみよう
k1mu21
0
280
Webフレームワークの ベンチマークについて
yusukebe
0
180
Mujeres en SEO Summit 2026 - Greatest Disaster Hits en Web Performance
guaca
0
200
OSもどきOS
arkw
0
590
LLM本来の能力を解き放つサンドボックス技術とAI民主化への適用
yukukotani
3
4.5k
Make SRE Operations Easier with Azure SRE Agent
kkamegawa
0
8.1k
並列実装の現場、2ヶ月間実務でAIを使い倒したAIもPCも私も限界が近い
ming_ayami
0
130
Creating Composable Callables in Contemporary C++
rollbear
0
170
Datadog LLM Observabilityで実現する 安全なLLM Usage 管理
3150
0
110
エンジニア向け会社紹介/Findy Company Profile
findyinc
6
350k
Featured
See All Featured
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
23k
What does AI have to do with Human Rights?
axbom
PRO
1
2.2k
Java REST API Framework Comparison - PWX 2021
mraible
34
9.4k
How STYLIGHT went responsive
nonsquared
100
6.2k
Fireside Chat
paigeccino
42
4k
Darren the Foodie - Storyboard
khoart
PRO
3
3.4k
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
5
1.1k
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
2
870
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
170
WENDY [Excerpt]
tessaabrams
11
38k
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
3.5k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
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!