SlideShare a Scribd company logo
1 of 54
Download to read offline
Wednesday, November 2, 11
PRESENTATION NAME
           Ext JS 3 ➟ 4 MIGRATION
                      Brian Moeskau, Sencha    @bmoeskau
                       Mats Bryntse, Bryntum   @bryntum

Wednesday, November 2, 11
Brian Moeskau
       @bmoeskau
        Cofounded Ext JS
        Founded Extensible
        Created Ext Calendar Pro




       Mats Bryntse
       @bryntum
        Founded Bryntum
        Created Ext Scheduler & Ext Gantt




Wednesday, November 2, 11
Overview

                                  Why Compatibility?
                            Migration Strategy: The Four R’s
                                For Component Makers
                                     Tips & Tricks



Wednesday, November 2, 11
Why Compatibility?
Wednesday, November 2, 11
The Compat Layer Is...
       A temporary shim for Ext 3.0+
       Minimizes “blind” debugging
       A smart migration assistant
       Migrate in a controlled manner




Wednesday, November 2, 11
The Compat Layer Is NOT...
       A magic bullet
       A long-term solution
       100% Ext 4.0 API coverage
       Quite as helpful for heavily overridden components




Wednesday, November 2, 11
without compatibility...




Wednesday, November 2, 11
with compatibility...




Wednesday, November 2, 11
without compatibility...




               Uncaught TypeError: Object #<Object> has no
               method 'reg'




Wednesday, November 2, 11
with compatibility...




               [DEPRECATED][4.0][Ext] reg: Calling a separate
               function to register custom types is no longer
               necessary. Switch your class definition to use
               Ext.define with "widget.migration-navtree" as
               the alias config.




Wednesday, November 2, 11
Migration Strategy
                                The Four R’s
Wednesday, November 2, 11
1

                             Get it...

                            Rendered


Wednesday, November 2, 11
Install the Compat Layer

             <!-- Ext 4 -->
             <script src="path/to/ext-all-debug.js"></script>

             <!-- Ext 3.x compat layer -->
             <script src="path/to/ext3-core-compat.js"></script>
             <script src="path/to/ext3-compat.js"></script>

             <!-- Application -->
             <script src="myApp.js"></script>




Wednesday, November 2, 11
Incompatible Components
       The compat layer will not help with:
       Charts
       PivotGrid
       Calendar added in 4.1!




Wednesday, November 2, 11
Fix Old Constructors
             // 2.x syntax, BAD:
             Ext.ux.Foo = function(config){
                 Ext.apply(this, config);
                 Ext.ux.Foo.superclass.constructor.call(this);
                 // more constructor logic
             }
             Ext.extend(Ext.ux.Foo, Ext.Component, {
                 bar: function(){
                     // etc.
                 }
             });




Wednesday, November 2, 11
Fix Old Constructors
             // 3.x syntax, better:
             Ext.ux.Foo = Ext.extend(Ext.Component, {
                 constructor: function(config){
                     Ext.ux.Foo.superclass.constructor.call(this);
                     // more constructor logic
                 }
                 bar: function(){
                     // etc.
                 }
             });




Wednesday, November 2, 11
Fix Old Constructors
             // 4.0 syntax, best:
             Ext.define('Ext.ux.Foo', {
                 extend: 'component',
                 constructor: function(config){
                     this.callParent(arguments);
                    // more constructor logic
                 },
                 bar: function(){
                     // etc...
                 }
             });




Wednesday, November 2, 11
Be Bold
       Take a hatchet to it!
       Simplify the app entry point
       Start simple, build on each success




Wednesday, November 2, 11
2
                            Get it...

                            Running
                             Rendered



Wednesday, November 2, 11
Fix Runtime Errors
       Element.child ⬄ Element.down
       Fix deprecated properties
       Exceptions not covered by the compat layer




Wednesday, November 2, 11
Big “Pattern” Changes
       New class system
       define / extend / alias

       Data package
       models, new proxies, associations

       Grid
       subclasses ➟ features

       Tree
       loader / node ➟ store / model




Wednesday, November 2, 11
3
                            Get it...


                            “Right”
                             Rendered
                             Running


Wednesday, November 2, 11
Clean Up the Console
       Date, Function, String, Array
       myDate.format(‘Y-m-d’) ➟ Ext.Date.format(myDate, ‘Y-m-d’)

       Config / method / event renames
       myEl.addClass(‘foo’) ➟ myEl.addCls(‘foo’)

       Method / event argument changes
       [tool] handler: function(evt, el, panel) ➟ (evt, el, header)




