This document provides an overview of key concepts for building single-page web applications. It discusses client-server relationships, routing, views and content rendering, global event handling, dependency management, initialization and execution, form handling. The document emphasizes defining RESTful APIs, rendering HTML on the server when possible, using a dependency library like RequireJS, and following conventions to manage initialization and execution of code.
Ajax [Asunchronous HTTP request ] - A Deep Introduction About Ajax Technology - Lets Take a Glance About Ajax ,Where it's use | Whats the purpose of Ajax in Web Application Developement . Bacis of Ajax Technology + Coding Tips ..
Ajax [Asunchronous HTTP request ] - A Deep Introduction About Ajax Technology - Lets Take a Glance About Ajax ,Where it's use | Whats the purpose of Ajax in Web Application Developement . Bacis of Ajax Technology + Coding Tips ..
Single Page Applications: Your Browser is the OS!Jeremy Likness
Single Page Applications have gained tremendous popularity over the past few years and have prompted the creation of several frameworks to support their development. Unlike traditional web applications, most of the heavy lifting for SPA happens on the client side in your web browser. These applications rely on hundreds of lines of JavaScript coupled with asynchronous web service calls to provide a desktop-like experience that is accessible from virtually any device.
Join Principal Architect, Jeremy Likness, to learn more about SPA, including how to determine when you should choose this approach, how SPA compares and contrasts with traditional server-based approaches including ASP.NET WebForms and MVC, and what frameworks and tools (such as jQuery, AngularJS, and Aurelia) make building SPA easier. Discover how single page applications powered by HTML5 and JavaScript transform your browser into a web-based operating system.
We will cover whole of the web development basics comprising of HTML, CSS, JavaScript in this series.
Following are topics useful for any newbie to intermediate who is interested in learning Web Development
SenchaCon 2016: Expect the Unexpected - Dealing with Errors in Web AppsSencha
Dealing with unexpected exceptions on the server side is something we've all done for ages. Now it's time to apply the same quality goals and monitoring to our JS codebase. This is especially important for Sencha applications where the front-end usually contains 100k+ lines of code. I'll demonstrate various powerful monitoring techniques and tricks that we are using ourselves at Bryntum.
ASP.NET Quick Wins - 20 Tips and Tricks To Shift Your Application into High GearKevin Griffin
Out of the box, ASP.NET can do a lot of amazing things. The tools and framework have grown to make mundane tasks, such as minification, simple to implement. Many times by using the framework as we were taught, opportunities to optimize pass us by. The reality is that underneath the covers, there is a whole world of easy tweaks we can implement to help ASP.NET perform at its peak.
In this presentation, we will walk through a slew of tweaks used to make ASP.NET perform in the best way possible. You will leave with a checklist of tasks that will instantly improve the performance of your web application!
KnockoutJS and MVVM (Comes with a sample application) - It's a beginner's guide that discusses about Knockout in particular and MVVM pattern in general. Knockout is a very cool piece of technology that makes your view code less cluttered. This ppt reaches every (not all :-) detail of Knockout. By following this ppt you'll surely be in position to get started with Knockout on your own projects. This ppt comes with an application which you can access from this url https://github.com/manvendrasinghkadam/koshopping. This application is built on Grails. More details on this application can be found on github repo.
Paul Ruescher's Slide deck from the first Ember.js Meetup - Vancouver. (#EmberYVR) May 14th 2014 at CodeCore Bootcamp.
Ember.js is a framework for creating ambitious web applications. What does an "ambitious web application" even mean? What if I’m not working on an ambitious web application? In this talk, Paul will put you through an Ember Bootcamp on your way to $$$.
This presentation was given at Magnolia Conference 2013 by Adam Galloway, Development Lead at NRG Edge: www.nrg-edge.com
I'll cover how we are using Magnolia 5 to content manage and optimize rich JavaScript applications.
Creating rich web applications with modern JavaScript frameworks adds a level of complexity to content management. We use Backbone.js to create powerful interactive web applications and Hogan.js to create dynamic reusable views within the application.
Typically templates used by Backbone.js are created with placeholders for data AND content. This requires the browser to retrieve a Hogan.js template, retrieve the content, retrieve the business data and then assemble the three pieces to be shown on the page.
We have implemented a novel solution that precompiles the content into the Hogan.js templates on the server-side within Magnolia. This removes the overhead of retrieving and assembling the content in the browser.
I'll show how we use the javax.script.ScriptEngine to run JavaScript on the server-side within Magnolia 5 to provide Node.js like server-side JavaScript optimization.
I'll also show how this can be extended to work with other JavaScript frameworks such as Handlebars and AngularJS.
Better End-to-End Testing with Page Objects Model using ProtractorKasun Kodagoda
This presentation focuses on implementing Page Objects Model using Protractor for AngularJS apps for more maintainable, reusable and flexible end-to-end testing for your project. The presentations was done at 99X Technology as a Tech Talk session done by Team Finale.
Rolling Your Own CSS Methodology
with Dave Shea
Presented at FITC Toronto 2015
More info at www.fitc.ca
OVERVIEW
When you work with a large project or team over time, you either develop an airtight system for writing CSS or you spend half your day deciphering mystery code while fighting specificity battles.
After a lengthy process of investigating systems like BEM, OOCSS, SMACSS and more, we decided to take pieces of each and create our own. This talk is not the announcement of a new system we want you to use, instead it’s a deep dive into the discussions and decision-making that happened as we developed one.
You’ll walk away with an understanding of how you might go about choosing a CSS methodology or developing one of your own, and get a first-hand look at the complexity management problems faced by today’s larger projects.
OBJECTIVE
A case study on creating and using CSS methodologies.
TARGET AUDIENCE
Front end developers, designers who code.
ASSUMED AUDIENCE KNOWLEDGE
Advanced CSS. Pre-processors like SASS, LESS or Stylus. A familiarity with an existing CSS methodology like BEM/SMACSS/OOCSS would be helpful.
FIVE THINGS AUDIENCE MEMBERS WILL LEARN
Why CSS is an increasingly complex problem.
When Bootstrap stops being a good choice.
How to manage CSS complexity.
Creating modular CSS systems.
Writing CSS that your whole team can understand.
Single Page Applications: Your Browser is the OS!Jeremy Likness
Single Page Applications have gained tremendous popularity over the past few years and have prompted the creation of several frameworks to support their development. Unlike traditional web applications, most of the heavy lifting for SPA happens on the client side in your web browser. These applications rely on hundreds of lines of JavaScript coupled with asynchronous web service calls to provide a desktop-like experience that is accessible from virtually any device.
Join Principal Architect, Jeremy Likness, to learn more about SPA, including how to determine when you should choose this approach, how SPA compares and contrasts with traditional server-based approaches including ASP.NET WebForms and MVC, and what frameworks and tools (such as jQuery, AngularJS, and Aurelia) make building SPA easier. Discover how single page applications powered by HTML5 and JavaScript transform your browser into a web-based operating system.
We will cover whole of the web development basics comprising of HTML, CSS, JavaScript in this series.
Following are topics useful for any newbie to intermediate who is interested in learning Web Development
SenchaCon 2016: Expect the Unexpected - Dealing with Errors in Web AppsSencha
Dealing with unexpected exceptions on the server side is something we've all done for ages. Now it's time to apply the same quality goals and monitoring to our JS codebase. This is especially important for Sencha applications where the front-end usually contains 100k+ lines of code. I'll demonstrate various powerful monitoring techniques and tricks that we are using ourselves at Bryntum.
ASP.NET Quick Wins - 20 Tips and Tricks To Shift Your Application into High GearKevin Griffin
Out of the box, ASP.NET can do a lot of amazing things. The tools and framework have grown to make mundane tasks, such as minification, simple to implement. Many times by using the framework as we were taught, opportunities to optimize pass us by. The reality is that underneath the covers, there is a whole world of easy tweaks we can implement to help ASP.NET perform at its peak.
In this presentation, we will walk through a slew of tweaks used to make ASP.NET perform in the best way possible. You will leave with a checklist of tasks that will instantly improve the performance of your web application!
KnockoutJS and MVVM (Comes with a sample application) - It's a beginner's guide that discusses about Knockout in particular and MVVM pattern in general. Knockout is a very cool piece of technology that makes your view code less cluttered. This ppt reaches every (not all :-) detail of Knockout. By following this ppt you'll surely be in position to get started with Knockout on your own projects. This ppt comes with an application which you can access from this url https://github.com/manvendrasinghkadam/koshopping. This application is built on Grails. More details on this application can be found on github repo.
Paul Ruescher's Slide deck from the first Ember.js Meetup - Vancouver. (#EmberYVR) May 14th 2014 at CodeCore Bootcamp.
Ember.js is a framework for creating ambitious web applications. What does an "ambitious web application" even mean? What if I’m not working on an ambitious web application? In this talk, Paul will put you through an Ember Bootcamp on your way to $$$.
This presentation was given at Magnolia Conference 2013 by Adam Galloway, Development Lead at NRG Edge: www.nrg-edge.com
I'll cover how we are using Magnolia 5 to content manage and optimize rich JavaScript applications.
Creating rich web applications with modern JavaScript frameworks adds a level of complexity to content management. We use Backbone.js to create powerful interactive web applications and Hogan.js to create dynamic reusable views within the application.
Typically templates used by Backbone.js are created with placeholders for data AND content. This requires the browser to retrieve a Hogan.js template, retrieve the content, retrieve the business data and then assemble the three pieces to be shown on the page.
We have implemented a novel solution that precompiles the content into the Hogan.js templates on the server-side within Magnolia. This removes the overhead of retrieving and assembling the content in the browser.
I'll show how we use the javax.script.ScriptEngine to run JavaScript on the server-side within Magnolia 5 to provide Node.js like server-side JavaScript optimization.
I'll also show how this can be extended to work with other JavaScript frameworks such as Handlebars and AngularJS.
Better End-to-End Testing with Page Objects Model using ProtractorKasun Kodagoda
This presentation focuses on implementing Page Objects Model using Protractor for AngularJS apps for more maintainable, reusable and flexible end-to-end testing for your project. The presentations was done at 99X Technology as a Tech Talk session done by Team Finale.
Rolling Your Own CSS Methodology
with Dave Shea
Presented at FITC Toronto 2015
More info at www.fitc.ca
OVERVIEW
When you work with a large project or team over time, you either develop an airtight system for writing CSS or you spend half your day deciphering mystery code while fighting specificity battles.
After a lengthy process of investigating systems like BEM, OOCSS, SMACSS and more, we decided to take pieces of each and create our own. This talk is not the announcement of a new system we want you to use, instead it’s a deep dive into the discussions and decision-making that happened as we developed one.
You’ll walk away with an understanding of how you might go about choosing a CSS methodology or developing one of your own, and get a first-hand look at the complexity management problems faced by today’s larger projects.
OBJECTIVE
A case study on creating and using CSS methodologies.
TARGET AUDIENCE
Front end developers, designers who code.
ASSUMED AUDIENCE KNOWLEDGE
Advanced CSS. Pre-processors like SASS, LESS or Stylus. A familiarity with an existing CSS methodology like BEM/SMACSS/OOCSS would be helpful.
FIVE THINGS AUDIENCE MEMBERS WILL LEARN
Why CSS is an increasingly complex problem.
When Bootstrap stops being a good choice.
How to manage CSS complexity.
Creating modular CSS systems.
Writing CSS that your whole team can understand.
We keep thinking we can write better CSS if we just try harder, that the next site will be clean and stay that way. This presentation shows that in fact, messy CSS is the direct result of our worst best-practices. We need to reexamine those assumptions with an eye to practicality and scalability as well as accessibility, standards, and fabulous design.
DRY CSS A don’t-repeat-yourself methodology for creating efficient, unified a...Jer Clarke
Slides for a talk at the ConFoo 2012 conference in Montreal. I explain a simple yet powerful CSS architecture that avoids duplication and increases design consistency by grouping shared properties together rather than redefining them over and over. In the process I explain preprocessors like LESS and SASS, as well as the OOCSS fad, pointing out how they are insufficiently standards-compliant.
How do you scale CSS for millions of visitors or thousands of pages? The slides from Nicole's presentation at Web Directions North in Denver will show you how to use Object Oriented CSS to write fast, maintainable, standards-based front end code. Adds much needed predictability to CSS so that even beginners can participate in writing beautiful, standards-compliant, fast websites.
Intro to mobile web application developmentzonathen
Learn all the basics of web app development including bootstrap, handlebars templates, jquery and angularjs, as well as using hybrid app deployment on a phone.
This session will provide attendees with hands-on experience and in-depth knowledge of using Node.js as a runtime environment and Express.js as a web framework to build scalable and fast backend systems. Additionally, attendees will learn about Passport.js, a popular authentication middleware for Node.js, and how to use Prisma ORM to handle database operations in a type-safe and efficient manner.
The session will be conducted by experienced developers who have worked with these technologies and will be able to provide valuable insights and best practices. The session will be interactive and include plenty of opportunities for attendees to ask questions and work on real-world projects.
In this talk we will explore how to organize component-centric code splitting with server side rendering and universal data fetching in React, when your application becomes large enough.
Talk description: When you have a large enough application, a single large bundle with all of your code becomes a problem for startup time. You need to start breaking your app into separate bundles and load them dynamically when needed.
How to split a single bundle into multiple is a well-solved problem with tools like Browserify and Webpack.
But now you need to find places in your application where you can decide to split off into another bundle and load it asynchronously. You also need a way to communicate between server and client, and organize server side rendering and implement universal data fetching for your application.
Even React Router team failed with this task
“We’ve tried and failed a couple of times”(https://reacttraining.com/react-router/web/guides/code-splitting/code-splitting-server-rendering)
I will show you how to solve this problem, we will use a great library called React Loadable.
Also, we will look at some solutions which you can achieve with React Router v4 and why they are not the best one.
For this talk, you will need some knowledge in React, Babel (ES6), Node, Webpack 2, Redux, and little bit React Router v4.
Introduction to Angular JS by SolTech's Technical Architect, Carlos Muentes.
To learn more about SolTech's custom software and recruiting solution services, visit http://www.soltech.net.
Most of the major internet companies have now declared themselves to be mobile first. Smartphones have become ubiquitous throughout the development world. But mobile development is fraught with challenges. There are more Android devices than iOS, but iOS users tend to spend more money. If you build your app for one, it is a complete re-write for the other. You may have heard of Cordova/PhoneGap, but the apps tend to be somewhat clunky looking.
Enter the Ionic Framework, a cross platform framework which combines PhoneGap with AngularJS and super fast CSS3 to make apps which perform at near native levels.
In this presentation, we'll explore React’s “Component” based world. We'll go through Virtual DOM, how it works, and React's Virtual DOM vs. the real DOM.
Neuro-symbolic is not enough, we need neuro-*semantic*Frank van Harmelen
Neuro-symbolic (NeSy) AI is on the rise. However, simply machine learning on just any symbolic structure is not sufficient to really harvest the gains of NeSy. These will only be gained when the symbolic structures have an actual semantics. I give an operational definition of semantics as “predictable inference”.
All of this illustrated with link prediction over knowledge graphs, but the argument is general.
JMeter webinar - integration with InfluxDB and GrafanaRTTS
Watch this recorded webinar about real-time monitoring of application performance. See how to integrate Apache JMeter, the open-source leader in performance testing, with InfluxDB, the open-source time-series database, and Grafana, the open-source analytics and visualization application.
In this webinar, we will review the benefits of leveraging InfluxDB and Grafana when executing load tests and demonstrate how these tools are used to visualize performance metrics.
Length: 30 minutes
Session Overview
-------------------------------------------
During this webinar, we will cover the following topics while demonstrating the integrations of JMeter, InfluxDB and Grafana:
- What out-of-the-box solutions are available for real-time monitoring JMeter tests?
- What are the benefits of integrating InfluxDB and Grafana into the load testing stack?
- Which features are provided by Grafana?
- Demonstration of InfluxDB and Grafana using a practice web application
To view the webinar recording, go to:
https://www.rttsweb.com/jmeter-integration-webinar
State of ICS and IoT Cyber Threat Landscape Report 2024 previewPrayukth K V
The IoT and OT threat landscape report has been prepared by the Threat Research Team at Sectrio using data from Sectrio, cyber threat intelligence farming facilities spread across over 85 cities around the world. In addition, Sectrio also runs AI-based advanced threat and payload engagement facilities that serve as sinks to attract and engage sophisticated threat actors, and newer malware including new variants and latent threats that are at an earlier stage of development.
The latest edition of the OT/ICS and IoT security Threat Landscape Report 2024 also covers:
State of global ICS asset and network exposure
Sectoral targets and attacks as well as the cost of ransom
Global APT activity, AI usage, actor and tactic profiles, and implications
Rise in volumes of AI-powered cyberattacks
Major cyber events in 2024
Malware and malicious payload trends
Cyberattack types and targets
Vulnerability exploit attempts on CVEs
Attacks on counties – USA
Expansion of bot farms – how, where, and why
In-depth analysis of the cyber threat landscape across North America, South America, Europe, APAC, and the Middle East
Why are attacks on smart factories rising?
Cyber risk predictions
Axis of attacks – Europe
Systemic attacks in the Middle East
Download the full report from here:
https://sectrio.com/resources/ot-threat-landscape-reports/sectrio-releases-ot-ics-and-iot-security-threat-landscape-report-2024/
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...DanBrown980551
Do you want to learn how to model and simulate an electrical network from scratch in under an hour?
Then welcome to this PowSyBl workshop, hosted by Rte, the French Transmission System Operator (TSO)!
During the webinar, you will discover the PowSyBl ecosystem as well as handle and study an electrical network through an interactive Python notebook.
PowSyBl is an open source project hosted by LF Energy, which offers a comprehensive set of features for electrical grid modelling and simulation. Among other advanced features, PowSyBl provides:
- A fully editable and extendable library for grid component modelling;
- Visualization tools to display your network;
- Grid simulation tools, such as power flows, security analyses (with or without remedial actions) and sensitivity analyses;
The framework is mostly written in Java, with a Python binding so that Python developers can access PowSyBl functionalities as well.
What you will learn during the webinar:
- For beginners: discover PowSyBl's functionalities through a quick general presentation and the notebook, without needing any expert coding skills;
- For advanced developers: master the skills to efficiently apply PowSyBl functionalities to your real-world scenarios.
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Tobias Schneck
As AI technology is pushing into IT I was wondering myself, as an “infrastructure container kubernetes guy”, how get this fancy AI technology get managed from an infrastructure operational view? Is it possible to apply our lovely cloud native principals as well? What benefit’s both technologies could bring to each other?
Let me take this questions and provide you a short journey through existing deployment models and use cases for AI software. On practical examples, we discuss what cloud/on-premise strategy we may need for applying it to our own infrastructure to get it to work from an enterprise perspective. I want to give an overview about infrastructure requirements and technologies, what could be beneficial or limiting your AI use cases in an enterprise environment. An interactive Demo will give you some insides, what approaches I got already working for real.
Elevating Tactical DDD Patterns Through Object CalisthenicsDorra BARTAGUIZ
After immersing yourself in the blue book and its red counterpart, attending DDD-focused conferences, and applying tactical patterns, you're left with a crucial question: How do I ensure my design is effective? Tactical patterns within Domain-Driven Design (DDD) serve as guiding principles for creating clear and manageable domain models. However, achieving success with these patterns requires additional guidance. Interestingly, we've observed that a set of constraints initially designed for training purposes remarkably aligns with effective pattern implementation, offering a more ‘mechanical’ approach. Let's explore together how Object Calisthenics can elevate the design of your tactical DDD patterns, offering concrete help for those venturing into DDD for the first time!
The Art of the Pitch: WordPress Relationships and SalesLaura Byrne
Clients don’t know what they don’t know. What web solutions are right for them? How does WordPress come into the picture? How do you make sure you understand scope and timeline? What do you do if sometime changes?
All these questions and more will be explored as we talk about matching clients’ needs with what your agency offers without pulling teeth or pulling your hair out. Practical tips, and strategies for successful relationship building that leads to closing the deal.
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf91mobiles
91mobiles recently conducted a Smart TV Buyer Insights Survey in which we asked over 3,000 respondents about the TV they own, aspects they look at on a new TV, and their TV buying preferences.
Connector Corner: Automate dynamic content and events by pushing a buttonDianaGray10
Here is something new! In our next Connector Corner webinar, we will demonstrate how you can use a single workflow to:
Create a campaign using Mailchimp with merge tags/fields
Send an interactive Slack channel message (using buttons)
Have the message received by managers and peers along with a test email for review
But there’s more:
In a second workflow supporting the same use case, you’ll see:
Your campaign sent to target colleagues for approval
If the “Approve” button is clicked, a Jira/Zendesk ticket is created for the marketing design team
But—if the “Reject” button is pushed, colleagues will be alerted via Slack message
Join us to learn more about this new, human-in-the-loop capability, brought to you by Integration Service connectors.
And...
Speakers:
Akshay Agnihotri, Product Manager
Charlie Greenberg, Host
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...UiPathCommunity
💥 Speed, accuracy, and scaling – discover the superpowers of GenAI in action with UiPath Document Understanding and Communications Mining™:
See how to accelerate model training and optimize model performance with active learning
Learn about the latest enhancements to out-of-the-box document processing – with little to no training required
Get an exclusive demo of the new family of UiPath LLMs – GenAI models specialized for processing different types of documents and messages
This is a hands-on session specifically designed for automation developers and AI enthusiasts seeking to enhance their knowledge in leveraging the latest intelligent document processing capabilities offered by UiPath.
Speakers:
👨🏫 Andras Palfi, Senior Product Manager, UiPath
👩🏫 Lenka Dulovicova, Product Program Manager, UiPath
2. Quick intro
Front-end architect and developer
Been building websites since 2004
3 years as Metacafe’s leading front-end developer
MooTools, Rails, Ruby, Mac, Linux enthusiast
Front-end is my main game. I also know the back-end quite
well
4. We’re going to cover
Basic concepts
Client-server relationship
Routing
Views and content rendering
Global event handling
5. We’re going to cover
Dependency management
Code initialization and execution
Form handling
Final thoughts
6. Basic concepts
One view, many partials
Rely on async requests for fetching and sending data
No page refresh - Update content in place
Desktop application user-interaction model
RESTful client-server communication
7. Problems and challenges
When are various components included and initialized?
How do we define generic interaction for separate
components?
How do we send, receive and render data asynchronously?
How do we avoid re-initialization of existing components?
What happens when things break?
8. A word of caution
Single-page applications should work without Javascript.
If you only rely on Javascript without gracefully degrading to
non-javascript functionality you’re doing it wrong!
This is true most of the times...
10. Client-server relationships
Most single-page apps require a server to handle data and
business logic (CouchApps excluded)
We start planning and building the server-side
We define routes, controllers, actions and views as we
would for ordinary web apps
11. Why??
No server = no application
We need solid conventions for both sides of the application
The client is a consumer, not a service provider
13. REST
Your client and server should agree how to communicate
REST helps you define which resource represents which
action or state
Your URLs should be defined on the server and
implemented by the client
Do not reinvent the wheel (URL generators)
14. REST and HTTP
Remember HTTP verbs and conventions
GET is used to read data
POST / PUT are used to write / update data
DELETE is used to remove data
16. Rendering HTML
View / partial paradigm
Full view is rendered in normal request
Partial view is rendered in XHR
DRY - write your HTML only once
17. Rendering HTML
Server side should generate HTML whenever possible
Why should the client generate HTML?
We need to manage HTML generation in one place
Localization is easier on the server-side
Server-side performance is absolute and known
19. Rendering HTML
You need to ask yourself why should you use JSON instead
of HTML to generate views.
You need generic support on both server and client
You need to justify the overhead of HTML generation
20. Rendering HTML
Seriously - If you can handle HTML on the server, do it.
Keep is simple and don’t repeat yourself!
21. But I love JSON
Seriously, just look at the guy!
22. Data passing with JSON
We’d use JSON to pass data to the client when
We’re not rendering HTML (e.g. forms, APIs)
There’s no other option
Bandwidth is expensive
Business logic is in the browser
24. Global Events
We have bits of HTML loaded asynchronously
We already initialized event handles on replaced HTML
We want to avoid re-binding event handles with each DOM
update
25. Global Events
function globalClickHandler(e){
var tgt = $(e.target);
do {
tag = tgt.get('tag');
if (tag === 'a') { /** do something with link **/}
tgt = tgt.getParent();
} while (tag !== 'body');
}
document.addEvent(‘click’,globalClickHandler);
26. Global Events
We can use the same principle to any other event we want
to handle globally
We can handle form submission for example
Keyboard events
Form widgets events
27. Global Events
Issues to remember:
We have some redundant DOM traversal
We should strive to unbind events on unload
Too much is no good (don’t over do it)
30. Dependency Management
Brute and Hungry
We load everything when page loads
We need to ensure things are packed nicely
Jammit or Sprockets
Large file limitations (caching, parsing, network)
Change in one file forces full cache purge
31. Dependency Management
Requires
Use a JS dependency library (require.js, head.js)
script-ready support
load only when needed
requires a bit more logic to ensure things run after
requires
32. Dependency Management
Script tags
Fetch JS script tags with HTML
Add to DOM once
Binds view and JS (good or bad?)
Readiness and requiring management needed
33. Dependency Management
Brute and Hungry - Small JS apps / non-mobile apps
Requires / Script tags - Larger / more complex apps
Requires are probably the best solution out there
Flexible
Functional and Intuitive
Penalties are “less” severe
35. Initialization and execution
Our code needs to run at certain points or respond to
certain user interactions.
How do we know when to initialize and execute the relevant
bits of code?
36. Initialization and execution
We initialize our application’s entry point module on DOM
ready
If we’re using requires, we can initialize required modules
when they’re required
37. Initialization and execution
We have a global handler for async requests
We can execute response callbacks based on request
URL
We can return a bit of Javascript with each response that
will be executed when the content is rendered
38. Initialization and execution
Finally, we can use an Initializer pattern to call various
modules based on some convention:
We need module construction and destruction
We know what action was performed on the server (e.g.
controller name and action name)
40. Initialization and execution
Initializer.Constructors = {};
Initializer.Destructors = {};
/** Somewhere in a module **/
Initializer.Constructors.Gallery = function(){....}
Initializer.Destructors.Gallery = function(){....}
41. Initialization and execution
/** Our global request handler **/
var Request = {
get:function(url){
var xhr = new Request({
url:url,
onSuccess:function(response){
// render response here
Initializer.init(url.split(‘/’)[1]);
}
});
xhr.get();
}
}
42. Handling forms
Handle GET and POST requests separately
Form validation is the server’s job!!!
The client should assist the user to fill correct values
Use server-side validation errors in the client
Rely on HTTP error statuses to handle success / failure
43. Handling forms
You can have a global form handler, similar to your global
request handler
Async responses should be:
JSON when we check success / failure
HTML when we render something after submission
Define a coherent API to pass data from server to client on
form submission
44. Final thoughts
We didn’t talk about
Performance, MVC, Couch Apps, templates
Do what’s right based on your requirements
Learn a goddamn server-side framework
45. Final thoughts
Design for simplicity
Don’t repeat yourself and don’t reinvent the wheel
Start small and grow larger (modules anyone?)
Define developer-friendly conventions and follow them