SlideShare ist ein Scribd-Unternehmen logo
1 von 16
Downloaden Sie, um offline zu lesen
EMBER APP KIT &
THE EMBER RESOLVER
or, “magic isn’t just for wizards (and Rails users) anymore”	

Thomas Boyt - Ember NYC 10.24.13
Ember App Kit is boilerplate
for ambitious web
applications
L

HTML
Ambitious web applications have
lots of assets
JavaScript
Emblem
CSS
Ambitious web applications have
lots of build tasks
• Compilation	

• Concatenation	

• Minification	

• Linting	

• Server	

• Watcher
Ambitious web applications have
structure
• app/
• components/
• controllers/
• helpers/

• public/
• tasks/
• options/
• tests/

• models/

• unit/

• routes/

• integration/

• styles/

• vendor/

• templates/

• Gruntfile.js

• utils/

• bower.json

• views/

• package.json

• app.js

• README.md

• router.js
Ambitious web applications have
modules
Why modules?
index.html
1 <html>
2
<head>
3
<title>My Super Awesome App</title>
4
5
<script src="vendor/jquery.js"></script>
6
<script src="vendor/handlebars.js"></script>
7
<script src="vendor/ember.js"></script>
8
</head>
9
<body>
10
<script type="text/handlebars" data-template-name="application">
11
<h2>Welcome to Ember.js</h2>
12
13
{{outlet}}
14
</script>
15
16
<script type="text/handlebars" data-template-name="index">
17
<ul>
18
{{#each}}
19
<li>{{this}}</li>
20
{{/each}}
21
</ul>
22
</script>
23
24
<script src="app.js"></script>
25
</body>
26 </html>
Why modules?
app.js
1 App = Ember.Application.create({});
2
3 App.IndexRoute = Ember.Route.extend({
4
model: function(){
5
return [
6
{firstName: 'Kris', lastName: 'Selden'},
7
{firstName: 'Luke', lastName: 'Melia'},
8
{firstName: 'Alex', lastName: 'Matchneer'}
9
];
10
}
11 });
Why modules?
1
2
3
4
5
6
7

<script
<script
<script
<script
<script
<script
<script

src="js/app.js"></script>
src="js/router.js"></script>
src="js/models/todo.js"></script>
src="js/models/store.js"></script>
src="js/controllers/todos_controller.js"></script>
src="js/controllers/todo_controller.js"></script>
src="js/views/edit_todo_view.js"></script>

global namespace means hard to test, reuse	

(this is why angular developers make fun of us!)
1 Todos.TodoController = Ember.ObjectController.extend({
2
// ...
3 });
ES6 Modules: easy & futureproof
foo.js
1 export default = Ember.Object.create({
2
isAwesome: true
3 });

bar.js
1 import foo from "foo";
2
3 console.log(foo.get("isAwesome"))

// true
ES6 Module Transpiler
• https://github.com/square/es6-module-transpiler	

• Created

by Yehuda Katz and Brian Donovan	


• Already

used in Ember-related projects, including Handlebars,
RSVP.js, and the Ember debug extension	


• Transpiles
• Output

runtime

to AMD (RequireJS) or CommonJS modules	


is easy to read & debug, no extra obfuscation or
Import statements aren’t cool
• Modules
• Ember

are awesome, but manually wiring them up is not	


is built on convention:	


• App.PostController
• App.PostRoute
• App.PostView
• post.hbs
• How

can we use similar conventions in a module system?
Introducing the resolver, your
new best friend
• Remember

our awesome
new structure?	


• app/
• components/
• controllers/
• post.js

• Each JS file is a module that
export defaults a Route,
View, Controller, or Model

• models/

• These

• templates/

files are resolved
through an extra dependency,
called the resolver

• post.js
• routes/
• post.js

• post.hbs
• utils/
• views/
• post.js
Demo time!

(and a disclaimer about syntax)
Things that are resolver-friendly
• Routes	

• Models (this.modelFor)	

• Controllers (this.controllerFor, needs, {{render}})	

• Views ({{view}})	

• Components
• Ember

and Helpers (Ember 1.2.0 beta)	


Data: Adapters, Serializers, and Transforms	


• Templates
Other things you should know
• Testing

is easier: just import what you need (see test
examples that come with Ember App Kit)	


• Modules
• JSHint

updates in progress (?)	


• Slower
• Work

can have source maps*	


builds than rake-pipeline :(	


continues!

Weitere ähnliche Inhalte

Was ist angesagt?

Laravel and CodeIgniter: pros & cons
Laravel and CodeIgniter: pros & consLaravel and CodeIgniter: pros & cons
Laravel and CodeIgniter: pros & consElenorWisozk
 
Production ember getting started
Production ember getting startedProduction ember getting started
Production ember getting startedknomedia
 
Active Admin: Create Your Admin Interface the Easy Way
Active Admin: Create Your Admin Interface the Easy WayActive Admin: Create Your Admin Interface the Easy Way
Active Admin: Create Your Admin Interface the Easy WaySmartLogic
 
Sahi Web Automation and Testing Tool
Sahi Web Automation and Testing ToolSahi Web Automation and Testing Tool
Sahi Web Automation and Testing ToolTyto Software
 
How angularjs saves rails
How angularjs saves railsHow angularjs saves rails
How angularjs saves railsMichael He
 
Rails Engines as a way to Micro services
Rails Engines as a way to Micro servicesRails Engines as a way to Micro services
Rails Engines as a way to Micro servicesLucas Alencar
 
Building a Messaging Framework on the Salesforce1 Platform
Building a Messaging Framework on the Salesforce1 PlatformBuilding a Messaging Framework on the Salesforce1 Platform
Building a Messaging Framework on the Salesforce1 PlatformAnup Jadhav
 
AngularJS meets Rails
AngularJS meets RailsAngularJS meets Rails
AngularJS meets RailsElena Torró
 
Sahi Principles and Architecture
Sahi Principles and ArchitectureSahi Principles and Architecture
Sahi Principles and ArchitectureTyto Software
 
Introduction to Ruby on Rails
Introduction to Ruby on RailsIntroduction to Ruby on Rails
Introduction to Ruby on RailsAlessandro DS
 
Agile documentation with Confluence and Sparx Enterprise Architect
Agile documentation with Confluence and Sparx Enterprise ArchitectAgile documentation with Confluence and Sparx Enterprise Architect
Agile documentation with Confluence and Sparx Enterprise ArchitectPer Spilling
 
Laravel development (Laravel History, Environment Setup & Laravel Installatio...
Laravel development (Laravel History, Environment Setup & Laravel Installatio...Laravel development (Laravel History, Environment Setup & Laravel Installatio...
Laravel development (Laravel History, Environment Setup & Laravel Installatio...Dilouar Hossain
 
Sahi - Effective Web Testing (MT)
Sahi - Effective Web Testing (MT)Sahi - Effective Web Testing (MT)
Sahi - Effective Web Testing (MT)Tyto Software
 
Webservices: connecting Joomla! with other programs.
Webservices: connecting Joomla! with other programs.Webservices: connecting Joomla! with other programs.
Webservices: connecting Joomla! with other programs.Herman Peeren
 

Was ist angesagt? (20)

Laravel Tutorial PPT
Laravel Tutorial PPTLaravel Tutorial PPT
Laravel Tutorial PPT
 
Laravel and CodeIgniter: pros & cons
Laravel and CodeIgniter: pros & consLaravel and CodeIgniter: pros & cons
Laravel and CodeIgniter: pros & cons
 
Production ember getting started
Production ember getting startedProduction ember getting started
Production ember getting started
 
Prism Forms App
Prism Forms AppPrism Forms App
Prism Forms App
 
Active Admin: Create Your Admin Interface the Easy Way
Active Admin: Create Your Admin Interface the Easy WayActive Admin: Create Your Admin Interface the Easy Way
Active Admin: Create Your Admin Interface the Easy Way
 
Sahi Web Automation and Testing Tool
Sahi Web Automation and Testing ToolSahi Web Automation and Testing Tool
Sahi Web Automation and Testing Tool
 
How angularjs saves rails
How angularjs saves railsHow angularjs saves rails
How angularjs saves rails
 
Laravel Introduction
Laravel IntroductionLaravel Introduction
Laravel Introduction
 
Laravel overview
Laravel overviewLaravel overview
Laravel overview
 
Rails Engines as a way to Micro services
Rails Engines as a way to Micro servicesRails Engines as a way to Micro services
Rails Engines as a way to Micro services
 
Joomla REST API
Joomla REST APIJoomla REST API
Joomla REST API
 
Building a Messaging Framework on the Salesforce1 Platform
Building a Messaging Framework on the Salesforce1 PlatformBuilding a Messaging Framework on the Salesforce1 Platform
Building a Messaging Framework on the Salesforce1 Platform
 
AngularJS meets Rails
AngularJS meets RailsAngularJS meets Rails
AngularJS meets Rails
 
Sahi Principles and Architecture
Sahi Principles and ArchitectureSahi Principles and Architecture
Sahi Principles and Architecture
 
Introduction to Ruby on Rails
Introduction to Ruby on RailsIntroduction to Ruby on Rails
Introduction to Ruby on Rails
 
Agile documentation with Confluence and Sparx Enterprise Architect
Agile documentation with Confluence and Sparx Enterprise ArchitectAgile documentation with Confluence and Sparx Enterprise Architect
Agile documentation with Confluence and Sparx Enterprise Architect
 
Rails engine
Rails engineRails engine
Rails engine
 
Laravel development (Laravel History, Environment Setup & Laravel Installatio...
Laravel development (Laravel History, Environment Setup & Laravel Installatio...Laravel development (Laravel History, Environment Setup & Laravel Installatio...
Laravel development (Laravel History, Environment Setup & Laravel Installatio...
 
Sahi - Effective Web Testing (MT)
Sahi - Effective Web Testing (MT)Sahi - Effective Web Testing (MT)
Sahi - Effective Web Testing (MT)
 
Webservices: connecting Joomla! with other programs.
Webservices: connecting Joomla! with other programs.Webservices: connecting Joomla! with other programs.
Webservices: connecting Joomla! with other programs.
 

Ähnlich wie Ember App Kit & The Ember Resolver

Backbonification for dummies - Arrrrug 10/1/2012
Backbonification for dummies - Arrrrug 10/1/2012Backbonification for dummies - Arrrrug 10/1/2012
Backbonification for dummies - Arrrrug 10/1/2012Dimitri de Putte
 
EmberJS BucharestJS
EmberJS BucharestJSEmberJS BucharestJS
EmberJS BucharestJSRemus Rusanu
 
Riding the Edge with Ember.js
Riding the Edge with Ember.jsRiding the Edge with Ember.js
Riding the Edge with Ember.jsaortbals
 
Introduction to web application development with Vue (for absolute beginners)...
Introduction to web application development with Vue (for absolute beginners)...Introduction to web application development with Vue (for absolute beginners)...
Introduction to web application development with Vue (for absolute beginners)...Lucas Jellema
 
Mobile and IBM Worklight Best Practices
Mobile and IBM Worklight Best PracticesMobile and IBM Worklight Best Practices
Mobile and IBM Worklight Best PracticesAndrew Ferrier
 
JavaScript Modules Done Right
JavaScript Modules Done RightJavaScript Modules Done Right
JavaScript Modules Done RightMariusz Nowak
 
DSpace UI prototype dsember
DSpace UI prototype dsemberDSpace UI prototype dsember
DSpace UI prototype dsemberBram Luyten
 
Server and client rendering of single page apps
Server and client rendering of single page appsServer and client rendering of single page apps
Server and client rendering of single page appsThomas Heymann
 
Single Page Applications - Desert Code Camp 2012
Single Page Applications - Desert Code Camp 2012Single Page Applications - Desert Code Camp 2012
Single Page Applications - Desert Code Camp 2012Adam Mokan
 
Intro to SPA using JavaScript & ASP.NET
Intro to SPA using JavaScript & ASP.NETIntro to SPA using JavaScript & ASP.NET
Intro to SPA using JavaScript & ASP.NETAlan Hecht
 
Ember presentation
Ember presentationEmber presentation
Ember presentationDaniel N
 
Tech io spa_angularjs_20130814_v0.9.5
Tech io spa_angularjs_20130814_v0.9.5Tech io spa_angularjs_20130814_v0.9.5
Tech io spa_angularjs_20130814_v0.9.5Ganesh Kondal
 
Single Page Applications: Your Browser is the OS!
Single Page Applications: Your Browser is the OS!Single Page Applications: Your Browser is the OS!
Single Page Applications: Your Browser is the OS!Jeremy Likness
 
The future of web development write once, run everywhere with angular js an...
The future of web development   write once, run everywhere with angular js an...The future of web development   write once, run everywhere with angular js an...
The future of web development write once, run everywhere with angular js an...Mark Leusink
 

Ähnlich wie Ember App Kit & The Ember Resolver (20)

JavaScript MVC Frameworks: Backbone, Ember and Angular JS
JavaScript MVC Frameworks: Backbone, Ember and Angular JSJavaScript MVC Frameworks: Backbone, Ember and Angular JS
JavaScript MVC Frameworks: Backbone, Ember and Angular JS
 
Backbonification for dummies - Arrrrug 10/1/2012
Backbonification for dummies - Arrrrug 10/1/2012Backbonification for dummies - Arrrrug 10/1/2012
Backbonification for dummies - Arrrrug 10/1/2012
 
EmberJS BucharestJS
EmberJS BucharestJSEmberJS BucharestJS
EmberJS BucharestJS
 
Riding the Edge with Ember.js
Riding the Edge with Ember.jsRiding the Edge with Ember.js
Riding the Edge with Ember.js
 
Introduction to web application development with Vue (for absolute beginners)...
Introduction to web application development with Vue (for absolute beginners)...Introduction to web application development with Vue (for absolute beginners)...
Introduction to web application development with Vue (for absolute beginners)...
 
Mobile and IBM Worklight Best Practices
Mobile and IBM Worklight Best PracticesMobile and IBM Worklight Best Practices
Mobile and IBM Worklight Best Practices
 
JavaScript Modules Done Right
JavaScript Modules Done RightJavaScript Modules Done Right
JavaScript Modules Done Right
 
DSpace UI prototype dsember
DSpace UI prototype dsemberDSpace UI prototype dsember
DSpace UI prototype dsember
 
Server and client rendering of single page apps
Server and client rendering of single page appsServer and client rendering of single page apps
Server and client rendering of single page apps
 
Ember - introduction
Ember - introductionEmber - introduction
Ember - introduction
 
Single Page Applications - Desert Code Camp 2012
Single Page Applications - Desert Code Camp 2012Single Page Applications - Desert Code Camp 2012
Single Page Applications - Desert Code Camp 2012
 
Angular js 1.3 basic tutorial
Angular js 1.3 basic tutorialAngular js 1.3 basic tutorial
Angular js 1.3 basic tutorial
 
Protractor survival guide
Protractor survival guideProtractor survival guide
Protractor survival guide
 
Intro to SPA using JavaScript & ASP.NET
Intro to SPA using JavaScript & ASP.NETIntro to SPA using JavaScript & ASP.NET
Intro to SPA using JavaScript & ASP.NET
 
Gradle Again
Gradle AgainGradle Again
Gradle Again
 
Ember presentation
Ember presentationEmber presentation
Ember presentation
 
Tech io spa_angularjs_20130814_v0.9.5
Tech io spa_angularjs_20130814_v0.9.5Tech io spa_angularjs_20130814_v0.9.5
Tech io spa_angularjs_20130814_v0.9.5
 
Rhodes
RhodesRhodes
Rhodes
 
Single Page Applications: Your Browser is the OS!
Single Page Applications: Your Browser is the OS!Single Page Applications: Your Browser is the OS!
Single Page Applications: Your Browser is the OS!
 
The future of web development write once, run everywhere with angular js an...
The future of web development   write once, run everywhere with angular js an...The future of web development   write once, run everywhere with angular js an...
The future of web development write once, run everywhere with angular js an...
 

Kürzlich hochgeladen

GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 

Kürzlich hochgeladen (20)

GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 

Ember App Kit & The Ember Resolver

  • 1. EMBER APP KIT & THE EMBER RESOLVER or, “magic isn’t just for wizards (and Rails users) anymore” Thomas Boyt - Ember NYC 10.24.13
  • 2. Ember App Kit is boilerplate for ambitious web applications
  • 3. L HTML Ambitious web applications have lots of assets JavaScript Emblem CSS
  • 4. Ambitious web applications have lots of build tasks • Compilation • Concatenation • Minification • Linting • Server • Watcher
  • 5. Ambitious web applications have structure • app/ • components/ • controllers/ • helpers/ • public/ • tasks/ • options/ • tests/ • models/ • unit/ • routes/ • integration/ • styles/ • vendor/ • templates/ • Gruntfile.js • utils/ • bower.json • views/ • package.json • app.js • README.md • router.js
  • 7. Why modules? index.html 1 <html> 2 <head> 3 <title>My Super Awesome App</title> 4 5 <script src="vendor/jquery.js"></script> 6 <script src="vendor/handlebars.js"></script> 7 <script src="vendor/ember.js"></script> 8 </head> 9 <body> 10 <script type="text/handlebars" data-template-name="application"> 11 <h2>Welcome to Ember.js</h2> 12 13 {{outlet}} 14 </script> 15 16 <script type="text/handlebars" data-template-name="index"> 17 <ul> 18 {{#each}} 19 <li>{{this}}</li> 20 {{/each}} 21 </ul> 22 </script> 23 24 <script src="app.js"></script> 25 </body> 26 </html>
  • 8. Why modules? app.js 1 App = Ember.Application.create({}); 2 3 App.IndexRoute = Ember.Route.extend({ 4 model: function(){ 5 return [ 6 {firstName: 'Kris', lastName: 'Selden'}, 7 {firstName: 'Luke', lastName: 'Melia'}, 8 {firstName: 'Alex', lastName: 'Matchneer'} 9 ]; 10 } 11 });
  • 10. ES6 Modules: easy & futureproof foo.js 1 export default = Ember.Object.create({ 2 isAwesome: true 3 }); bar.js 1 import foo from "foo"; 2 3 console.log(foo.get("isAwesome")) // true
  • 11. ES6 Module Transpiler • https://github.com/square/es6-module-transpiler • Created by Yehuda Katz and Brian Donovan • Already used in Ember-related projects, including Handlebars, RSVP.js, and the Ember debug extension • Transpiles • Output runtime to AMD (RequireJS) or CommonJS modules is easy to read & debug, no extra obfuscation or
  • 12. Import statements aren’t cool • Modules • Ember are awesome, but manually wiring them up is not is built on convention: • App.PostController • App.PostRoute • App.PostView • post.hbs • How can we use similar conventions in a module system?
  • 13. Introducing the resolver, your new best friend • Remember our awesome new structure? • app/ • components/ • controllers/ • post.js • Each JS file is a module that export defaults a Route, View, Controller, or Model • models/ • These • templates/ files are resolved through an extra dependency, called the resolver • post.js • routes/ • post.js • post.hbs • utils/ • views/ • post.js
  • 14. Demo time! (and a disclaimer about syntax)
  • 15. Things that are resolver-friendly • Routes • Models (this.modelFor) • Controllers (this.controllerFor, needs, {{render}}) • Views ({{view}}) • Components • Ember and Helpers (Ember 1.2.0 beta) Data: Adapters, Serializers, and Transforms • Templates
  • 16. Other things you should know • Testing is easier: just import what you need (see test examples that come with Ember App Kit) • Modules • JSHint updates in progress (?) • Slower • Work can have source maps* builds than rake-pipeline :( continues!