Wednesday, November 2, 11
Make Changes in Bulk
       “Find-and-fix” (not replace)

       If you figure out a difficult fix...
       Locate other instances immediately, or
       Document the problem / fix, or
       Add the fix to the compat layer (and share!)




Wednesday, November 2, 11
Consider “Soft” Fixes
       Consider commenting out rather than replacing code:

       Teams / distributed development
       Not 100% sure about some fixes
       More easily spot regressions
       Post-migration assessment
       Documentation for migration #2




Wednesday, November 2, 11
4

                             Get it...

                            Refactored
                              Rendered
                              Running
                              Right
Wednesday, November 2, 11
Dynamic Loading
             // Enable dynamic loading
             Ext.Loader.setConfig({enabled: true});
             Ext.Loader.setPath('Ext.migration', 'migration/');

             // Set up top-level dependencies
             Ext.require([
                 'Ext.migration.App'
             ]);

             Ext.onReady(function(){
                 // Launch the app
                 Ext.create('Ext.migration.App').init();
             });



Wednesday, November 2, 11
Mixins
             Ext.define('Ext.AbstractComponent', {
                 mixins: {
                     observable: 'Ext.util.Observable',
                     animate: 'Ext.util.Animate',
                     elementCt: 'Ext.util.ElementContainer',
                     renderable: 'Ext.util.Renderable',
                     state: 'Ext.state.Stateful'
                 },
                 ...
             });




Wednesday, November 2, 11
Form Layouts




Wednesday, November 2, 11
MVC
             Ext.application({
                 name: 'Pandora',

                      autoCreateViewport: true,

                      models: ['Station', 'Song'],

                      stores: ['Stations', 'RecentSongs'],

                      controllers: ['Station', 'Song']
             });




Wednesday, November 2, 11
For Component Makers

Wednesday, November 2, 11
“The compatibility layer
                              is not quite as helpful
                             for heavily overridden
                                   components”


                                     but...



Wednesday, November 2, 11
The Four R’s
                             Still Apply!




Wednesday, November 2, 11
Get it Rendered
       Step 0: Understand your base / parent class (well)
       Grid and Tree

       Review existing overrides for validity
       Store / Record

       Review Ext CSS class usage
       “.ext-ie” ➟ “.x-ie”




Wednesday, November 2, 11
Get it Rendered
       Fix custom component registration

             // 3.x:
             Ext.reg('myclass', Ext.ux.MyClass);

             // 4.0 (temporary):
             Ext.reg('myclass', 'Ext.ux.MyClass');

             // 4.0 (ultimate fix):
             Ext.define('Ext.ux.MyClass', {
                 alias: 'widget.myclass',
                 // etc.
             });




Wednesday, November 2, 11
Get it Running
       Focus close to core / parent class
       Basic grid

       Add in feature by feature
       Column locking, grouping, editing




Wednesday, November 2, 11
Get it “Right”
       Use mixins for easier reusability

             Ext.define("Sch.data.EventStoreAdaptions", {
                 adaptEventStore : function() {
                     this.insert = this.modifiedInsert;
                     this.remove = this.modifiedRemove;
                 },
                 modifiedInsert : function() {
                     // etc.
                 },
                 modifiedRemove : function() {
                     // etc.
                 }
             });



Wednesday, November 2, 11
Get it “Right”
       Future-proof your CSS classes

             // Instead of overriding Ext CSS...
             .x-grid-row-over {
                 background: #eee;
             }




Wednesday, November 2, 11
Get it “Right”
       Future-proof your CSS classes

             // Add your own rules:
             .mygrid-itemover {
                 background: #eee;
             }

             Ext.define('MyGrid', {
                 extend: 'Ext.grid.Panel',
                 viewConfig: {
                     overItemCls: 'mygrid-itemover'
                 }
             });



Wednesday, November 2, 11
Get it Refactored
       Embrace the 4.0 class system
       js/sch.plugins.lines.js ➟ js/plugin/Lines.js

       Review code / class structure




Wednesday, November 2, 11
Get it Refactored
       Never a better time to start unit testing!

       Find bugs earlier
       Bugs never happen twice unnoticed
       Spend less time bug-hunting




