SlideShare a Scribd company logo
1 of 21
Download to read offline
jQuery Migration
   Migrating a site to jQuery




   Chris Pederick
   Yelp Learning Group 2011




This presentation is distributed under the terms of the Creative Commons Attribution-Noncommercial-Share Alike 3.0 License
Who?




Eastern Screetch Owl by t.davis photogrpahy
This presentation is distributed under the terms of the Creative Commons Attribution-Noncommercial-Share Alike 3.0 License
Who?


       • Lead front-end engineer at Bleacher Report
       • 4th largest sports media site
       • Nearly 20 million uniques and 500 million
               page views a month



This presentation is distributed under the terms of the Creative Commons Attribution-Noncommercial-Share Alike 3.0 License
What?




 Cold Aluminum Board by Yasuhiro
 This presentation is distributed under the terms of the Creative Commons Attribution-Noncommercial-Share Alike 3.0 License
What?


       • Ruby on Rails
       • JavaScript written on top of Prototype
       • Migrate to jQuery



This presentation is distributed under the terms of the Creative Commons Attribution-Noncommercial-Share Alike 3.0 License
Why?




White Boxer Puppy by Nic Adler
This presentation is distributed under the terms of the Creative Commons Attribution-Noncommercial-Share Alike 3.0 License
Why?


       •       Experience
       •       Popularity
       •       Simplicity
       •       Performance



This presentation is distributed under the terms of the Creative Commons Attribution-Noncommercial-Share Alike 3.0 License
How?




How cute can you possibly get? by Ville Miettinen
This presentation is distributed under the terms of the Creative Commons Attribution-Noncommercial-Share Alike 3.0 License
Asset packager
       • Merges and compresses JavaScript into fewer
               files
       • Create new packages for the migration
       • Prefix new packages and directories
                 common:                                                         redesign_common:
                   - prototype                                                     - redesign/jquery
                   - lowpro                                                        - redesign/modernizr
                   - effects                                                       - redesign/namespace
                   - dragdrop                                                      - redesign/common
                   - controls                                                      - redesign/tooltips
                   ...                                                             ...
This presentation is distributed under the terms of the Creative Commons Attribution-Noncommercial-Share Alike 3.0 License
Layouts


       • Combined with the view to create a response
       • Create new layouts that use the new asset
               packages

                default.html.erb → redesign_default.html.erb




This presentation is distributed under the terms of the Creative Commons Attribution-Noncommercial-Share Alike 3.0 License
Page by page
       • Migrate pages by priority
                    •       Importance
                    •       Simplicity
                    •       Common functionality/code

       • Switch pages to new layouts and asset
               packages
       • Rewrite page specific code to use jQuery and
               create new asset packages for these

This presentation is distributed under the terms of the Creative Commons Attribution-Noncommercial-Share Alike 3.0 License
Clean up

       • Delete unused packages in the asset
               packager
       • Delete JavaScript files from the deleted asset
               packages
       • Delete old layouts
       • Rename all prefixed asset packages,
               directories and layouts to defaults

This presentation is distributed under the terms of the Creative Commons Attribution-Noncommercial-Share Alike 3.0 License
Plugins

       • Use existing plugins or write your own?
                    •       Problem already solved
                    •       Support
                    •       Complexity/performance

       • Wrap existing plugins with your own interface
                    •       Can switch plugins or replace with your own code without
                            changing every usage




This presentation is distributed under the terms of the Creative Commons Attribution-Noncommercial-Share Alike 3.0 License
Plugins

       • Choose a standard plugin for each solution
               that should be used by everyone
       • We are using three templating plugins
                    •       Tmpl
                    •       Tmpl2
                    •       Mustache




This presentation is distributed under the terms of the Creative Commons Attribution-Noncommercial-Share Alike 3.0 License
Design patterns
       (function() {
         BR.Feature                = {};
         BR.Feature.publicFunction = privateFunction;

            var variable = true;

            $(function() {
              // Run on page load
              initialize();
            });

            function initialize() {
              // Set up the feature
            }

         function privateFunction() {
           // Can be called by other code
         }
       })();


This presentation is distributed under the terms of the Creative Commons Attribution-Noncommercial-Share Alike 3.0 License
Design patterns



       • jQuery plugin patterns
               wintoni.us/post/123029056/jquery-plugin-patterns




