The document describes refactoring a large web application with JavaScript from a messy state to using Backbone.js and a modular structure. It was refactored iteratively over several sprints. Key changes included breaking the JS into page-specific files, adding namespacing, using Backbone views to modularize code, moving to a model-view pattern, and finally implementing a module system using RequireJS and Browserify to bundle dependencies. This resulted in cleaner, more maintainable and testable JavaScript code.
Refactoring Large Web Applications with Backbone.jsStacy London
Have you ever starting working on a large, existing web application and jQuery spaghetti-code is all over the place? Your mind swirls as you try to figure out what code belongs to what component on what page. There are no JavaScript unit tests and you're terrified of making a change and breaking everything? I'm going to talk through the real life story of how Backbone.js helped to bring organization/structure, modularity, and testability to a large multi-page web application.
In The Trenches With Tomster, Upgrading Ember.js & Ember DataStacy London
A few months after I started working with Ember.js & Ember Data at my new job we began a project to upgrade both. There were parts that were a breeze and others that were quite tricky. This talk walks you through some of the challenges we faced and how we solved them as well as how we began to prepare for the Ember 2.x architectural shift. Hopefully this talk will help save you some time when you decide to upgrade your Ember web application.
The document discusses creating mobile apps using Ionic and includes the following topics:
1. Finding APIs and API documentation
2. Exploring Ionic JavaScript components like ion-content and ion-refresher
3. Reviewing code for an example home page template
A simple application called cvdb is used to illustrate best practices in combining AngularJS as a client browser technology with a Spring based Java server.
The server architecture utilizes the new Spring Boot module that was introduced with Spring 4 together with other Spring modules like Spring Data, Spring Security, Spring MVC.
QueryDSL is used to access a H2 in memory database.
In a world of emerging JavaScript, is Rails getting left behind? Are server-side MVC applications out and static single page applications in? In this talk I’ll describe how we’ve used webpack(er) and Vue to revitalize our JavaScript approach within an aging Rails application. You can have it both ways.
This document discusses using Ionic and AngularJS to build mobile apps. It provides an introduction to AngularJS, examples of AngularJS code, and instructions for setting up a development environment and creating a basic AngularJS app with inputs bound to variables.
Introducing Rendr: Run your Backbone.js apps on the client and serverSpike Brehm
Rendr is a JavaScript library that allows Backbone.js applications to run on both the client and server sides. It provides common classes and logic that can be reused across both environments, such as BaseView, BaseModel, and routers. On the server, it renders the HTML output using the same application logic. On the client, it hydrates the views by attaching them to the corresponding DOM elements. The goal is to write application logic in a way that is agnostic to the environment, avoiding duplicating code or context switching between client and server implementations.
Hastening React SSR - Web Performance San DiegoMaxime Najim
Hastening React SSR with component memoization and templatization: React is a best-of-breed UI component framework allowing WalmartLabs to build higher level components that can be shared and reused across pages and apps. In this presentation, Max Najim and Naga Malepati from WalmartLabs will peel through the React codebase to add a component caching/memoization optimization. The will use a require(..) hook to inject their optimization while avoiding the need to fork the React codebase. And, they will review the caching optimization.
Refactoring Large Web Applications with Backbone.jsStacy London
Have you ever starting working on a large, existing web application and jQuery spaghetti-code is all over the place? Your mind swirls as you try to figure out what code belongs to what component on what page. There are no JavaScript unit tests and you're terrified of making a change and breaking everything? I'm going to talk through the real life story of how Backbone.js helped to bring organization/structure, modularity, and testability to a large multi-page web application.
In The Trenches With Tomster, Upgrading Ember.js & Ember DataStacy London
A few months after I started working with Ember.js & Ember Data at my new job we began a project to upgrade both. There were parts that were a breeze and others that were quite tricky. This talk walks you through some of the challenges we faced and how we solved them as well as how we began to prepare for the Ember 2.x architectural shift. Hopefully this talk will help save you some time when you decide to upgrade your Ember web application.
The document discusses creating mobile apps using Ionic and includes the following topics:
1. Finding APIs and API documentation
2. Exploring Ionic JavaScript components like ion-content and ion-refresher
3. Reviewing code for an example home page template
A simple application called cvdb is used to illustrate best practices in combining AngularJS as a client browser technology with a Spring based Java server.
The server architecture utilizes the new Spring Boot module that was introduced with Spring 4 together with other Spring modules like Spring Data, Spring Security, Spring MVC.
QueryDSL is used to access a H2 in memory database.
In a world of emerging JavaScript, is Rails getting left behind? Are server-side MVC applications out and static single page applications in? In this talk I’ll describe how we’ve used webpack(er) and Vue to revitalize our JavaScript approach within an aging Rails application. You can have it both ways.
This document discusses using Ionic and AngularJS to build mobile apps. It provides an introduction to AngularJS, examples of AngularJS code, and instructions for setting up a development environment and creating a basic AngularJS app with inputs bound to variables.
Introducing Rendr: Run your Backbone.js apps on the client and serverSpike Brehm
Rendr is a JavaScript library that allows Backbone.js applications to run on both the client and server sides. It provides common classes and logic that can be reused across both environments, such as BaseView, BaseModel, and routers. On the server, it renders the HTML output using the same application logic. On the client, it hydrates the views by attaching them to the corresponding DOM elements. The goal is to write application logic in a way that is agnostic to the environment, avoiding duplicating code or context switching between client and server implementations.
Hastening React SSR - Web Performance San DiegoMaxime Najim
Hastening React SSR with component memoization and templatization: React is a best-of-breed UI component framework allowing WalmartLabs to build higher level components that can be shared and reused across pages and apps. In this presentation, Max Najim and Naga Malepati from WalmartLabs will peel through the React codebase to add a component caching/memoization optimization. The will use a require(..) hook to inject their optimization while avoiding the need to fork the React codebase. And, they will review the caching optimization.
Modular Test-driven SPAs with Spring and AngularJSGunnar Hillert
The document discusses creating modular test-driven single page applications (SPAs) using Spring and AngularJS. It provides an overview of AngularJS concepts and how to integrate AngularJS with Spring, including building and deploying AngularJS apps, modularization, and testing. It also covers AngularJS basics like models, views, controllers, directives, and modules.
We Will learn about:
What is AngularJs?
Key Points
Core Features of AngularJS
How is it works?
AngularJs Terminologies
AngularJs directives
How we start work on AngularJs?
AngularJs Tags
How we use Yeoman?
Advantages and Disadvantages
From Backbone to Ember and Back(bone) Againjonknapp
As a software consultant, I get to see a lot of interesting code. In this particular instance a client was in the process of transforming their web application to a rich, interactive interface with the help of another company.
The project kicked off using Backbone and things were great. Until they were not great. Pages starting getting more and more involved and blame started being thrown at the technology choice.
A move to Ember.js ensued and the app was rewritten. But architecturally bad decisions don't hide long, and soon the rewrite was preforming even worse. That's when I stepped in, with the help of another consultant, to solve the performance issues once and for all. Our solution used Backbone.js and it was fast. This is that journey.
Vue.js is an open-source progressive framework for building user interfaces that focuses on the view layer. It has a virtual DOM and reactive components. Its core is small and works well with companion libraries. Single file components allow importing of templates, logic, and styles. Popular companion libraries include Vuex for state management and Vue Router for routing. The Vue CLI makes it easy to scaffold Vue projects with features like routing, lazy loading, and preloading for improved performance.
Vue.js is a progressive JavaScript framework that focuses on building user interfaces and is used for single-page applications. It was created by Evan You and released in 2014. Vue.js uses declarative templates and reactive data binding to render the view layer for an application. Templates in Vue use HTML-based syntax with directives prefixed with v- to dynamically bind expression results. Common directives include v-bind, v-if, and v-for. Vue.js applications can be built with its core library or integrated with other libraries and frameworks.
Vue.js is described as a "boring" framework that helps developers get work done without unnecessary complexity. It borrows best practices from other frameworks like React but aims to have simpler dependencies and templates. Vue.js uses reactive templates that can be written with plain JavaScript or JSX, and allows separating component logic from presentation with single file components. It also avoids unnecessary re-renders through its reactive system. The document demonstrates how Vue.js can be preferable for teams with mix of experience levels due to its flexibility and lack of complexity compared to other frameworks like React.
The presentation slide for Vue.js meetup
http://abeja-innovation-meetup.connpass.com/event/38214/
That contains mainly about SSR (Server side rendering) + SPA with isomorphic fetch and client hydration
This document discusses JavaScript patterns and principles for building modular applications. It covers topics like modularity, communication patterns using callbacks, promises, event emitters and publish/subscribe. It also discusses patterns within MV* architectures like MVC, MVP and MVVM. The document emphasizes breaking applications into small independent and reusable modules that are loosely coupled through communication patterns.
Building Single Page Application (SPA) with Symfony2 and AngularJSAntonio Peric-Mazar
Forget about classic website where UX is not so important. We are living in time where usability is one of the important thing if you are building some business client oriented web service. How to connect Symfony2 as backend and AngularJS as frontend solution? What are best practices? What are disadvantageous? How to take best from both worlds? These are topics I will cover in my talk with real examples.
Vuex is a state management pattern for Vue.js applications that serves as a centralized store for component data. It consists of state, getters, mutations, and actions. State contains app data, getters help access state, mutations are the only way to modify state and must be synchronous, and actions allow asynchronous operations and commit mutations.
Universal JS Web Applications with React - Luciano Mammino - Codemotion Rome ...Luciano Mammino
This document outlines a presentation about building universal JavaScript web applications with React. It discusses:
1. The term "universal" in relation to JavaScript and some advantages it provides like maintainability and faster load times.
2. Building a frontend single page application with React and then making it universal by rendering on the server as well with React and Express.
3. Key aspects of universal apps like module sharing, routing, data retrieval and state management that work across client and server.
4. An example of building a universal JavaScript app with React called "Judo Heroes" that shows athlete data and profiles, using components, routing, data and building tools like Babel and Webpack.
Create Restful Web Application With Node.js Express FrameworkEdureka!
Node.js uses JavaScript - a language known to millions of developers worldwide - thus giving it a much lower learning curve even for complete beginners. Using Node.js you can build simple Command Line programs or complex enterprise level web applications with equal ease. Node.js is an event-driven, server-side, asynchronous development platform with lightning speed execution. Node.js helps you to code the most complex functionalities in just a few lines of code.
125 고성능 web view-deview 2013 발표 자료_공유용NAVER D2
The document discusses ways to improve the performance of hybrid mobile applications that use WebView. It describes how WebView has less powerful capabilities and worse web standard compatibility compared to mobile browsers. This can cause issues like fragmentation across device versions.
The document proposes techniques for creating a high-performance WebView, including adding new capabilities like WebSockets, and replacing slower native elements like Canvas 2D with optimized custom implementations. It provides code examples for calling JavaScript from native and vice versa on Android and iOS. Lessons learned emphasize minimizing native/JavaScript communication and dealing with threading issues.
Presentation from Denver Open Source Users Group in February 2015. http://www.meetup.com/DOSUG1/events/219099019/
AngularJS is one of today's hottest JavaScript MVC Frameworks. In this session, we'll explore many concepts it brings to the world of client-side development: dependency injection, directives, filters, routing and two-way data binding. We'll also look at its recommended testing tools and build systems. Finally, you'll learn about my experience developing several real-world applications using AngularJS, HTML5 and Bootstrap.
This document provides an overview of the Ionic Framework, including:
- Ionic is an open source SDK for building hybrid mobile apps using web technologies like HTML, CSS, and JavaScript.
- It uses Cordova to access native device capabilities and wrap the app in a native shell.
- The document covers installing Ionic, using the Ionic CLI, CSS components, AngularJS directives, and integrating Sass for styling.
Presented at Web Unleashed 2017. More info at www.fitc.ca/webu
Presented by Ksenija Gogic, TWG
Overview
What are components? How can designers apply a component-minded approach to their workflow? How can we leverage components to improve the design handoff? Ultimately – how can designers and developers work together even better?
Using React as a framework, Ksenija will discuss how to design for a component-based web application to make for a more efficient workflow, an easier design handoff, and a better understanding between roles.
Objective
To create a common language and understanding when working with component-based web frameworks between designers and developers.
Target Audience
Designers and developers looking to make their collaborative workflow even better.
Five Things Audience Members Will Learn
How to take a component-minded approach to building a design system
How to design and create components using Sketch symbols
How to assemble (compose) collections of components using Sketch symbols
How to work with modifiers (props) to customize components
How to ensure everyone is speaking the same language
This document discusses Cordova hooks. It begins with an introduction to Cordova and what hooks are. Hooks allow scripts to execute when certain Cordova events occur, like before or after a build. Hooks can be written in any language but are best in Node.js. Common uses of hooks include linting JavaScript files for errors, minifying code for production, and generating app icons and splash screens. The document demonstrates how to configure hooks and provides examples of JS Hint and Cordova Uglify hooks to automate tasks and improve code quality. It concludes with asking if attendees have any other questions.
There are 5 key options for implementing REST APIs in ColdFusion: 1) Natively in CF10+, 2) Natively in Railo 4+, 3) Using the Taffy framework, 4) Using the ColdBox framework with the RELAX module, 5) Using the lightweight FW1 framework. Each option has different configurations, routing conventions, and considerations around simplicity, extensibility, and documentation. The document recommends choosing based on application architecture needs and that every option can work, with the most important things being to take security seriously, make robust APIs, and get creative.
Modular Test-driven SPAs with Spring and AngularJSGunnar Hillert
The document discusses creating modular test-driven single page applications (SPAs) using Spring and AngularJS. It provides an overview of AngularJS concepts and how to integrate AngularJS with Spring, including building and deploying AngularJS apps, modularization, and testing. It also covers AngularJS basics like models, views, controllers, directives, and modules.
We Will learn about:
What is AngularJs?
Key Points
Core Features of AngularJS
How is it works?
AngularJs Terminologies
AngularJs directives
How we start work on AngularJs?
AngularJs Tags
How we use Yeoman?
Advantages and Disadvantages
From Backbone to Ember and Back(bone) Againjonknapp
As a software consultant, I get to see a lot of interesting code. In this particular instance a client was in the process of transforming their web application to a rich, interactive interface with the help of another company.
The project kicked off using Backbone and things were great. Until they were not great. Pages starting getting more and more involved and blame started being thrown at the technology choice.
A move to Ember.js ensued and the app was rewritten. But architecturally bad decisions don't hide long, and soon the rewrite was preforming even worse. That's when I stepped in, with the help of another consultant, to solve the performance issues once and for all. Our solution used Backbone.js and it was fast. This is that journey.
Vue.js is an open-source progressive framework for building user interfaces that focuses on the view layer. It has a virtual DOM and reactive components. Its core is small and works well with companion libraries. Single file components allow importing of templates, logic, and styles. Popular companion libraries include Vuex for state management and Vue Router for routing. The Vue CLI makes it easy to scaffold Vue projects with features like routing, lazy loading, and preloading for improved performance.
Vue.js is a progressive JavaScript framework that focuses on building user interfaces and is used for single-page applications. It was created by Evan You and released in 2014. Vue.js uses declarative templates and reactive data binding to render the view layer for an application. Templates in Vue use HTML-based syntax with directives prefixed with v- to dynamically bind expression results. Common directives include v-bind, v-if, and v-for. Vue.js applications can be built with its core library or integrated with other libraries and frameworks.
Vue.js is described as a "boring" framework that helps developers get work done without unnecessary complexity. It borrows best practices from other frameworks like React but aims to have simpler dependencies and templates. Vue.js uses reactive templates that can be written with plain JavaScript or JSX, and allows separating component logic from presentation with single file components. It also avoids unnecessary re-renders through its reactive system. The document demonstrates how Vue.js can be preferable for teams with mix of experience levels due to its flexibility and lack of complexity compared to other frameworks like React.
The presentation slide for Vue.js meetup
http://abeja-innovation-meetup.connpass.com/event/38214/
That contains mainly about SSR (Server side rendering) + SPA with isomorphic fetch and client hydration
This document discusses JavaScript patterns and principles for building modular applications. It covers topics like modularity, communication patterns using callbacks, promises, event emitters and publish/subscribe. It also discusses patterns within MV* architectures like MVC, MVP and MVVM. The document emphasizes breaking applications into small independent and reusable modules that are loosely coupled through communication patterns.
Building Single Page Application (SPA) with Symfony2 and AngularJSAntonio Peric-Mazar
Forget about classic website where UX is not so important. We are living in time where usability is one of the important thing if you are building some business client oriented web service. How to connect Symfony2 as backend and AngularJS as frontend solution? What are best practices? What are disadvantageous? How to take best from both worlds? These are topics I will cover in my talk with real examples.
Vuex is a state management pattern for Vue.js applications that serves as a centralized store for component data. It consists of state, getters, mutations, and actions. State contains app data, getters help access state, mutations are the only way to modify state and must be synchronous, and actions allow asynchronous operations and commit mutations.
Universal JS Web Applications with React - Luciano Mammino - Codemotion Rome ...Luciano Mammino
This document outlines a presentation about building universal JavaScript web applications with React. It discusses:
1. The term "universal" in relation to JavaScript and some advantages it provides like maintainability and faster load times.
2. Building a frontend single page application with React and then making it universal by rendering on the server as well with React and Express.
3. Key aspects of universal apps like module sharing, routing, data retrieval and state management that work across client and server.
4. An example of building a universal JavaScript app with React called "Judo Heroes" that shows athlete data and profiles, using components, routing, data and building tools like Babel and Webpack.
Create Restful Web Application With Node.js Express FrameworkEdureka!
Node.js uses JavaScript - a language known to millions of developers worldwide - thus giving it a much lower learning curve even for complete beginners. Using Node.js you can build simple Command Line programs or complex enterprise level web applications with equal ease. Node.js is an event-driven, server-side, asynchronous development platform with lightning speed execution. Node.js helps you to code the most complex functionalities in just a few lines of code.
125 고성능 web view-deview 2013 발표 자료_공유용NAVER D2
The document discusses ways to improve the performance of hybrid mobile applications that use WebView. It describes how WebView has less powerful capabilities and worse web standard compatibility compared to mobile browsers. This can cause issues like fragmentation across device versions.
The document proposes techniques for creating a high-performance WebView, including adding new capabilities like WebSockets, and replacing slower native elements like Canvas 2D with optimized custom implementations. It provides code examples for calling JavaScript from native and vice versa on Android and iOS. Lessons learned emphasize minimizing native/JavaScript communication and dealing with threading issues.
Presentation from Denver Open Source Users Group in February 2015. http://www.meetup.com/DOSUG1/events/219099019/
AngularJS is one of today's hottest JavaScript MVC Frameworks. In this session, we'll explore many concepts it brings to the world of client-side development: dependency injection, directives, filters, routing and two-way data binding. We'll also look at its recommended testing tools and build systems. Finally, you'll learn about my experience developing several real-world applications using AngularJS, HTML5 and Bootstrap.
This document provides an overview of the Ionic Framework, including:
- Ionic is an open source SDK for building hybrid mobile apps using web technologies like HTML, CSS, and JavaScript.
- It uses Cordova to access native device capabilities and wrap the app in a native shell.
- The document covers installing Ionic, using the Ionic CLI, CSS components, AngularJS directives, and integrating Sass for styling.
Presented at Web Unleashed 2017. More info at www.fitc.ca/webu
Presented by Ksenija Gogic, TWG
Overview
What are components? How can designers apply a component-minded approach to their workflow? How can we leverage components to improve the design handoff? Ultimately – how can designers and developers work together even better?
Using React as a framework, Ksenija will discuss how to design for a component-based web application to make for a more efficient workflow, an easier design handoff, and a better understanding between roles.
Objective
To create a common language and understanding when working with component-based web frameworks between designers and developers.
Target Audience
Designers and developers looking to make their collaborative workflow even better.
Five Things Audience Members Will Learn
How to take a component-minded approach to building a design system
How to design and create components using Sketch symbols
How to assemble (compose) collections of components using Sketch symbols
How to work with modifiers (props) to customize components
How to ensure everyone is speaking the same language
This document discusses Cordova hooks. It begins with an introduction to Cordova and what hooks are. Hooks allow scripts to execute when certain Cordova events occur, like before or after a build. Hooks can be written in any language but are best in Node.js. Common uses of hooks include linting JavaScript files for errors, minifying code for production, and generating app icons and splash screens. The document demonstrates how to configure hooks and provides examples of JS Hint and Cordova Uglify hooks to automate tasks and improve code quality. It concludes with asking if attendees have any other questions.
There are 5 key options for implementing REST APIs in ColdFusion: 1) Natively in CF10+, 2) Natively in Railo 4+, 3) Using the Taffy framework, 4) Using the ColdBox framework with the RELAX module, 5) Using the lightweight FW1 framework. Each option has different configurations, routing conventions, and considerations around simplicity, extensibility, and documentation. The document recommends choosing based on application architecture needs and that every option can work, with the most important things being to take security seriously, make robust APIs, and get creative.
Our application got popular and now it breaksdevObjective
Our application got popular and now breaks under load. The document discusses common issues that cause applications to break as user load increases, such as overuse of shared scopes, inefficient database queries, and slow client-side performance. It provides examples of better approaches and techniques to optimize performance, such as using distributed caching, proper database queries with indexes and joins, front-end optimizations like prioritizing critical CSS, and tools for monitoring and profiling applications.
Ruta de El Hereje. Miguel Delibes.Valladolid.Henardelarosa
Ruta realizada el 15 de mayo de 2015. Trabajo realizado por Jorge Díez, Sergio García, Lucía García y Belén Fernández (4º B - ESO. Colegio Amor de Dios, Valladolid)
The document provides guidance on working remotely effectively. It discusses defining remote work, the pros and cons for employers and employees, setting up an effective home office, developing routines and discipline, maintaining communication, and having discussions with bosses about remote work arrangements. The keys to success include establishing clear boundaries, communicating regularly, avoiding bad habits, meeting deadlines, and working hard to overcome stereotypes about remote employees.
Este documento describe la historia y tipos de medios y materiales de enseñanza. Explica que los medios han evolucionado desde grabados rupestres hasta la digitalización, y que en la Edad Media el conocimiento estaba en manos del clero mientras que el Renacimiento trajo una democratización. Además, detalla que existen medios manipulativos, textuales, audiovisuales e informáticos y que estos sistemas simbólicos codifican el conocimiento y mejoran la comunicación, por lo que la educación escolar debe enseñar a
O documento apresenta fotos e arquivos de diversos projetos realizados em 2014, incluindo o início das atividades do curso, saídas de campo, palestras, eventos sobre áreas rurais e agroecologia, além de fotos de projetos antigos sobre alimentação saudável e sustentabilidade.
1) The document discusses how to build modular web applications using the JavaScript frameworks Backbone.js and RequireJS. It advocates separating an application into reusable components using the Model-View-Controller (MVC) pattern and composing the interface from independent views.
2) RequireJS allows code to be split into bite-sized modules and defines dependencies between modules. This supports large-scale application development and avoids dependency issues.
3) The document provides an example of a fictitious stock trading application called Bullsfirst that demonstrates these techniques and emphasizes the importance of architecture for engaging web applications.
WebNet Conference 2012 - Designing complex applications using html5 and knock...Fabio Franzini
This document provides an overview of designing complex applications using HTML5 and KnockoutJS. It discusses HTML5 and why it is useful, introduces JavaScript and frameworks like KnockoutJS and SammyJS that help manage complexity. It also summarizes several JavaScript libraries and patterns including the module pattern, revealing module pattern, and MV* patterns. Specific libraries and frameworks discussed include RequireJS, AmplifyJS, UnderscoreJS, and LINQ.js. The document concludes with a brief mention of server-side tools like ScriptSharp.
This document provides an overview of the Swing Application Framework and Beans Binding frameworks being developed as part of JSR 296 and JSR 295. It discusses the motivations for creating standard frameworks to simplify Swing development, outlines the key goals and components of the Swing Application Framework, and briefly introduces Beans Binding for keeping object properties in sync. The frameworks are aimed at addressing common issues for typical Swing applications and are intended for the Java SE 7 platform.
The document provides information about React, including:
- React is a JavaScript library for building user interfaces and single-page applications using reusable UI components.
- Additional benefits of React include improved speed, use of a virtual DOM for better performance, readability through components, and support from a large community.
- The history and current versions of React and related tools like Create React App are provided.
- Getting started with React requires Node.js and NPM, and an example React code snippet is given.
- Key concepts in React like components, importing/exporting files, and using JSX syntax are summarized.
- Play 2.0 is a web framework for Java and Scala that simplifies development by embracing HTTP rather than fighting it
- It takes a new approach to building web apps in Java by not being built on top of servlet APIs and using an asynchronous programming model
- Developing, testing, and deploying a Play app locally and to CloudFoundry involves creating a project, running it locally, and pushing the compiled code to CloudFoundry which automatically detects and supports Play apps
Building Isomorphic Apps (JSConf.Asia 2014)Spike Brehm
Over the past year or so, we’ve seen the emergence of a new way of building JavaScript web apps that share code between the web browser and the server, using Node.js — a technique that has come to be known as "isomorphic JavaScript.” There are a variety of use cases for isomorphic JavaScript; some apps render HTML on both the server and the client, some apps share just a few small bits of application logic, while others share the entire application runtime between client and server to provide advanced offline and realtime features. Why go isomorphic? The main benefits are performance, maintainability, reusability, and SEO.
This talk shares examples of isomorphic JavaScript apps running in the wild, explore the exploding ecosystem of asset building tools, such as Browserify, Webpack, and Gulp, that allow developers to build their own isomorphic JavaScript apps with open-source libraries, demonstrate how to build an isomorphic JavaScript module from scratch, and explore how libraries like React and Flux can be used to build a single-page app that renders on the server.
A guide to create a simple Java application and upload it to the Google Cloud Platform with Google App Engine. This presentation covers usage of persistence API with both Google Cloud SQL and Google Cloud Datastore.
Android Workshop for NTU. A getting started guide to android application development.
UPDATE (Oct 2013): An updated slide at http://samwize.com/2013/10/13/android-workshop-2013/
Code generation in Magento 2 automatically generates code to handle dependency injection, interception, and the service layer. Key types of generated code include factories for object instantiation, proxies for optional dependencies, interceptors for plugins, repositories for the service layer, extension attributes, and loggers. This code generation improves abstraction, avoids boilerplate code, and enables features like dependency injection, aspect-oriented programming and generic programming in Magento 2.
Copy of the slides from the Advanced Web Development Workshop presented by Ed Bachta, Charlie Moad and Robert Stein of the Indianapolis Museum of Art during the Museums and the Web 2008 conference in Montreal
Developing large scale JavaScript applicationsMilan Korsos
Developing large scale JavaScript applications
24/11/11 @ Front end meetup, Budapest (Hungary)
www.milankorsos.com
www.twitter.com/korsosm
www.sowink.com
The document provides information on Node.js, including its definition, advantages, companies that use it, and basic terminology. Node.js is a server-side JavaScript platform that allows building fast and scalable network applications. It uses an event-driven, non-blocking I/O model that makes it lightweight and efficient for data-intensive real-time apps. Some key advantages are its use of JavaScript, the fast V8 engine, support for building highly scalable web apps, and thousands of available modules. Major companies like Microsoft, Yahoo, and LinkedIn use Node.js. Basic terminology discussed includes asynchronous programming, npm, Express framework, modules, and REPL.
Html5 and beyond the next generation of mobile web applications - Touch Tou...RIA RUI Society
The document discusses upcoming features in HTML5 and beyond for developing mobile web applications, including offline web apps using the Application Cache, storing data locally using Web Storage, geolocation APIs, device orientation, camera access using getUserMedia, and media queries for responsive design. It provides code examples and encourages further reading on mobile web best practices.
Java Web Programming on Google Cloud Platform [3/3] : Google Web ToolkitIMC Institute
Google Web Toolkit (GWT) is an open source Java framework that allows web developers to create Ajax applications in Java and deploy them as optimized JavaScript. GWT provides tools for building AJAX applications in Java that are compiled into JavaScript for cross-browser compatibility. It handles browser inconsistencies and integrates with existing Java development tools, allowing developers to build and debug Rich Internet Applications using Java instead of JavaScript.
Front End Development for Back End Developers - UberConf 2017Matt Raible
Are you a backend developer that’s being pushed into front end development? Are you frustrated with all JavaScript frameworks and build tools you have to learn to be a good UI developer? If so, this session is for you! We’ll explore the tools of the trade for frontend development (npm, yarn, Gulp, Webpack, Yeoman) and learn the basics of HTML, CSS, and JavaScript.
This presentation dives into the intricacies of Bootstrap, Material Design, ES6, and TypeScript. Finally, after getting you up to speed with all this new tech, I'll show how it can all be found and integrated through the fine and dandy JHipster project.
Google Web Toolkit
Presentation by Assoc.Prof. Dr.Thanachart Numnonda & Asst.Prof. Thanisa Kruawaisayawan, Mini Master of Java Technology KMITL, July 2012
jQuery Mobile part 2 discusses various topics related to jQuery Mobile including document events, configuration, methods and utilities, themes, and app packaging. Some key points:
- Document events in jQuery Mobile include mobileinit, ready, and load which are used to configure jQuery Mobile settings and enhance markup.
- Configuration options exist for global settings, UI, AJAX, regionalization, touch overflow, and widgets. These can be modified to customize jQuery Mobile's behavior.
- Methods and utilities provide functions for manipulating data attributes, changing pages, and accessing platform information.
- Themes use CSS3 properties and gradients to style elements with different "swatches" for headers, content, and buttons. Themes
The document discusses Clean Architecture and provides an example of implementing it using a Movie Night app. It describes separating the app into Presentation, Data, and Domain layers with specific responsibilities. The Domain layer contains entities, use cases, and interfaces. The Data layer encapsulates data sources and mappers. The Presentation layer connects everything using ViewModels, LiveData, and observing lifecycle changes. It demonstrates how data flows from the Data layer through UseCases to the Presentation layer and updates the UI.
Presented at Bucharest Java User Group, http://www.bjug.ro/editii/5.html . Project source code available at: https://github.com/bucharest-jug/dropwizard-todo
This document discusses Git strategies for teams. It outlines several branching strategies including "wing and a prayer", long-running branches, Git flow, and branch-per-feature. Git flow uses long-running branches with specific rules for features, hotfixes, bugs, and only merging develop branches to master once stable. Branch-per-feature creates a new branch for each feature or change and nothing is merged until production deployment. The document also discusses automation, team composition, environments, and selection criteria to consider when choosing a branching strategy.
1) The document discusses running ColdFusion on a Raspberry Pi single board computer. It provides instructions for installing CommandBox and other tools to run CFML code on the Pi.
2) Performance tests show the Pi can handle over 1000 requests per second serving simple CFML pages.
3) The document explores various projects that can be built with the Pi including interacting with GPIO pins to control LEDs and shift registers, building a LED matrix display, and clustering multiple Pis.
CommandBox is a CLI (command line interface) package manager and automation tool for ColdFusion developers. It provides features like a package manager, REPL (read-eval-print loop), integrated server, scaffolding for frameworks like ColdBox and ContentBox, and automation commands to integrate CFML development with tasks like unit testing and source control. CommandBox aims to improve the ColdFusion development workflow and enable new use cases like packaging and distributing CFML applications and libraries.
The document discusses effective version control. It begins with an introduction of the presenter and overview of topics to be covered, including concepts, evolution of version control systems, best practices, and whether centralized or distributed systems are better. Key concepts discussed include repositories, working copies, patches, history, tags, branches, merges, and ancestry. The evolution of version control systems from early ones like SCCS and RCS to modern ones like Git, Mercurial, Subversion, and Team Foundation Server is outlined. Best practices recommended include committing often, branching early and merging often, and keeping the master branch releasable. The document concludes by emphasizing the power of version control tools and reusing existing code rather than reinventing
This document discusses strategies for modernizing front-end codebases in an incremental way. It recommends starting with basic modularization by splitting code into logical chunks, then concatenating and minifying files. Next steps include loading modules on demand using various module systems. Graceful deprecation is advised by keeping deprecated code available temporarily while logging its usage. Framework choices should be informed by building prototypes in different options. Overall modernization should prioritize tools like testing, linting and performance testing over choosing specific frameworks. Changes should be made gradually to avoid diverging from existing workflows.
Using type script to build better appsdevObjective
TypeScript is a typed superset of JavaScript that compiles to plain JavaScript. It allows you to write JavaScript in a more structured way using types, classes, and interfaces. Using TypeScript can help catch errors early and provide better code completion through tooling. While TypeScript adds types and other features, JavaScript code is still valid TypeScript code. The TypeScript compiler outputs plain JavaScript that runs on any browser or environment.
This document discusses various HTTP security headers and the W3C Content Security Policy. It provides an overview of headers like X-Content-Type-Options, X-XSS-Protection, X-Frame-Options, cookies, HTTP Strict Transport Security (HSTS), and the Content Security Policy. It also demonstrates how to configure these headers and gives examples of policies for different browsers and sites.
This document discusses software security and outlines a 4 step plan to improve it. It begins by recommending studying successful security initiatives at other companies. The second step is to inventory your own applications to understand what data and services they involve. The third step is to incorporate security practices into agile development processes and use tools to help scale this. The final step is to drive a security-focused culture change and have plans for incident response.
The document discusses using offline storage on mobile devices by leveraging HTML, JavaScript, and technologies like Cordova, PouchDB, and CouchDB. It summarizes the evolution of HTML5 offline storage standards including Web Storage, Web SQL, and IndexedDB. It then outlines an approach to building a mobile app that works offline by storing data locally on the device using IndexedDB and syncing with a remote CouchDB database using PouchDB when an internet connection is available.
This document provides an overview of a presentation on web penetration testing and hacking tools. It introduces the presenter and their background in security. It states that the presentation will demonstrate various penetration testing tools against virtual web applications and provide a quick overview of web application firewalls and vulnerability scanners. It provides details on some recent hacking events and vulnerabilities like Heartbleed and discusses tools like sqlmap, BeEF, and Metasploit that will be demonstrated.
Node Without Servers: Event-Driven Computing with AWS Lambda describes AWS Lambda and how it allows running code without servers. Lambda runs code in response to events, scales automatically, and charges only for the compute time used. Code runs in isolated containers and Lambda manages the computing resources. This allows building event-driven applications and services that respond quickly to new information.
This document is a presentation about design fundamentals given by Justine Arreche. It covers grids and content structure, color theory, and typography. For grids, it emphasizes laying out the grid first to keep content organized. Regarding color theory, it discusses using relevant colors aligned to messaging and creating contrast with colors on opposite sides of the color wheel. For typography, it recommends pairing type families and choosing typefaces with common traits or contrasts to create diversity and emphasis.
The document discusses the Garbage First (G1) garbage collector in the Java Virtual Machine (JVM). It provides an overview of G1, including its core ideas of using snapshot-at-the-beginning marking and dividing memory into variable-sized regions. It describes how G1 handles young and old generation garbage collection using concurrent marking and mixed garbage collections. The document also discusses tuning G1, such as setting the maximum GC pause time goal and heap occupancy percentage for starting concurrent collection.
FusionReactor is a monitoring and troubleshooting tool that provides visibility into application performance and issues. It allows users to view current and historical requests, database activity, errors and more. The tool helps diagnose problems by showing stack traces, logs and other details. FusionReactor 6 includes new metrics, enhanced session tracking, and an option for cloud-based monitoring. An upcoming feature called Unattended Production Debugger will automatically fix problems without user intervention.
The document discusses Justine's personal experience with bulimia and how it affected her life and career. It provides information about eating disorders, including definitions and statistics. It offers suggestions for how companies can help employees who may be struggling with an eating disorder, such as addressing performance issues confidentially with HR, providing information on treatment resources and medical leave policies, and ensuring compliance with disability laws. The talk aims to help reduce stigma and support those suffering from these mental health issues.
This document discusses SQL skills and how queries can negatively impact server performance if not written efficiently. It covers topics like query plans, execution contexts, using parameters, indexing, handling large datasets, and external influences on SQL performance. Specific "bad" SQL examples are also provided and explained. The presenter's goal is to help developers optimize their SQL and prevent poorly written queries from bringing servers to their knees.
This document discusses authentication, authorization, and fine-grained access control. It introduces different levels of authorization from anonymous access to fine-grained control varying across users and resources. It provides examples of implementing fine-grained security using annotations and services. API security is also discussed, with authentication handled via OAuth2 and authorization using annotations. Pattern languages are presented as a way to discuss difficult technical problems using consistent terminology.
This document discusses using RabbitMQ for messaging between applications. It begins with an introduction to the presenter and agenda. It then contrasts traditional RPC-style calls with messaging and covers some benefits of messaging like decoupling and flexibility. Common messaging patterns like publish/subscribe, topics, and work queues are introduced. The AMQP protocol and RabbitMQ implementation are explained. Finally, a demo of RabbitMQ is promised along with Q&A.
This document contains notes from a presentation on software architecture. It discusses key principles like examining requirements to understand user needs, designing for foreseeable changes, and clear communication between architects and developers. Case studies are used to illustrate how understanding the problem domain leads to more elegant solutions. Overall it emphasizes that architecture is about managing risks to the application and knowing enough about the problem to design appropriately.
This document discusses test-driven development (TDD) and behavior-driven development (BDD). It defines TDD as a process of writing automated tests before code to define desired functionality, then writing minimum code to pass tests and refactoring. BDD combines TDD techniques with domain-driven design and focuses on user stories over functions to promote communication. The document provides an example of using BDD to generate scenarios for a life insurance risk example, and shows how TestBox can be used to write automated tests based on those scenarios.
For the full video of this presentation, please visit: https://www.edge-ai-vision.com/2024/06/building-and-scaling-ai-applications-with-the-nx-ai-manager-a-presentation-from-network-optix/
Robin van Emden, Senior Director of Data Science at Network Optix, presents the “Building and Scaling AI Applications with the Nx AI Manager,” tutorial at the May 2024 Embedded Vision Summit.
In this presentation, van Emden covers the basics of scaling edge AI solutions using the Nx tool kit. He emphasizes the process of developing AI models and deploying them globally. He also showcases the conversion of AI models and the creation of effective edge AI pipelines, with a focus on pre-processing, model conversion, selecting the appropriate inference engine for the target hardware and post-processing.
van Emden shows how Nx can simplify the developer’s life and facilitate a rapid transition from concept to production-ready applications.He provides valuable insights into developing scalable and efficient edge AI solutions, with a strong focus on practical implementation.
Full-RAG: A modern architecture for hyper-personalizationZilliz
Mike Del Balso, CEO & Co-Founder at Tecton, presents "Full RAG," a novel approach to AI recommendation systems, aiming to push beyond the limitations of traditional models through a deep integration of contextual insights and real-time data, leveraging the Retrieval-Augmented Generation architecture. This talk will outline Full RAG's potential to significantly enhance personalization, address engineering challenges such as data management and model training, and introduce data enrichment with reranking as a key solution. Attendees will gain crucial insights into the importance of hyperpersonalization in AI, the capabilities of Full RAG for advanced personalization, and strategies for managing complex data integrations for deploying cutting-edge AI solutions.
Unlocking Productivity: Leveraging the Potential of Copilot in Microsoft 365, a presentation by Christoforos Vlachos, Senior Solutions Manager – Modern Workplace, Uni Systems
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUpanagenda
Webinar Recording: https://www.panagenda.com/webinars/hcl-notes-und-domino-lizenzkostenreduzierung-in-der-welt-von-dlau/
DLAU und die Lizenzen nach dem CCB- und CCX-Modell sind für viele in der HCL-Community seit letztem Jahr ein heißes Thema. Als Notes- oder Domino-Kunde haben Sie vielleicht mit unerwartet hohen Benutzerzahlen und Lizenzgebühren zu kämpfen. Sie fragen sich vielleicht, wie diese neue Art der Lizenzierung funktioniert und welchen Nutzen sie Ihnen bringt. Vor allem wollen Sie sicherlich Ihr Budget einhalten und Kosten sparen, wo immer möglich. Das verstehen wir und wir möchten Ihnen dabei helfen!
Wir erklären Ihnen, wie Sie häufige Konfigurationsprobleme lösen können, die dazu führen können, dass mehr Benutzer gezählt werden als nötig, und wie Sie überflüssige oder ungenutzte Konten identifizieren und entfernen können, um Geld zu sparen. Es gibt auch einige Ansätze, die zu unnötigen Ausgaben führen können, z. B. wenn ein Personendokument anstelle eines Mail-Ins für geteilte Mailboxen verwendet wird. Wir zeigen Ihnen solche Fälle und deren Lösungen. Und natürlich erklären wir Ihnen das neue Lizenzmodell.
Nehmen Sie an diesem Webinar teil, bei dem HCL-Ambassador Marc Thomas und Gastredner Franz Walder Ihnen diese neue Welt näherbringen. Es vermittelt Ihnen die Tools und das Know-how, um den Überblick zu bewahren. Sie werden in der Lage sein, Ihre Kosten durch eine optimierte Domino-Konfiguration zu reduzieren und auch in Zukunft gering zu halten.
Diese Themen werden behandelt
- Reduzierung der Lizenzkosten durch Auffinden und Beheben von Fehlkonfigurationen und überflüssigen Konten
- Wie funktionieren CCB- und CCX-Lizenzen wirklich?
- Verstehen des DLAU-Tools und wie man es am besten nutzt
- Tipps für häufige Problembereiche, wie z. B. Team-Postfächer, Funktions-/Testbenutzer usw.
- Praxisbeispiele und Best Practices zum sofortigen Umsetzen
GraphRAG for Life Science to increase LLM accuracyTomaz Bratanic
GraphRAG for life science domain, where you retriever information from biomedical knowledge graphs using LLMs to increase the accuracy and performance of generated answers
HCL Notes and Domino License Cost Reduction in the World of DLAUpanagenda
Webinar Recording: https://www.panagenda.com/webinars/hcl-notes-and-domino-license-cost-reduction-in-the-world-of-dlau/
The introduction of DLAU and the CCB & CCX licensing model caused quite a stir in the HCL community. As a Notes and Domino customer, you may have faced challenges with unexpected user counts and license costs. You probably have questions on how this new licensing approach works and how to benefit from it. Most importantly, you likely have budget constraints and want to save money where possible. Don’t worry, we can help with all of this!
We’ll show you how to fix common misconfigurations that cause higher-than-expected user counts, and how to identify accounts which you can deactivate to save money. There are also frequent patterns that can cause unnecessary cost, like using a person document instead of a mail-in for shared mailboxes. We’ll provide examples and solutions for those as well. And naturally we’ll explain the new licensing model.
Join HCL Ambassador Marc Thomas in this webinar with a special guest appearance from Franz Walder. It will give you the tools and know-how to stay on top of what is going on with Domino licensing. You will be able lower your cost through an optimized configuration and keep it low going forward.
These topics will be covered
- Reducing license cost by finding and fixing misconfigurations and superfluous accounts
- How do CCB and CCX licenses really work?
- Understanding the DLAU tool and how to best utilize it
- Tips for common problem areas, like team mailboxes, functional/test users, etc
- Practical examples and best practices to implement right away
In his public lecture, Christian Timmerer provides insights into the fascinating history of video streaming, starting from its humble beginnings before YouTube to the groundbreaking technologies that now dominate platforms like Netflix and ORF ON. Timmerer also presents provocative contributions of his own that have significantly influenced the industry. He concludes by looking at future challenges and invites the audience to join in a discussion.
UiPath Test Automation using UiPath Test Suite series, part 5DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 5. In this session, we will cover CI/CD with devops.
Topics covered:
CI/CD with in UiPath
End-to-end overview of CI/CD pipeline with Azure devops
Speaker:
Lyndsey Byblow, Test Suite Sales Engineer @ UiPath, Inc.
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...SOFTTECHHUB
The choice of an operating system plays a pivotal role in shaping our computing experience. For decades, Microsoft's Windows has dominated the market, offering a familiar and widely adopted platform for personal and professional use. However, as technological advancements continue to push the boundaries of innovation, alternative operating systems have emerged, challenging the status quo and offering users a fresh perspective on computing.
One such alternative that has garnered significant attention and acclaim is Nitrux Linux 3.5.0, a sleek, powerful, and user-friendly Linux distribution that promises to redefine the way we interact with our devices. With its focus on performance, security, and customization, Nitrux Linux presents a compelling case for those seeking to break free from the constraints of proprietary software and embrace the freedom and flexibility of open-source computing.
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024Neo4j
Neha Bajwa, Vice President of Product Marketing, Neo4j
Join us as we explore breakthrough innovations enabled by interconnected data and AI. Discover firsthand how organizations use relationships in data to uncover contextual insights and solve our most pressing challenges – from optimizing supply chains, detecting fraud, and improving customer experiences to accelerating drug discoveries.
Communications Mining Series - Zero to Hero - Session 1DianaGray10
This session provides introduction to UiPath Communication Mining, importance and platform overview. You will acquire a good understand of the phases in Communication Mining as we go over the platform with you. Topics covered:
• Communication Mining Overview
• Why is it important?
• How can it help today’s business and the benefits
• Phases in Communication Mining
• Demo on Platform overview
• Q/A
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slackshyamraj55
Discover the seamless integration of RPA (Robotic Process Automation), COMPOSER, and APM with AWS IDP enhanced with Slack notifications. Explore how these technologies converge to streamline workflows, optimize performance, and ensure secure access, all while leveraging the power of AWS IDP and real-time communication via Slack notifications.
Dr. Sean Tan, Head of Data Science, Changi Airport Group
Discover how Changi Airport Group (CAG) leverages graph technologies and generative AI to revolutionize their search capabilities. This session delves into the unique search needs of CAG’s diverse passengers and customers, showcasing how graph data structures enhance the accuracy and relevance of AI-generated search results, mitigating the risk of “hallucinations” and improving the overall customer journey.
Programming Foundation Models with DSPy - Meetup SlidesZilliz
Prompting language models is hard, while programming language models is easy. In this talk, I will discuss the state-of-the-art framework DSPy for programming foundation models with its powerful optimizers and runtime constraint system.
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceIndexBug
Imagine a world where machines not only perform tasks but also learn, adapt, and make decisions. This is the promise of Artificial Intelligence (AI), a technology that's not just enhancing our lives but revolutionizing entire industries.
Presentation of the OECD Artificial Intelligence Review of Germany
Refactor Large apps with Backbone
1. From Mess to Success,
Refactoring Large Applications with Backbone
dev.Objective()
May 14, 2015
Stacy London
@stacylondoner
McWay Falls, Julia Pfeiffer Burns State Park - Big Sur, CA - 2015 by Stacy London
2. About Me
I’ve been making things for the web since 1998.
Currently I’m a Senior Application Architect focused on
Front-End Engineering at Northwestern Mutual.
@stacylondoner
3. Northwestern Mutual
Northwestern Mutual has been helping families and businesses achieve
financial security for nearly 160 years. Our financial representatives build
relationships with clients through a distinctive planning approach that integrates
risk management with wealth accumulation, preservation and distribution. With
more than $230 billion in assets, $27 billion in revenues, nearly $90 billion in
assets under management and more than $1.5 trillion worth of life insurance
protection in force, Northwestern Mutual delivers financial security to more than
4.3 million people who rely on us for insurance and investment
solutions, including life, disability and long-term care insurance; annuities; trust
services; mutual funds; and investment advisory products and services.
Northwestern Mutual is the marketing name for The Northwestern Mutual Life Insurance Company, Milwaukee, WI, and its
subsidiaries. Northwestern Mutual and its subsidiaries offer a comprehensive approach to financial security solutions including: life
insurance, long-term care insurance, disability income insurance, annuities, investment products, and advisory products and
services. Subsidiaries include Northwestern Mutual Investment Services, LLC, broker-dealer, registered investment adviser,
member FINRA and SIPC; the Northwestern Mutual Wealth Management Company, limited purpose federal savings bank; and
Northwestern Long Term Care Insurance Company.
4. What do I mean by large application?
• a multi-page web application (MPA) built with ASP.NET
MVC
• 1500+ files | 343,000+ lines of code
• UI (CSS / JS)
• 230+ files | 42,000+ lines of code
5. Development Culture
• JEE/Java shop turned .NET/C#
• view JS as a bit of a “toy” language
• as JS was being added it was just being added without much
thought to maintainability, extensibility, testability, patterns,
etc.
• app was going to be heavy with JS yet initially on a platform
that wasn’t optimized for this kind of app dev.
• path of least resistance was to just put everything in
$(document).ready()
9. Problems
• one large JavaScript file in the <head> (all code included
on every page regardless if it needed it)
• all JavaScript global and in $(document).ready()
• some pages had inline JavaScript
• not commented
• no unit tests
• unclear if a function / event was used on multiple pages
10. Iterative Refactoring
• big codebase
• large team working on 2 week sprints that couldn’t be
slowed down
• refactors had to fit into a sprint
11.
12.
13. Refactor, Iteration 1: Break Apart JS
• figure out what JS belongs with each page and move
that JS into a separate file for that page
• include that JS with the partial HTML
14. Refactor, Iteration 1: Start Adding Unit Tests
• start adding unit tests for original code then make sure it
passed after refactoring as a safety/confidence
mechanism
• to prepare for this journey of breaking code into smaller,
more testable chunks it was good to start early with
creating a test bed
• help make subsequent refactors less stressful
15. Refactor, Iteration 1: Start Adding Unit Tests
• picked Jasmine (BDD style) - http://
jasmine.github.io/
• a lot of the JS tied to DOM manipulation so not in
an ideal state for unit testing with Jasmine out of
the box
• needed DOM testing helper so added jquery-
jasmine library to add fixtures (HTML snippets
to run tests against)
• no external UI Regression tools (e.g. Selenium) in a
state to do this validation throughout the refactor
16.
17.
18. Refactor, Iteration 2: Namespacing & Object Literal
• create an app namespace to get custom code out of the global
namespace (window) to avoid collisions with external libs/
frameworks
• introduce an Object Literal notation style in preparation for
Backbone (which uses this pattern)
• helps to organize the code and parameters logically
“an object containing a collection of key:value pairs with a colon
separating each pair of keys and values where keys can also
represent new namespaces”
• add closures with Instantly Invoked Function Expressions
(IIFEs)
20. ;
var myApp = myApp || {};
(function($, myApp) {
'use strict';
$.extend(myApp, {
init: function() {
this.commonStuff();
},
commonStuff: function() {
// common code across many or all pages
}
});
})(window.jQuery, window.myApp);
$(document).ready(function() {
myApp.init();
});
my-app.js
21. my-app.js
with comments
// prefix with semi-colon as safety net against concatenated
// scripts and/or other plugins that are not closed properly
;
// check for existence of myApp in the global namespace
var myApp = myApp || {};
// Use IIFE to:
// * encapsulate app logic to protect it from global namespace
// * pass in namespace so can be modified locally and isn't
// overwritten outside of our function context
// * ensure $ only refers to window.jQuery (defensive programming)
// * $ passed through as local var rather than as globals and this
// (slightly) quickens the resolution process and can be more
// efficiently minified (especially if regularly referenced)
(function($, myApp) {
22. my-app.js
with comments
(function($, myApp) {
// Strict mode makes several changes to normal JavaScript semantics:
// * eliminates some JS silent errors by changing them to throw errors.
// * fixes mistakes that make it difficult for JavaScript engines to
// perform optimizations: strict mode code can sometimes be made to
// run faster than identical code that's not strict mode. Add inside
// the IIFE so it's defined for just the functions defined within and
// doesn't flip concatenating/minified code to strict inadvertently
'use strict';
// extend the namespace with more functionality
$.extend(myApp, {
24. Better but not great
• code is aligned with the screen to which is pertains
• pages now have mid-page script includes which isn’t
good for performance / rendering
• still hand-wiring Ajax calls
• entire-page-JS is not very modular
• want to break screens down into smaller features and
keep events neatly associated
25. Backbone to the rescue
• wanted something that provided/enforced structure but in a
lightweight way
• it’s a MPA not a SPA so full-featured SPA frameworks didn’t make
sense (e.g. Angular, Ember)
• wanted to be able to use just a small feature of the library/
framework and add more full integration over time (refactor in
multiple iterations)
• for these reasons Backbone.js made sense - http://backbonejs.org/
26.
27. Refactor, Iteration 3: Page Level Backbone Views
• reducing boilerplate code
• views enforce organization of events
• views enforce an Object Literal notation pattern
• views helped developers think about encapsulating pieces of the
screen
• starting with just Views gave the team time to start planning for
refactoring back-end data provided by ASP.NET MVC Controllers
into more RESTful web services (Web API) which is necessary to
take full advantage of Backbone.js Models/Collections
28. Refactor, Iteration 3: Page Level Backbone Views
• my-app.js - is now responsible for instantiating the app
namespace and setting up a super light-weight view
manager for Backbone.js
• instantiate all available views on the page upon DOM
ready.
• page-one-view.js - no longer namespaced individually
since being added to the views object of the app
namespace
34. Refactor, Iteration 4: Sub-Page Backbone Views
• start breaking the large page views into sub-page views
so that you can get truly modular
• share modules/code if a module exists on more than
one page
35.
36.
37. Refactor, Iteration 5: Backbone Models, Collections
• move code that is getting data and doing any business
logic out of the Views and into Models and Collections
• e.g. move phone number formatting out of View and
into the Model
• remove hand written Ajax, use BB API (e.g. fetch)
• make sure server side controllers were written in a
RESTful way
• still not complete across the application
40. Use Backbone.js API
to get data
// initialize view
var pageOneView = new PageOneView({
collection: new PageOneCollection([]),
});
var PageOneView = Backbone.View.extend({
el: '#pageOneMainContainer',
template: _.template($('#page-one-template').html()),
initialize: function() {},
render: function() {
this.$el.html(this.template({'collection': this.collection}));
// maintain chainability
return this;
}
});
var PageOneCollection = Backbone.Collection.extend({
initialize: function(models, options) {},
model: PageOneModel,
// RESTful web service URL
url: '/SomeEndpoint'
});
41.
42. Refactor, Iteration 6: Mini-SPA
• treat each page of the multi-page app (MPA) like it’s a
miniature single page app (SPA)
• each page has a single entry point (main.js)
• this will setup the code for a module loader / build system
so that we can finally move the JS to the bottom of the
page and remove mid-page scripts
• improve performance (time to first paint - how long it
takes between a user entering a URL into the browser
and when he/she sees visual activity on screen)
43.
44.
45.
46. Refactor, Iteration 7: Modules
• current version of JavaScript (ECMA-262) doesn’t provide a
way to import modules of code like more traditional
programming languages do
• modules are proposed for the next version of JS (ES6/
ES2015/Harmony)
• to use modules and manage dependencies with the current
version of JS you can use community driven methodologies
• there are two popular styles with associated script
loaders / build systems
47.
48. Refactor, Iteration 7: Modules - AMD
• AMD - Asynchronous Module Definition
“The Asynchronous Module Definition (AMD) API
specifies a mechanism for defining modules such that the
module and its dependencies can be asynchronously
loaded. This is particularly well suited for the browser
environment where synchronous loading of modules
incurs performance, usability, debugging, and cross-
domain access problems.”
https://github.com/amdjs/amdjs-api/wiki/AMD
49. Refactor, Iteration 7: Modules - CommonJS
• CommonJS’s module format was made popular for
server-side JavaScript development (namely for Node.js/
NPM)
• it’s synchronous
• syntax is a bit easier as it frees you from the define()
wrapper that AMD enforces
• requires a build in a JS runtime
50. Refactor, Iteration 7: Modules - RequireJS
• popular script loader written by James Burke that helps you load
multiple script files and define modules with or without
dependencies
• use RequireJS as first pass at module loading since async nature
means no build step during dev time (least disruption to the dev
team which is important because there is a learning curve)
• use almond (AMD API shim) so don’t have to add a special script
tag to load RequireJS and change any HTML
• this will move the code away from IIFEs to modules with
dependency management
51. my-app.js
// requireJS simplified commonJS wrapper
// do this so can use the commonJS style &
// make switch to browserify easier
define('app', function(require, exports, module) {
'use strict';
var $ = require('jquery');
var _ = require('underscore');
var Backbone = require('backbone');
var Modernizr = require('modernizr');
var HeaderController = require('./header-controller');
var FooterController = require('./footer-controller');
var app = new Backbone.Application();
module.exports = app;
});
(function() {
var $ = require('jquery');
var app = require('app');
// dom ready
$(function() {
app.start();
});
}());
52. ;
(function() {
'use strict';
var $ = require('jquery');
var PageOneController = require('./page-one-controller');
var app = require('app');
// dom ready
$(function() {
app.start({
ScreenController: PageOneController
});
});
}());
page-one-main.js
53. define('page-one-controller', function(require, exports, module) {
'use strict';
var Backbone = require('backbone');
var PageOneView = require('PageOneView');
var PageOneController = Backbone.Controller.extend({
initialize: function(options) {
var pageOneView = new PageOneView();
}
});
module.exports = PageOneController;
});
page-one-controller.js
55. Refactor, Iteration 7: Modules - Browserify
• Browserify lets you require('modules') in the browser by
bundling up all of your dependencies during a build step
• it’s the end-state module loader because it allows for easy
bundle splitting
• figure out common/shared JS and create a common
bundle then a bundle for the unique code on each page
• by having a main.js for each screen this will act as an
entry point so Browserify can find all the modules
required and create a screen-specific bundle
56. Refactor, Iteration 7: Modules - Browserify
• means build during dev but we were already doing that
for our CSS with LESS
• “It’s great the dev community has
embraced compilation because it’s
inevitable.” - Brendan Eich at Fluent 2015
• the code will become very clean
58. Summary
• the JavaScript is now modular and easier to maintain
• Backbone.js helps devs keep consistent with coding patterns and
organization (Object Literal notation, events)
• events are scoped to the smallest part of the page to which they matter
(Backbone.js)
• namespacing/IIFEs and then later module loader/build removes the
possibility of collisions with other frameworks/libs
• unit tests mean you can feel more confident to change things
• only sending JS to the browser that is necessary is good for
performance (think mobile)
60. "The secret to building large apps is never
build large apps. Break your applications
into small pieces. Then, assemble those
testable, bite-sized pieces into your big
application"
- Justin Meyer, author JavaScriptMVC
61. Team Shout Out
• This was over the course of several years and I worked
with two other fantastic front-end engineers:
• Ryan Anklam ( @bittersweetryan )
• Zeek Chentnik ( http://ezekielchentnik.com )
62. JavaScript References
• “Patterns For Large-Scale JavaScript Application Architecture” by Addy
Osmani
http://addyosmani.com/largescalejavascript/
• “Learning JavaScript Design Patterns” by Addy Osmani
http://addyosmani.com/resources/essentialjsdesignpatterns/book/
• “Using Objects to Organize Your Code” by Rebecca Murphey
http://rmurphey.com/blog/2009/10/15/using-objects-to-organize-your-code/
• “It’s time to start using JavaScript strict mode” by Nicholas Zakas
http://www.nczonline.net/blog/2012/03/13/its-time-to-start-using-javascript-strict-
mode/
• “Writing Modular JavaScript with AMD, CommonJS & ES Harmony” by Addy
Osmani
http://addyosmani.com/writing-modular-js/
63. Backbone.js References
• “Developing Backbone.js Applications” by Addy
Osmani
http://addyosmani.github.io/backbone-fundamentals/
• “Communicating Between Views in Client-Side
Apps” by Rebecca Murphey
http://bocoup.com/weblog/communicating-between-
views-in-client-side-apps/
• Talks from past Backbone Conferences are free/online:
http://backboneconf.com/
http://backboneconf.com/2013/