Wednesday, November 2, 11
Get it Refactored
       Selenium
       http://seleniumhq.org

       Jasmine
       http://pivotal.github.com/jasmine

       Qunit
       http://docs.jquery.com/Qunit

       FuncUnit
       http://funcunit.com

       Siesta
       Coming soon ☺


Wednesday, November 2, 11
More details on the blog




Wednesday, November 2, 11
Tips & Tricks

Wednesday, November 2, 11
Choosing a Browser
       Chrome === Fast
       Firebug for best general debugging
       Illuminations for Ext-specific debugging
       IE for... IE verification ;)




Wednesday, November 2, 11
Firebug
       “Unresponsive script” error:
       about:config > dom.max_script_run_time

       Blank console? Switch to Chrome.

       “Reboot” the browser regularly




Wednesday, November 2, 11
Document Fixes
       When overriding private code, document well!

             Ext.define('Ext.ux.MyGrid', {
                 extend: 'Ext.grid.Panel',
                 constructor: function(config){
                     this.callParent(arguments);

                            // HACK / NOTE / TODO:
                            // Reading private member scrollerOwner
                            if (this.scrollerOwner) { ... }
                      }
             });




Wednesday, November 2, 11
Link Patches
       When patching, link to the bug report

             // http://www.sencha.com/forum/link_to_your_report.html
             // 1. Render a basic grid panel
             // 2. Call grid.scrollByDeltaX(100)
             // 3. Verify no exception is thrown
             Ext.panel.Table.override({
                 scrollByDeltaX: function(deltaX) {
                     var horizontalScroller =
             this.getHorizontalScroller();
                     if (horizontalScroller) {
                         horizontalScroller.scrollByDeltaX(deltaX);
                     }
                 }
             });

Wednesday, November 2, 11
Useful Compat Settings
       Ext.Compat.silent

       Ext.Compat.showErrors

       ?COMPAT_DEBUG=1




Wednesday, November 2, 11
Reading the Stack Trace
       For compat debugging, find the first application error




Wednesday, November 2, 11
“But I Can’t Migrate X!”
       Sandbox with Ext 4
       Build your own compatibility layer
       Wrap with IFrames




                            Ideally, everything should be migrated.

                    Realistically, do whatever makes sense for you.



Wednesday, November 2, 11
Need Additional Help?




Wednesday, November 2, 11
Thanks!

                            Blog post / Migration Guide / Screencasts

                                 http://bit.ly/3-to-4

                                          @bmoeskau
                                           @bryntum


Wednesday, November 2, 11

More Related Content

More from Sencha

Sencha Roadshow 2017: Modernizing the Ext JS Class System and Tooling
Sencha Roadshow 2017: Modernizing the Ext JS Class System and ToolingSencha Roadshow 2017: Modernizing the Ext JS Class System and Tooling
Sencha Roadshow 2017: Modernizing the Ext JS Class System and ToolingSencha
 
Sencha Roadshow 2017: Sencha Best Practices: Coworkee App
Sencha Roadshow 2017: Sencha Best Practices: Coworkee App Sencha Roadshow 2017: Sencha Best Practices: Coworkee App
Sencha Roadshow 2017: Sencha Best Practices: Coworkee App Sencha
 
Sencha Roadshow 2017: Mobile First or Desktop First
Sencha Roadshow 2017: Mobile First or Desktop FirstSencha Roadshow 2017: Mobile First or Desktop First
Sencha Roadshow 2017: Mobile First or Desktop FirstSencha
 
Sencha Roadshow 2017: Innovations in Ext JS 6.5 and Beyond
Sencha Roadshow 2017: Innovations in Ext JS 6.5 and BeyondSencha Roadshow 2017: Innovations in Ext JS 6.5 and Beyond
Sencha Roadshow 2017: Innovations in Ext JS 6.5 and BeyondSencha
 
Leveraging React and GraphQL to Create a Performant, Scalable Data Grid
Leveraging React and GraphQL to Create a Performant, Scalable Data GridLeveraging React and GraphQL to Create a Performant, Scalable Data Grid
Leveraging React and GraphQL to Create a Performant, Scalable Data GridSencha
 
Learn Key Insights from The State of Web Application Testing Research Report
Learn Key Insights from The State of Web Application Testing Research ReportLearn Key Insights from The State of Web Application Testing Research Report
Learn Key Insights from The State of Web Application Testing Research ReportSencha
 