This presentation is distributed under the terms of the Creative Commons Attribution-Noncommercial-Share Alike 3.0 License
Tools
       • Web Developer ☺
               chrispederick.com/work/web-developer/

       • Firebug
               getfirebug.com

       • Page Speed/YSlow
               code.google.com/speed/page-speed/
               developer.yahoo.com/yslow/

       • WebPagetest
               www.webpagetest.org


This presentation is distributed under the terms of the Creative Commons Attribution-Noncommercial-Share Alike 3.0 License
WebPagetest


• Waterfall view
• Optimization checklist
• Content breakdown



This presentation is distributed under the terms of the Creative Commons Attribution-Noncommercial-Share Alike 3.0 License
jQuery upgrades


       • QA (even point releases)
       • Identify “fragile” features/pages
       • Unit tests



This presentation is distributed under the terms of the Creative Commons Attribution-Noncommercial-Share Alike 3.0 License
Selector tests

       • Simple HTML page to test problematic
               selectors




        #link-to + ul .token-input-token:first p
        #tags-1 + ul .token-input-token:eq(1) p



This presentation is distributed under the terms of the Creative Commons Attribution-Noncommercial-Share Alike 3.0 License
Questions?




Lemuren by baerchen57
This presentation is distributed under the terms of the Creative Commons Attribution-Noncommercial-Share Alike 3.0 License

More Related Content

Viewers also liked (9)

Differences Over Slavery
Differences Over SlaveryDifferences Over Slavery
Differences Over Slavery
 
Call To Arms
Call To ArmsCall To Arms
Call To Arms
 
The Cell & Inheritance
The Cell & InheritanceThe Cell & Inheritance
The Cell & Inheritance
 
Taxes
TaxesTaxes
Taxes
 
Conquests Shaam
Conquests ShaamConquests Shaam
Conquests Shaam
 
Reforming Spirit
Reforming SpiritReforming Spirit
Reforming Spirit
 
Control Weight app
Control Weight appControl Weight app
Control Weight app
 
Mr. Schumaier
Mr. SchumaierMr. Schumaier
Mr. Schumaier
 
Cyworld AppStore Weekly Report 2011-05-31
Cyworld AppStore Weekly Report 2011-05-31Cyworld AppStore Weekly Report 2011-05-31
Cyworld AppStore Weekly Report 2011-05-31
 

Similar to jQuery Migration

WebObjects Developer Tools
WebObjects Developer ToolsWebObjects Developer Tools
WebObjects Developer Tools
WO Community
 
Own it: working with a changing open source community
Own it: working with a changing open source communityOwn it: working with a changing open source community
Own it: working with a changing open source community
Selena Deckelmann
 
ARTDM 171, Week 14: Multimedia on the Web
ARTDM 171, Week 14: Multimedia on the WebARTDM 171, Week 14: Multimedia on the Web
ARTDM 171, Week 14: Multimedia on the Web
Gilbert Guerrero
 
gDayX 2013 - Advanced AngularJS - Nicolas Embleton
gDayX 2013 - Advanced AngularJS - Nicolas EmbletongDayX 2013 - Advanced AngularJS - Nicolas Embleton
gDayX 2013 - Advanced AngularJS - Nicolas Embleton
George Nguyen
 
Dd13.2013.milano.open ntf
Dd13.2013.milano.open ntfDd13.2013.milano.open ntf
Dd13.2013.milano.open ntf
Ulrich Krause
 

Similar to jQuery Migration (20)

Running Java Applications on Cloud Foundry
Running Java Applications on Cloud FoundryRunning Java Applications on Cloud Foundry
Running Java Applications on Cloud Foundry
 
Reactive summit 2020 microsoft orleans the easy way
Reactive summit 2020   microsoft orleans the easy wayReactive summit 2020   microsoft orleans the easy way
Reactive summit 2020 microsoft orleans the easy way
 
Getting started with Vue.js - CodeMash 2020
Getting started with Vue.js - CodeMash 2020Getting started with Vue.js - CodeMash 2020
Getting started with Vue.js - CodeMash 2020
 
Build your next single page app in ClojureScript and re-frame
Build your next single page app in ClojureScript and re-frameBuild your next single page app in ClojureScript and re-frame
Build your next single page app in ClojureScript and re-frame
 
