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
mthenw
April 10, 2015
Programming
650
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
100
Globally distributed applications with Serverless Framework
mthenw
1
190
The State of Serverless
mthenw
0
770
The State of Serverless (PCUG)
mthenw
0
260
Apex: The Holy Grail of AWS Lambda
mthenw
0
230
Microservices on AWS ECS
mthenw
8
860
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
源内ハンズオン概要編
hideg
0
230
Flow は今どうなっているか
mizdra
PRO
0
790
高専、大学編入、そして未踏へ〜プロダクト開発とキャリアの歩み - Technical College, University Transfer, and On to “Mitou” / My Journey in Product Development and Career
pkmiya
0
120
異なる設計思想のフレームワークを経験して得た学び
amekuhideki
2
1.2k
思考垂れ流し開発 ~音声入力 × AIエージェント × 開発ハーネスによる試行錯誤~
npostring
0
510
承認済みなのに差戻しできてしまうバグ、型で潰せます
shinchit
0
120
Detecting Compromised CI with eBPF and Cilium Tetragon
lizrice
0
280
AWS Transform Customによる Spring Boot 2.xから4.xへのVerUp
satoshi256kbyte
2
120
レビュー履歴をAIに食わせて、 Compose移行を加速するs
shihochan
0
250
Deep dive into the select statement (GopherCon UK)
jespino
0
160
いまどきの Codex で開発する visionOS アプリの開発スタイルについて
karad
0
170
「寝てても仕事が進む」Claude Codeで組む第二の脳
tomoyafujita2016
0
370
Featured
See All Featured
Producing Creativity
orderedlist
PRO
348
40k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
3k
Imperfection Machines: The Place of Print at Facebook
scottboms
270
14k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
brightonSEO & MeasureFest 2025 - Christian Goodrich - Winning strategies for Black Friday CRO & PPC
cargoodrich
3
800
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
630
What does AI have to do with Human Rights?
axbom
PRO
1
2.3k
How STYLIGHT went responsive
nonsquared
100
6.3k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
State of Search Keynote: SEO is Dead Long Live SEO
ryanjones
0
260
Balancing Empowerment & Direction
lara
6
1.3k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
62k
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!