Introducing ExtReact: Adding Powerful Sencha Components to React Apps
Introducing ExtReact: Adding Powerful Sencha Components to React AppsIntroducing ExtReact: Adding Powerful Sencha Components to React Apps
Introducing ExtReact: Adding Powerful Sencha Components to React AppsSencha
 
SenchaCon 2016: Keynote Presentation - Art Landro, Gautam Agrawal, Mark Brocato
SenchaCon 2016: Keynote Presentation - Art Landro, Gautam Agrawal, Mark BrocatoSenchaCon 2016: Keynote Presentation - Art Landro, Gautam Agrawal, Mark Brocato
SenchaCon 2016: Keynote Presentation - Art Landro, Gautam Agrawal, Mark BrocatoSencha
 
SenchaCon 2016: Add Magic to Your Ext JS Apps with D3 Visualizations - Vitaly...
SenchaCon 2016: Add Magic to Your Ext JS Apps with D3 Visualizations - Vitaly...SenchaCon 2016: Add Magic to Your Ext JS Apps with D3 Visualizations - Vitaly...
SenchaCon 2016: Add Magic to Your Ext JS Apps with D3 Visualizations - Vitaly...Sencha
 
SenchaCon 2016: LinkRest - Modern RESTful API Framework for Ext JS Apps - Rou...
SenchaCon 2016: LinkRest - Modern RESTful API Framework for Ext JS Apps - Rou...SenchaCon 2016: LinkRest - Modern RESTful API Framework for Ext JS Apps - Rou...
SenchaCon 2016: LinkRest - Modern RESTful API Framework for Ext JS Apps - Rou...Sencha
 
SenchaCon 2016: Expect the Unexpected - Dealing with Errors in Web Apps
SenchaCon 2016: Expect the Unexpected - Dealing with Errors in Web AppsSenchaCon 2016: Expect the Unexpected - Dealing with Errors in Web Apps
SenchaCon 2016: Expect the Unexpected - Dealing with Errors in Web AppsSencha
 
Ext JS Architecture Best Practices - Mitchell Simeons
Ext JS Architecture Best Practices - Mitchell SimeonsExt JS Architecture Best Practices - Mitchell Simeons
Ext JS Architecture Best Practices - Mitchell SimeonsSencha
 
SenchaCon 2016: Mobile First? Desktop First? Or Should you Think Universal Ap...
SenchaCon 2016: Mobile First? Desktop First? Or Should you Think Universal Ap...SenchaCon 2016: Mobile First? Desktop First? Or Should you Think Universal Ap...
SenchaCon 2016: Mobile First? Desktop First? Or Should you Think Universal Ap...Sencha
 
Building Ext JS Using HATEOAS - Jeff Stano
Building Ext JS Using HATEOAS - Jeff StanoBuilding Ext JS Using HATEOAS - Jeff Stano
Building Ext JS Using HATEOAS - Jeff StanoSencha
 
SenchaCon 2016: Improve Workflow Driven Applications with Ext JS Draw Package...
SenchaCon 2016: Improve Workflow Driven Applications with Ext JS Draw Package...SenchaCon 2016: Improve Workflow Driven Applications with Ext JS Draw Package...
SenchaCon 2016: Improve Workflow Driven Applications with Ext JS Draw Package...Sencha
 
SenchaCon 2016: Developing and Delivering Quality Code, Frequently - Neil Manvar
SenchaCon 2016: Developing and Delivering Quality Code, Frequently - Neil ManvarSenchaCon 2016: Developing and Delivering Quality Code, Frequently - Neil Manvar
SenchaCon 2016: Developing and Delivering Quality Code, Frequently - Neil ManvarSencha
 
SenchaCon 2016: Creating a Flexible and Usable Industry Specific Solution - D...
SenchaCon 2016: Creating a Flexible and Usable Industry Specific Solution - D...SenchaCon 2016: Creating a Flexible and Usable Industry Specific Solution - D...
SenchaCon 2016: Creating a Flexible and Usable Industry Specific Solution - D...Sencha
 
SenchaCon 2016: JavaScript is Great but Stop Writing It - Rory Hardy
SenchaCon 2016: JavaScript is Great but Stop Writing It - Rory HardySenchaCon 2016: JavaScript is Great but Stop Writing It - Rory Hardy
SenchaCon 2016: JavaScript is Great but Stop Writing It - Rory HardySencha
 