WebObjects Developer Tools
WebObjects Developer ToolsWebObjects Developer Tools
WebObjects Developer Tools
 
Own it: working with a changing open source community
Own it: working with a changing open source communityOwn it: working with a changing open source community
Own it: working with a changing open source community
 
Migrating to Angular 5 for Spring Developers
Migrating to Angular 5 for Spring DevelopersMigrating to Angular 5 for Spring Developers
Migrating to Angular 5 for Spring Developers
 
The Heron Mapping Client - Overview, Functions, Concepts
The Heron Mapping Client - Overview, Functions, Concepts The Heron Mapping Client - Overview, Functions, Concepts
The Heron Mapping Client - Overview, Functions, Concepts
 
Flexible Permissions Management with ACL Templates
Flexible Permissions Management with ACL TemplatesFlexible Permissions Management with ACL Templates
Flexible Permissions Management with ACL Templates
 
Tech Talk Live on Share Extensibility
Tech Talk Live on Share ExtensibilityTech Talk Live on Share Extensibility
Tech Talk Live on Share Extensibility
 
Migrating to Angular 4 for Spring Developers
Migrating to Angular 4 for Spring Developers Migrating to Angular 4 for Spring Developers
Migrating to Angular 4 for Spring Developers
 
Building Mobile Web Apps with jQM and Cordova on Azure
Building Mobile Web Apps with jQM and Cordova on AzureBuilding Mobile Web Apps with jQM and Cordova on Azure
Building Mobile Web Apps with jQM and Cordova on Azure
 
Cypress report
Cypress reportCypress report
Cypress report
 
Writing an extensible web testing framework ready for the cloud slide share
Writing an extensible web testing framework ready for the cloud   slide shareWriting an extensible web testing framework ready for the cloud   slide share
Writing an extensible web testing framework ready for the cloud slide share
 
Band of brothers, building scalable social web apps on windows azure with asp...
Band of brothers, building scalable social web apps on windows azure with asp...Band of brothers, building scalable social web apps on windows azure with asp...
Band of brothers, building scalable social web apps on windows azure with asp...
 
Web development basics (Part-2)
Web development basics (Part-2)Web development basics (Part-2)
Web development basics (Part-2)
 
Surviving a Plane Crash, a NU.nl case-study
Surviving a Plane Crash, a NU.nl case-studySurviving a Plane Crash, a NU.nl case-study
Surviving a Plane Crash, a NU.nl case-study
 
ARTDM 171, Week 14: Multimedia on the Web
ARTDM 171, Week 14: Multimedia on the WebARTDM 171, Week 14: Multimedia on the Web
ARTDM 171, Week 14: Multimedia on the Web
 
gDayX 2013 - Advanced AngularJS - Nicolas Embleton
gDayX 2013 - Advanced AngularJS - Nicolas EmbletongDayX 2013 - Advanced AngularJS - Nicolas Embleton
gDayX 2013 - Advanced AngularJS - Nicolas Embleton
 
Dd13.2013.milano.open ntf
Dd13.2013.milano.open ntfDd13.2013.milano.open ntf
Dd13.2013.milano.open ntf
 

Recently uploaded

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Recently uploaded (20)

GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 