SenchaCon 2016: Accessibility, Teamwork & Ext JS: A Customer Success Story - ...
SenchaCon 2016: Accessibility, Teamwork & Ext JS: A Customer Success Story - ...SenchaCon 2016: Accessibility, Teamwork & Ext JS: A Customer Success Story - ...
SenchaCon 2016: Accessibility, Teamwork & Ext JS: A Customer Success Story - ...Sencha
 
SenchaCon 2016: Using Ext JS 6 for Cross-Platform Development on Mobile - And...
SenchaCon 2016: Using Ext JS 6 for Cross-Platform Development on Mobile - And...SenchaCon 2016: Using Ext JS 6 for Cross-Platform Development on Mobile - And...
SenchaCon 2016: Using Ext JS 6 for Cross-Platform Development on Mobile - And...Sencha
 

More from Sencha (20)

Sencha Roadshow 2017: Modernizing the Ext JS Class System and Tooling
Sencha Roadshow 2017: Modernizing the Ext JS Class System and ToolingSencha Roadshow 2017: Modernizing the Ext JS Class System and Tooling
Sencha Roadshow 2017: Modernizing the Ext JS Class System and Tooling
 
Sencha Roadshow 2017: Sencha Best Practices: Coworkee App
Sencha Roadshow 2017: Sencha Best Practices: Coworkee App Sencha Roadshow 2017: Sencha Best Practices: Coworkee App
Sencha Roadshow 2017: Sencha Best Practices: Coworkee App
 
Sencha Roadshow 2017: Mobile First or Desktop First
Sencha Roadshow 2017: Mobile First or Desktop FirstSencha Roadshow 2017: Mobile First or Desktop First
Sencha Roadshow 2017: Mobile First or Desktop First
 
Sencha Roadshow 2017: Innovations in Ext JS 6.5 and Beyond
Sencha Roadshow 2017: Innovations in Ext JS 6.5 and BeyondSencha Roadshow 2017: Innovations in Ext JS 6.5 and Beyond
Sencha Roadshow 2017: Innovations in Ext JS 6.5 and Beyond
 
Leveraging React and GraphQL to Create a Performant, Scalable Data Grid
Leveraging React and GraphQL to Create a Performant, Scalable Data GridLeveraging React and GraphQL to Create a Performant, Scalable Data Grid
Leveraging React and GraphQL to Create a Performant, Scalable Data Grid
 
Learn Key Insights from The State of Web Application Testing Research Report
Learn Key Insights from The State of Web Application Testing Research ReportLearn Key Insights from The State of Web Application Testing Research Report
Learn Key Insights from The State of Web Application Testing Research Report
 
Introducing ExtReact: Adding Powerful Sencha Components to React Apps
Introducing ExtReact: Adding Powerful Sencha Components to React AppsIntroducing ExtReact: Adding Powerful Sencha Components to React Apps
Introducing ExtReact: Adding Powerful Sencha Components to React Apps
 
SenchaCon 2016: Keynote Presentation - Art Landro, Gautam Agrawal, Mark Brocato
SenchaCon 2016: Keynote Presentation - Art Landro, Gautam Agrawal, Mark BrocatoSenchaCon 2016: Keynote Presentation - Art Landro, Gautam Agrawal, Mark Brocato
SenchaCon 2016: Keynote Presentation - Art Landro, Gautam Agrawal, Mark Brocato
 
SenchaCon 2016: Add Magic to Your Ext JS Apps with D3 Visualizations - Vitaly...
SenchaCon 2016: Add Magic to Your Ext JS Apps with D3 Visualizations - Vitaly...SenchaCon 2016: Add Magic to Your Ext JS Apps with D3 Visualizations - Vitaly...
SenchaCon 2016: Add Magic to Your Ext JS Apps with D3 Visualizations - Vitaly...
 
SenchaCon 2016: LinkRest - Modern RESTful API Framework for Ext JS Apps - Rou...
SenchaCon 2016: LinkRest - Modern RESTful API Framework for Ext JS Apps - Rou...SenchaCon 2016: LinkRest - Modern RESTful API Framework for Ext JS Apps - Rou...
SenchaCon 2016: LinkRest - Modern RESTful API Framework for Ext JS Apps - Rou...
 
SenchaCon 2016: Expect the Unexpected - Dealing with Errors in Web Apps
SenchaCon 2016: Expect the Unexpected - Dealing with Errors in Web AppsSenchaCon 2016: Expect the Unexpected - Dealing with Errors in Web Apps
SenchaCon 2016: Expect the Unexpected - Dealing with Errors in Web Apps
 
Ext JS Architecture Best Practices - Mitchell Simeons
Ext JS Architecture Best Practices - Mitchell SimeonsExt JS Architecture Best Practices - Mitchell Simeons
Ext JS Architecture Best Practices - Mitchell Simeons
 
SenchaCon 2016: Mobile First? Desktop First? Or Should you Think Universal Ap...
SenchaCon 2016: Mobile First? Desktop First? Or Should you Think Universal Ap...SenchaCon 2016: Mobile First? Desktop First? Or Should you Think Universal Ap...
SenchaCon 2016: Mobile First? Desktop First? Or Should you Think Universal Ap...
 
Building Ext JS Using HATEOAS - Jeff Stano
Building Ext JS Using HATEOAS - Jeff StanoBuilding Ext JS Using HATEOAS - Jeff Stano
Building Ext JS Using HATEOAS - Jeff Stano
 
SenchaCon 2016: Improve Workflow Driven Applications with Ext JS Draw Package...
SenchaCon 2016: Improve Workflow Driven Applications with Ext JS Draw Package...SenchaCon 2016: Improve Workflow Driven Applications with Ext JS Draw Package...
SenchaCon 2016: Improve Workflow Driven Applications with Ext JS Draw Package...
 
SenchaCon 2016: Developing and Delivering Quality Code, Frequently - Neil Manvar
SenchaCon 2016: Developing and Delivering Quality Code, Frequently - Neil ManvarSenchaCon 2016: Developing and Delivering Quality Code, Frequently - Neil Manvar
SenchaCon 2016: Developing and Delivering Quality Code, Frequently - Neil Manvar
 
SenchaCon 2016: Creating a Flexible and Usable Industry Specific Solution - D...
SenchaCon 2016: Creating a Flexible and Usable Industry Specific Solution - D...SenchaCon 2016: Creating a Flexible and Usable Industry Specific Solution - D...
SenchaCon 2016: Creating a Flexible and Usable Industry Specific Solution - D...
 
SenchaCon 2016: JavaScript is Great but Stop Writing It - Rory Hardy
SenchaCon 2016: JavaScript is Great but Stop Writing It - Rory HardySenchaCon 2016: JavaScript is Great but Stop Writing It - Rory Hardy
SenchaCon 2016: JavaScript is Great but Stop Writing It - Rory Hardy
 
SenchaCon 2016: Accessibility, Teamwork & Ext JS: A Customer Success Story - ...
SenchaCon 2016: Accessibility, Teamwork & Ext JS: A Customer Success Story - ...SenchaCon 2016: Accessibility, Teamwork & Ext JS: A Customer Success Story - ...
SenchaCon 2016: Accessibility, Teamwork & Ext JS: A Customer Success Story - ...
 
SenchaCon 2016: Using Ext JS 6 for Cross-Platform Development on Mobile - And...
SenchaCon 2016: Using Ext JS 6 for Cross-Platform Development on Mobile - And...SenchaCon 2016: Using Ext JS 6 for Cross-Platform Development on Mobile - And...
SenchaCon 2016: Using Ext JS 6 for Cross-Platform Development on Mobile - And...
 

Recently uploaded

Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesZilliz
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 

Recently uploaded (20)

Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector Databases
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 