jQuery Migration

  • 1. jQuery Migration Migrating a site to jQuery Chris Pederick Yelp Learning Group 2011 This presentation is distributed under the terms of the Creative Commons Attribution-Noncommercial-Share Alike 3.0 License
  • 2. Who? Eastern Screetch Owl by t.davis photogrpahy This presentation is distributed under the terms of the Creative Commons Attribution-Noncommercial-Share Alike 3.0 License
  • 3. Who? • Lead front-end engineer at Bleacher Report • 4th largest sports media site • Nearly 20 million uniques and 500 million page views a month This presentation is distributed under the terms of the Creative Commons Attribution-Noncommercial-Share Alike 3.0 License
  • 4. What? Cold Aluminum Board by Yasuhiro This presentation is distributed under the terms of the Creative Commons Attribution-Noncommercial-Share Alike 3.0 License
  • 5. What? • Ruby on Rails • JavaScript written on top of Prototype • Migrate to jQuery This presentation is distributed under the terms of the Creative Commons Attribution-Noncommercial-Share Alike 3.0 License
  • 6. Why? White Boxer Puppy by Nic Adler This presentation is distributed under the terms of the Creative Commons Attribution-Noncommercial-Share Alike 3.0 License
  • 7. Why? • Experience • Popularity • Simplicity • Performance This presentation is distributed under the terms of the Creative Commons Attribution-Noncommercial-Share Alike 3.0 License
  • 8. How? How cute can you possibly get? by Ville Miettinen This presentation is distributed under the terms of the Creative Commons Attribution-Noncommercial-Share Alike 3.0 License
  • 9. Asset packager • Merges and compresses JavaScript into fewer files • Create new packages for the migration • Prefix new packages and directories common: redesign_common: - prototype - redesign/jquery - lowpro - redesign/modernizr - effects - redesign/namespace - dragdrop - redesign/common - controls - redesign/tooltips ... ... This presentation is distributed under the terms of the Creative Commons Attribution-Noncommercial-Share Alike 3.0 License
  • 10. Layouts • Combined with the view to create a response • Create new layouts that use the new asset packages default.html.erb → redesign_default.html.erb This presentation is distributed under the terms of the Creative Commons Attribution-Noncommercial-Share Alike 3.0 License
  • 11. Page by page • Migrate pages by priority • Importance • Simplicity • Common functionality/code • Switch pages to new layouts and asset packages • Rewrite page specific code to use jQuery and create new asset packages for these This presentation is distributed under the terms of the Creative Commons Attribution-Noncommercial-Share Alike 3.0 License
  • 12. Clean up • Delete unused packages in the asset packager • Delete JavaScript files from the deleted asset packages • Delete old layouts • Rename all prefixed asset packages, directories and layouts to defaults This presentation is distributed under the terms of the Creative Commons Attribution-Noncommercial-Share Alike 3.0 License
  • 13. Plugins • Use existing plugins or write your own? • Problem already solved • Support • Complexity/performance • Wrap existing plugins with your own interface • Can switch plugins or replace with your own code without changing every usage This presentation is distributed under the terms of the Creative Commons Attribution-Noncommercial-Share Alike 3.0 License
  • 14. Plugins • Choose a standard plugin for each solution that should be used by everyone • We are using three templating plugins • Tmpl • Tmpl2 • Mustache This presentation is distributed under the terms of the Creative Commons Attribution-Noncommercial-Share Alike 3.0 License
  • 15. Design patterns (function() { BR.Feature = {}; BR.Feature.publicFunction = privateFunction; var variable = true; $(function() { // Run on page load initialize(); }); function initialize() { // Set up the feature } function privateFunction() { // Can be called by other code } })(); This presentation is distributed under the terms of the Creative Commons Attribution-Noncommercial-Share Alike 3.0 License
  • 16. Design patterns • jQuery plugin patterns wintoni.us/post/123029056/jquery-plugin-patterns This presentation is distributed under the terms of the Creative Commons Attribution-Noncommercial-Share Alike 3.0 License
  • 17. Tools • Web Developer ☺ chrispederick.com/work/web-developer/ • Firebug getfirebug.com • Page Speed/YSlow code.google.com/speed/page-speed/ developer.yahoo.com/yslow/ • WebPagetest www.webpagetest.org This presentation is distributed under the terms of the Creative Commons Attribution-Noncommercial-Share Alike 3.0 License
  • 18. WebPagetest • Waterfall view • Optimization checklist • Content breakdown This presentation is distributed under the terms of the Creative Commons Attribution-Noncommercial-Share Alike 3.0 License
  • 19. jQuery upgrades • QA (even point releases) • Identify “fragile” features/pages • Unit tests This presentation is distributed under the terms of the Creative Commons Attribution-Noncommercial-Share Alike 3.0 License
  • 20. Selector tests • Simple HTML page to test problematic selectors #link-to + ul .token-input-token:first p #tags-1 + ul .token-input-token:eq(1) p This presentation is distributed under the terms of the Creative Commons Attribution-Noncommercial-Share Alike 3.0 License
  • 21. Questions? Lemuren by baerchen57 This presentation is distributed under the terms of the Creative Commons Attribution-Noncommercial-Share Alike 3.0 License