Migrating from Ext JS 3 to 4

  • 2. PRESENTATION NAME Ext JS 3 ➟ 4 MIGRATION Brian Moeskau, Sencha @bmoeskau Mats Bryntse, Bryntum @bryntum Wednesday, November 2, 11
  • 3. Brian Moeskau @bmoeskau Cofounded Ext JS Founded Extensible Created Ext Calendar Pro Mats Bryntse @bryntum Founded Bryntum Created Ext Scheduler & Ext Gantt Wednesday, November 2, 11
  • 4. Overview Why Compatibility? Migration Strategy: The Four R’s For Component Makers Tips & Tricks Wednesday, November 2, 11
  • 6. The Compat Layer Is... A temporary shim for Ext 3.0+ Minimizes “blind” debugging A smart migration assistant Migrate in a controlled manner Wednesday, November 2, 11
  • 7. The Compat Layer Is NOT... A magic bullet A long-term solution 100% Ext 4.0 API coverage Quite as helpful for heavily overridden components Wednesday, November 2, 11
  • 10. without compatibility... Uncaught TypeError: Object #<Object> has no method 'reg' Wednesday, November 2, 11
  • 11. with compatibility... [DEPRECATED][4.0][Ext] reg: Calling a separate function to register custom types is no longer necessary. Switch your class definition to use Ext.define with "widget.migration-navtree" as the alias config. Wednesday, November 2, 11
  • 12. Migration Strategy The Four R’s Wednesday, November 2, 11
  • 13. 1 Get it... Rendered Wednesday, November 2, 11
  • 14. Install the Compat Layer <!-- Ext 4 --> <script src="path/to/ext-all-debug.js"></script> <!-- Ext 3.x compat layer --> <script src="path/to/ext3-core-compat.js"></script> <script src="path/to/ext3-compat.js"></script> <!-- Application --> <script src="myApp.js"></script> Wednesday, November 2, 11
  • 15. Incompatible Components The compat layer will not help with: Charts PivotGrid Calendar added in 4.1! Wednesday, November 2, 11
  • 16. Fix Old Constructors // 2.x syntax, BAD: Ext.ux.Foo = function(config){ Ext.apply(this, config); Ext.ux.Foo.superclass.constructor.call(this); // more constructor logic } Ext.extend(Ext.ux.Foo, Ext.Component, { bar: function(){ // etc. } }); Wednesday, November 2, 11
  • 17. Fix Old Constructors // 3.x syntax, better: Ext.ux.Foo = Ext.extend(Ext.Component, { constructor: function(config){ Ext.ux.Foo.superclass.constructor.call(this); // more constructor logic } bar: function(){ // etc. } }); Wednesday, November 2, 11
  • 18. Fix Old Constructors // 4.0 syntax, best: Ext.define('Ext.ux.Foo', { extend: 'component', constructor: function(config){ this.callParent(arguments); // more constructor logic }, bar: function(){ // etc... } }); Wednesday, November 2, 11
  • 19. Be Bold Take a hatchet to it! Simplify the app entry point Start simple, build on each success Wednesday, November 2, 11
  • 20. 2 Get it... Running Rendered Wednesday, November 2, 11
  • 21. Fix Runtime Errors Element.child ⬄ Element.down Fix deprecated properties Exceptions not covered by the compat layer Wednesday, November 2, 11
  • 22. Big “Pattern” Changes New class system define / extend / alias Data package models, new proxies, associations Grid subclasses ➟ features Tree loader / node ➟ store / model Wednesday, November 2, 11
  • 23. 3 Get it... “Right” Rendered Running Wednesday, November 2, 11
  • 24. Clean Up the Console Date, Function, String, Array myDate.format(‘Y-m-d’) ➟ Ext.Date.format(myDate, ‘Y-m-d’) Config / method / event renames myEl.addClass(‘foo’) ➟ myEl.addCls(‘foo’) Method / event argument changes [tool] handler: function(evt, el, panel) ➟ (evt, el, header) Wednesday, November 2, 11
  • 25. Make Changes in Bulk “Find-and-fix” (not replace) If you figure out a difficult fix... Locate other instances immediately, or Document the problem / fix, or Add the fix to the compat layer (and share!) Wednesday, November 2, 11
  • 26. Consider “Soft” Fixes Consider commenting out rather than replacing code: Teams / distributed development Not 100% sure about some fixes More easily spot regressions Post-migration assessment Documentation for migration #2 Wednesday, November 2, 11
  • 27. 4 Get it... Refactored Rendered Running Right Wednesday, November 2, 11
  • 28. Dynamic Loading // Enable dynamic loading Ext.Loader.setConfig({enabled: true}); Ext.Loader.setPath('Ext.migration', 'migration/'); // Set up top-level dependencies Ext.require([ 'Ext.migration.App' ]); Ext.onReady(function(){ // Launch the app Ext.create('Ext.migration.App').init(); }); Wednesday, November 2, 11
  • 29. Mixins Ext.define('Ext.AbstractComponent', { mixins: { observable: 'Ext.util.Observable', animate: 'Ext.util.Animate', elementCt: 'Ext.util.ElementContainer', renderable: 'Ext.util.Renderable', state: 'Ext.state.Stateful' }, ... }); Wednesday, November 2, 11
  • 31. MVC Ext.application({ name: 'Pandora', autoCreateViewport: true, models: ['Station', 'Song'], stores: ['Stations', 'RecentSongs'], controllers: ['Station', 'Song'] }); Wednesday, November 2, 11
  • 33. “The compatibility layer is not quite as helpful for heavily overridden components” but... Wednesday, November 2, 11
  • 34. The Four R’s Still Apply! Wednesday, November 2, 11
  • 35. Get it Rendered Step 0: Understand your base / parent class (well) Grid and Tree Review existing overrides for validity Store / Record Review Ext CSS class usage “.ext-ie” ➟ “.x-ie” Wednesday, November 2, 11
  • 36. Get it Rendered Fix custom component registration // 3.x: Ext.reg('myclass', Ext.ux.MyClass); // 4.0 (temporary): Ext.reg('myclass', 'Ext.ux.MyClass'); // 4.0 (ultimate fix): Ext.define('Ext.ux.MyClass', { alias: 'widget.myclass', // etc. }); Wednesday, November 2, 11
  • 37. Get it Running Focus close to core / parent class Basic grid Add in feature by feature Column locking, grouping, editing Wednesday, November 2, 11
  • 38. Get it “Right” Use mixins for easier reusability Ext.define("Sch.data.EventStoreAdaptions", { adaptEventStore : function() { this.insert = this.modifiedInsert; this.remove = this.modifiedRemove; }, modifiedInsert : function() { // etc. }, modifiedRemove : function() { // etc. } }); Wednesday, November 2, 11
  • 39. Get it “Right” Future-proof your CSS classes // Instead of overriding Ext CSS... .x-grid-row-over { background: #eee; } Wednesday, November 2, 11
  • 40. Get it “Right” Future-proof your CSS classes // Add your own rules: .mygrid-itemover { background: #eee; } Ext.define('MyGrid', { extend: 'Ext.grid.Panel', viewConfig: { overItemCls: 'mygrid-itemover' } }); Wednesday, November 2, 11
  • 41. Get it Refactored Embrace the 4.0 class system js/sch.plugins.lines.js ➟ js/plugin/Lines.js Review code / class structure Wednesday, November 2, 11
  • 42. Get it Refactored Never a better time to start unit testing! Find bugs earlier Bugs never happen twice unnoticed Spend less time bug-hunting Wednesday, November 2, 11
  • 43. Get it Refactored Selenium http://seleniumhq.org Jasmine http://pivotal.github.com/jasmine Qunit http://docs.jquery.com/Qunit FuncUnit http://funcunit.com Siesta Coming soon ☺ Wednesday, November 2, 11
  • 44. More details on the blog Wednesday, November 2, 11
  • 45. Tips & Tricks Wednesday, November 2, 11
  • 46. Choosing a Browser Chrome === Fast Firebug for best general debugging Illuminations for Ext-specific debugging IE for... IE verification ;) Wednesday, November 2, 11
  • 47. Firebug “Unresponsive script” error: about:config > dom.max_script_run_time Blank console? Switch to Chrome. “Reboot” the browser regularly Wednesday, November 2, 11
  • 48. Document Fixes When overriding private code, document well! Ext.define('Ext.ux.MyGrid', { extend: 'Ext.grid.Panel', constructor: function(config){ this.callParent(arguments); // HACK / NOTE / TODO: // Reading private member scrollerOwner if (this.scrollerOwner) { ... } } }); Wednesday, November 2, 11
  • 49. Link Patches When patching, link to the bug report // http://www.sencha.com/forum/link_to_your_report.html // 1. Render a basic grid panel // 2. Call grid.scrollByDeltaX(100) // 3. Verify no exception is thrown Ext.panel.Table.override({ scrollByDeltaX: function(deltaX) { var horizontalScroller = this.getHorizontalScroller(); if (horizontalScroller) { horizontalScroller.scrollByDeltaX(deltaX); } } }); Wednesday, November 2, 11
  • 50. Useful Compat Settings Ext.Compat.silent Ext.Compat.showErrors ?COMPAT_DEBUG=1 Wednesday, November 2, 11
  • 51. Reading the Stack Trace For compat debugging, find the first application error Wednesday, November 2, 11
  • 52. “But I Can’t Migrate X!” Sandbox with Ext 4 Build your own compatibility layer Wrap with IFrames Ideally, everything should be migrated. Realistically, do whatever makes sense for you. Wednesday, November 2, 11
  • 54. Thanks! Blog post / Migration Guide / Screencasts http://bit.ly/3-to-4 @bmoeskau @bryntum Wednesday, November 2, 11