SlideShare uma empresa Scribd logo
1 de 41
“Pulsar”
Ideas and plans




       1
Overview

• Next generation of JS library.
• Uses RequireJS as a loader.
• Implemented as a package.
• Targets different environments.



                    2
Why separate loader?

• Outsourcing all loading and
  dependency-tracking tasks.
 • Supports different platforms.
• Outsourcing “DOM ready”.
• Interoperability with other libraries.


                     3
Supported environments
 • Browser
  • Desktop
  • Mobile
  • Web workers
  • Strict mode
 • SSJS

                  4
Simple front


define([“pulsar”], function(dojo){
 // use here dojo.xxx as before
});




                   5
Layered structure
• JS-specific and platform-neutral
  modules
 • Idiomatic support: EDP, FP, AOP,
   OOP...
 • Helpers: strings, dates, json...
• Browser-specific modules
 • DOM, CSS, events, XHR...
                    6
Layered structure

• Platform-specific modules and scripts
 • Legacy browser augmentation
 • SSJS-specific extensions
 • Mobile-specific support



                   7
Package structure
• Pulsar package is implemented as a
  relevant CommonJS asynchronous
  package.
• “Main” module imports modules and
  mixes their APIs together presenting
  unified namespace.
• Different environments use different
  “main” modules and/or builds.
                   8
Supporting browser
• Browser
 • JS-specific and platform-neutral
   modules
 • DOM, CSS, events, XHR...
• Web workers
 • JS-specific and platform-neutral
 • XHR
                  9
Lessons of EmbedJS

• Building custom application- and
  platform-specific bases should be easy.
• Finer-grained modules.
• Simplified modules (example: query).
 • Trading features for size/speed.


                   10
Pulsar foundations
• Start with Dojo 1.x base.
 • Users are familiar with it.
 • Many parts are “good” and proven.
• Replace “bad” parts, add missing
  pieces.
 • Dojo Core, DojoX, plugd, EmbedJS,
   blade + custom code if needed.
                    11
DOM plan
• Replace attr() with prop().
  • Clear docs, less code.
• Split getters and setters (prop, style...).
  • Less code, faster functions.
• Unify NodeList methods with node
  functions.
  • Less code, less docs.
                      12
DOM events
• Remove connect().
 • Overloaded for AOP and DOM
   events.
 • Leads to inconsistent awkward code:
   dojo.connect(dojo.byId(“id”), ...);
• Add on(): dojo.on(“id”, “onclick”, ...);
• Split off AOP.
                     13
DOM events
• Support for event delegation.
• No IE6, IE7, IE8? in the base.
 • Legacy: should be handled separately.
• Variant: no disconnect.
 • on() returns an object with destroy()
   method, which handles disconnects.
 • The same style is used consistently.
                    14
DOM geometry
• The biggest mess we have in the base.
 • A lot of code.
 • Still buggy in some cases.
 • A lot of semi-public functions.
• We need to decide what to keep.
 • Feedback from Dijit team?

                    15
DOM geometry
• Possible plan of actions:
 • Keep position() in the base.
 • Move marginBox() and contentBox()
   to the core.
   • It means: they should be included
     explicitly by user.

                    16
XHR plan
• Keep objectToQuery() and
  queryToObject() separately.
 • They can be used by SSJS.
• Keep all form processing separately.
 • Cannot be used by web workers.
• Keep XHR (the I/O part) as a module.
 • For browsers and web workers.
                   17
Query plan

• What is the problem with query?
 • A lot of code.
 • Support issues.
 • Speed considerations.
 • Compatibility.


                     18
Query plan
• Alternatives:
 • Use Acme.
 • Use Sizzle.
   • Allow to use both?
 • Use cssQuery.
 • Use querySelectorAll.

                   19
Query plan
• Alternatives:
 • Use simplified query like EmbedJS
   and move the full-blown version to
   the core.
   • Cons: confusion? appearing less
     feature-rich?
• Allow all options for a custom base.

                   20
Query plan


• If we allow options there, we should
  stop using query in the base itself.




                   21
Query-related notes
• From my experience majority of code
  works with a single node:
 • DOM construction.
   • For several nodes templating is a
     better solution.
 • Node updates/manipulations.
• We have unnecessary overhead.
                   22
Query-related notes
• It would be nice to return the first
  matched element and stop searching.
 • In this case a single node should be
   returned rather than a NodeList.
• In any case single node functions are
  important.
 • Less overhead (proven practically).

                    23
Language helpers
• OOP
 • Should we move declare() out of the
   base?
  • It is lighter in Pulsar because the
    legacy support was removed.
 • If yes, do we need any light version?
  • Variant: delegate() + C3MRO
                   24
Globals

• Theoretically CommonJS modules can
  be evaluated in the sandbox.
 • No globals. All references are explicit.
 • What to do about dojo.config?



                    25
Legacy support
• Dojo 1.x is still the main focus of efforts.
  • We cannot afford another 0.4/0.9
    split.
• Dojo 2.0 will use the “soft start”:
  • The base first.
  • Some other modules are migrated or
    developed.
                     26
Legacy support
• All SSJS platforms are assumed to be
  legacy-free (double-check!).
• Only browsers need to be augmented.
 • We can handle browsers in two ways:
   • Conditional loading of modules (?).
   • User should include additional
     script(s), if needed.
                   27
Legacy support
• Possible solution:
 • Use Dean Edwards libraries: Base2,
   IE7, cssQuery.
 • Base2 can update prototypes for
   Array, Date, String to make them
   more conformant.
 • Base2 can augment browser objects,
   but it requires some code from us.
                       28
Legacy support
• Why augment prototypes instead of
  wrapper functions?
 • By using wrappers we penalize all
   browsers. Augmentation is free.
 • No need to augment every object:
   faster, and automatic.
• We do not augment Object.

                  29
Legacy support
• We cannot augment DOM objects.
 • Updating all objects on the fly can be
   taxing and impractical.
 • Back to wrapper functions?
• IE7 library “updates” IE6-8 to match
  IE9 HTML-wise and CSS-wise.
 • No direct effect on DOM.
                   30
Legacy support
• We may need to subset Base2 or
  provide our own solutions.
 • Base2 and IE7 are MIT licensed,
   cssQuery is LGPL.
• Augmenting DOM is not enough.
• We need to migrate from browser
  sniffing to feature detection.

                  31
Legacy support
• Feature detection:
 • I waited for dojo-fd to be finished, yet
   it is dormant for several months.
   • Ultimately I used the trunk.
 • has.js is done by Dojo contributors.
   • Should we integrate it somehow?
   • Pulsar’s browser.js is a sniffer.
                    32
Legacy support

• Possible solution:
 • Reserve a global namespace, which
   can be populated by a legacy shim.
 • Normal base modules check that
   namespace to route their functions
   properly.


                       33
Dojo Base 1.x/2.0 plan
 • Produce 1.6 as usual (end of 2010).
 • 1.7 base should coordinate with 2.0
   base.
  • Backports, deprecating old stuff.
 • 2.0 produces a compatibility module for
   1.7 base to ease the migration.
 • 1.8 finalizes base changes.
                     34
Marketing 2.0
• Guides how to migrate from 1.x and
  other major libraries to 2.0.
 • Possible compatibility layers for other
   major libraries to ease the transition.
• Common market of JS modules.
• Porting important modules from 1.x to
  2.0 including charting and grid.

                   35
Technical plan
• Everything in the base should be:
 • Documented.
 • Unit tested.
 • Benchmarked.
 • Size tested.
• Users should know benefits and
  tradeoffs exactly.
                   36
Technical plan
• All tests/demos should be hosted with
  optimized builds so we are not
  embarrassed by unrelated deficiencies.
• We have to select tools:
 • Builder/optimizer - RequireJS?
 • Inline docs - JSDoc? Dojo doc format?
 • Test harness - DOH?
                    37
General considerations
• JS is at the strange place now.
 • SSJS is red hot, yet driven by refugees
   from other languages.
 • I don’t know a single SSJS project that
   can partition a load between server
   and client.
 • James Burke and Kris Zyp are
   working on it with CommonJS.
                    38
General considerations
• JS the language is not used at 100%.
 • E.g., JS is capable of Code Generation
   (CG), yet almost nobody uses it.
   • CG is a norm for LISP languages.
   • Crockford: JS is “Lisp in C's
     Clothing”. Yet... nothing...
 • Yes, it works in strict mode too.
                    39
General considerations
• We need to explore hidden corners of JS
  and HTML5 to see if we can use them
  for the betterment of software
  development.
• We need to explore synergy between
  client and server on all levels.
 • Intelligent serving?
 • Smart pre-processing?
                   40
That’s all, folks!



        41

Mais conteúdo relacionado

Mais procurados

MongoDB Case Study at NoSQL Now 2012
MongoDB Case Study at NoSQL Now 2012MongoDB Case Study at NoSQL Now 2012
MongoDB Case Study at NoSQL Now 2012
Sean Laurent
 
Jax london 2011
Jax london 2011Jax london 2011
Jax london 2011
njbartlett
 
JavaScript Libraries (Ajax Exp 2006)
JavaScript Libraries (Ajax Exp 2006)JavaScript Libraries (Ajax Exp 2006)
JavaScript Libraries (Ajax Exp 2006)
jeresig
 

Mais procurados (20)

Polyglot and functional (Devoxx Nov/2011)
Polyglot and functional (Devoxx Nov/2011)Polyglot and functional (Devoxx Nov/2011)
Polyglot and functional (Devoxx Nov/2011)
 
Polyglot and Functional Programming (OSCON 2012)
Polyglot and Functional Programming (OSCON 2012)Polyglot and Functional Programming (OSCON 2012)
Polyglot and Functional Programming (OSCON 2012)
 
Introduction to Hadoop - ACCU2010
Introduction to Hadoop - ACCU2010Introduction to Hadoop - ACCU2010
Introduction to Hadoop - ACCU2010
 
Infinispan, a distributed in-memory key/value data grid and cache
 Infinispan, a distributed in-memory key/value data grid and cache Infinispan, a distributed in-memory key/value data grid and cache
Infinispan, a distributed in-memory key/value data grid and cache
 
MongoDB Case Study at NoSQL Now 2012
MongoDB Case Study at NoSQL Now 2012MongoDB Case Study at NoSQL Now 2012
MongoDB Case Study at NoSQL Now 2012
 
Modern Java Concurrency (Devoxx Nov/2011)
Modern Java Concurrency (Devoxx Nov/2011)Modern Java Concurrency (Devoxx Nov/2011)
Modern Java Concurrency (Devoxx Nov/2011)
 
mtl_rubykaigi
mtl_rubykaigimtl_rubykaigi
mtl_rubykaigi
 
Your backend architecture is what matters slideshare
Your backend architecture is what matters slideshareYour backend architecture is what matters slideshare
Your backend architecture is what matters slideshare
 
Jax london 2011
Jax london 2011Jax london 2011
Jax london 2011
 
Enhancing Spring MVC Web Applications Progressively with Spring JavaScript
Enhancing Spring MVC Web Applications Progressively with Spring JavaScriptEnhancing Spring MVC Web Applications Progressively with Spring JavaScript
Enhancing Spring MVC Web Applications Progressively with Spring JavaScript
 
PostgreSQL as an Alternative to MSSQL
PostgreSQL as an Alternative to MSSQLPostgreSQL as an Alternative to MSSQL
PostgreSQL as an Alternative to MSSQL
 
mogpres
mogpresmogpres
mogpres
 
JavaScript Libraries (Ajax Exp 2006)
JavaScript Libraries (Ajax Exp 2006)JavaScript Libraries (Ajax Exp 2006)
JavaScript Libraries (Ajax Exp 2006)
 
ceph openstack dream team
ceph openstack dream teamceph openstack dream team
ceph openstack dream team
 
Databases which, why and usage tips
Databases which, why and usage tipsDatabases which, why and usage tips
Databases which, why and usage tips
 
Introducing Infinispan
Introducing InfinispanIntroducing Infinispan
Introducing Infinispan
 
Dojo for programmers (TXJS 2010)
Dojo for programmers (TXJS 2010)Dojo for programmers (TXJS 2010)
Dojo for programmers (TXJS 2010)
 
Orchestrating MySQL
Orchestrating MySQLOrchestrating MySQL
Orchestrating MySQL
 
Running Open Source Solutions on Windows Azure
Running Open Source Solutions on Windows AzureRunning Open Source Solutions on Windows Azure
Running Open Source Solutions on Windows Azure
 
End-to-end W3C APIs
End-to-end W3C APIsEnd-to-end W3C APIs
End-to-end W3C APIs
 

Destaque

SlideShare And SlideCasting
SlideShare And SlideCastingSlideShare And SlideCasting
SlideShare And SlideCasting
Mary Kajewski
 
Cook Shire Libraries October 2008
Cook Shire Libraries October 2008Cook Shire Libraries October 2008
Cook Shire Libraries October 2008
Mary Kajewski
 
秋学期 第1回
秋学期 第1回秋学期 第1回
秋学期 第1回
Koji Yamada
 
Opal Training Project Presentation
Opal Training Project PresentationOpal Training Project Presentation
Opal Training Project Presentation
Mary Kajewski
 
Apresentação herói maior man
Apresentação herói maior manApresentação herói maior man
Apresentação herói maior man
zarronne
 
Como subir una imagen a tu blogger
Como subir una imagen a tu bloggerComo subir una imagen a tu blogger
Como subir una imagen a tu blogger
MCmaykolyx
 

Destaque (20)

Dojo (QCon 2007 Slides)
Dojo (QCon 2007 Slides)Dojo (QCon 2007 Slides)
Dojo (QCon 2007 Slides)
 
Dojo GFX: SVG in the real world
Dojo GFX: SVG in the real worldDojo GFX: SVG in the real world
Dojo GFX: SVG in the real world
 
DojoX GFX Keynote Eugene Lazutkin SVG Open 2007
DojoX GFX Keynote Eugene Lazutkin SVG Open 2007DojoX GFX Keynote Eugene Lazutkin SVG Open 2007
DojoX GFX Keynote Eugene Lazutkin SVG Open 2007
 
CRUD with Dojo
CRUD with DojoCRUD with Dojo
CRUD with Dojo
 
Fh Draft Nov 04
Fh   Draft Nov 04Fh   Draft Nov 04
Fh Draft Nov 04
 
SlideShare And SlideCasting
SlideShare And SlideCastingSlideShare And SlideCasting
SlideShare And SlideCasting
 
Cook Shire Libraries October 2008
Cook Shire Libraries October 2008Cook Shire Libraries October 2008
Cook Shire Libraries October 2008
 
秋学期 第1回
秋学期 第1回秋学期 第1回
秋学期 第1回
 
Functional practices in JavaScript
Functional practices in JavaScriptFunctional practices in JavaScript
Functional practices in JavaScript
 
Opal Training Project Presentation
Opal Training Project PresentationOpal Training Project Presentation
Opal Training Project Presentation
 
Python quickstart for programmers: Python Kung Fu
Python quickstart for programmers: Python Kung FuPython quickstart for programmers: Python Kung Fu
Python quickstart for programmers: Python Kung Fu
 
Facts of the fake Indian independence
Facts of the fake Indian independenceFacts of the fake Indian independence
Facts of the fake Indian independence
 
Matriz Criativa
Matriz CriativaMatriz Criativa
Matriz Criativa
 
Apresentação herói maior man
Apresentação herói maior manApresentação herói maior man
Apresentação herói maior man
 
Censos 2011 aveiro
Censos 2011 aveiroCensos 2011 aveiro
Censos 2011 aveiro
 
Grupo Scout
Grupo ScoutGrupo Scout
Grupo Scout
 
Comienza El Pgx 4
Comienza El Pgx 4Comienza El Pgx 4
Comienza El Pgx 4
 
Como subir una imagen a tu blogger
Como subir una imagen a tu bloggerComo subir una imagen a tu blogger
Como subir una imagen a tu blogger
 
Do it in remembrance of me at ssmc on 12 aug 2012
Do it in remembrance of me at ssmc on 12 aug 2012Do it in remembrance of me at ssmc on 12 aug 2012
Do it in remembrance of me at ssmc on 12 aug 2012
 
FERTILIZANTES ORANICO MINERAL
FERTILIZANTES ORANICO MINERALFERTILIZANTES ORANICO MINERAL
FERTILIZANTES ORANICO MINERAL
 

Semelhante a Pulsar

Building Real-World Dojo Web Applications
Building Real-World Dojo Web ApplicationsBuilding Real-World Dojo Web Applications
Building Real-World Dojo Web Applications
Andrew Ferrier
 
Intro to Big Data and NoSQL
Intro to Big Data and NoSQLIntro to Big Data and NoSQL
Intro to Big Data and NoSQL
Don Demcsak
 
One drupal to rule them all - Drupalcamp Caceres
One drupal to rule them all - Drupalcamp CaceresOne drupal to rule them all - Drupalcamp Caceres
One drupal to rule them all - Drupalcamp Caceres
hernanibf
 

Semelhante a Pulsar (20)

SSJS, NoSQL, GAE and AppengineJS
SSJS, NoSQL, GAE and AppengineJSSSJS, NoSQL, GAE and AppengineJS
SSJS, NoSQL, GAE and AppengineJS
 
Dojo GFX workshop slides
Dojo GFX workshop slidesDojo GFX workshop slides
Dojo GFX workshop slides
 
Building Real-World Dojo Web Applications
Building Real-World Dojo Web ApplicationsBuilding Real-World Dojo Web Applications
Building Real-World Dojo Web Applications
 
Intro to Big Data and NoSQL
Intro to Big Data and NoSQLIntro to Big Data and NoSQL
Intro to Big Data and NoSQL
 
GR8Conf 2009: Practical Groovy DSL by Guillaume Laforge
GR8Conf 2009: Practical Groovy DSL by Guillaume LaforgeGR8Conf 2009: Practical Groovy DSL by Guillaume Laforge
GR8Conf 2009: Practical Groovy DSL by Guillaume Laforge
 
Dojo Grids in XPages
Dojo Grids in XPagesDojo Grids in XPages
Dojo Grids in XPages
 
The end of embedded Linux (as we know it)
The end of embedded Linux (as we know it)The end of embedded Linux (as we know it)
The end of embedded Linux (as we know it)
 
Go: What's Different ?
Go: What's Different ?Go: What's Different ?
Go: What's Different ?
 
Dynamic Languages in Production: Progress and Open Challenges
Dynamic Languages in Production: Progress and Open ChallengesDynamic Languages in Production: Progress and Open Challenges
Dynamic Languages in Production: Progress and Open Challenges
 
Scaling with mongo db (with notes)
Scaling with mongo db (with notes)Scaling with mongo db (with notes)
Scaling with mongo db (with notes)
 
Angular 2 overview
Angular 2 overviewAngular 2 overview
Angular 2 overview
 
One drupal to rule them all - Drupalcamp Caceres
One drupal to rule them all - Drupalcamp CaceresOne drupal to rule them all - Drupalcamp Caceres
One drupal to rule them all - Drupalcamp Caceres
 
JavaFX 101
JavaFX 101JavaFX 101
JavaFX 101
 
[DBA]_HiramFleitas_SQL_PASS_Summit_2017_Summary
[DBA]_HiramFleitas_SQL_PASS_Summit_2017_Summary[DBA]_HiramFleitas_SQL_PASS_Summit_2017_Summary
[DBA]_HiramFleitas_SQL_PASS_Summit_2017_Summary
 
Pune-Cocoa: Blocks and GCD
Pune-Cocoa: Blocks and GCDPune-Cocoa: Blocks and GCD
Pune-Cocoa: Blocks and GCD
 
Latest (storage IO) patterns for cloud-native applications
Latest (storage IO) patterns for cloud-native applications Latest (storage IO) patterns for cloud-native applications
Latest (storage IO) patterns for cloud-native applications
 
Masterin Large Scale Java Script Applications
Masterin Large Scale Java Script ApplicationsMasterin Large Scale Java Script Applications
Masterin Large Scale Java Script Applications
 
Surge2012
Surge2012Surge2012
Surge2012
 
Mongo DB at Community Engine
Mongo DB at Community EngineMongo DB at Community Engine
Mongo DB at Community Engine
 
MongoDB at community engine
MongoDB at community engineMongoDB at community engine
MongoDB at community engine
 

Mais de Eugene Lazutkin

Mais de Eugene Lazutkin (12)

Service workers
Service workersService workers
Service workers
 
Advanced I/O in browser
Advanced I/O in browserAdvanced I/O in browser
Advanced I/O in browser
 
Streams
StreamsStreams
Streams
 
Express: the web server for node.js
Express: the web server for node.jsExpress: the web server for node.js
Express: the web server for node.js
 
TXJS 2013 in 10 minutes
TXJS 2013 in 10 minutesTXJS 2013 in 10 minutes
TXJS 2013 in 10 minutes
 
Practical pairing of generative programming with functional programming.
Practical pairing of generative programming with functional programming.Practical pairing of generative programming with functional programming.
Practical pairing of generative programming with functional programming.
 
Optimization of modern web applications
Optimization of modern web applicationsOptimization of modern web applications
Optimization of modern web applications
 
OOP in JS
OOP in JSOOP in JS
OOP in JS
 
Exciting JavaScript - Part II
Exciting JavaScript - Part IIExciting JavaScript - Part II
Exciting JavaScript - Part II
 
RAD CRUD
RAD CRUDRAD CRUD
RAD CRUD
 
Exciting JavaScript - Part I
Exciting JavaScript - Part IExciting JavaScript - Part I
Exciting JavaScript - Part I
 
DojoX GFX Session Eugene Lazutkin SVG Open 2007
DojoX GFX Session Eugene Lazutkin SVG Open 2007DojoX GFX Session Eugene Lazutkin SVG Open 2007
DojoX GFX Session Eugene Lazutkin SVG Open 2007
 

Último

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
 

Último (20)

TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
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...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
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...
 
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
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
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
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
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
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
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
 
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
 

Pulsar

  • 2. Overview • Next generation of JS library. • Uses RequireJS as a loader. • Implemented as a package. • Targets different environments. 2
  • 3. Why separate loader? • Outsourcing all loading and dependency-tracking tasks. • Supports different platforms. • Outsourcing “DOM ready”. • Interoperability with other libraries. 3
  • 4. Supported environments • Browser • Desktop • Mobile • Web workers • Strict mode • SSJS 4
  • 5. Simple front define([“pulsar”], function(dojo){ // use here dojo.xxx as before }); 5
  • 6. Layered structure • JS-specific and platform-neutral modules • Idiomatic support: EDP, FP, AOP, OOP... • Helpers: strings, dates, json... • Browser-specific modules • DOM, CSS, events, XHR... 6
  • 7. Layered structure • Platform-specific modules and scripts • Legacy browser augmentation • SSJS-specific extensions • Mobile-specific support 7
  • 8. Package structure • Pulsar package is implemented as a relevant CommonJS asynchronous package. • “Main” module imports modules and mixes their APIs together presenting unified namespace. • Different environments use different “main” modules and/or builds. 8
  • 9. Supporting browser • Browser • JS-specific and platform-neutral modules • DOM, CSS, events, XHR... • Web workers • JS-specific and platform-neutral • XHR 9
  • 10. Lessons of EmbedJS • Building custom application- and platform-specific bases should be easy. • Finer-grained modules. • Simplified modules (example: query). • Trading features for size/speed. 10
  • 11. Pulsar foundations • Start with Dojo 1.x base. • Users are familiar with it. • Many parts are “good” and proven. • Replace “bad” parts, add missing pieces. • Dojo Core, DojoX, plugd, EmbedJS, blade + custom code if needed. 11
  • 12. DOM plan • Replace attr() with prop(). • Clear docs, less code. • Split getters and setters (prop, style...). • Less code, faster functions. • Unify NodeList methods with node functions. • Less code, less docs. 12
  • 13. DOM events • Remove connect(). • Overloaded for AOP and DOM events. • Leads to inconsistent awkward code: dojo.connect(dojo.byId(“id”), ...); • Add on(): dojo.on(“id”, “onclick”, ...); • Split off AOP. 13
  • 14. DOM events • Support for event delegation. • No IE6, IE7, IE8? in the base. • Legacy: should be handled separately. • Variant: no disconnect. • on() returns an object with destroy() method, which handles disconnects. • The same style is used consistently. 14
  • 15. DOM geometry • The biggest mess we have in the base. • A lot of code. • Still buggy in some cases. • A lot of semi-public functions. • We need to decide what to keep. • Feedback from Dijit team? 15
  • 16. DOM geometry • Possible plan of actions: • Keep position() in the base. • Move marginBox() and contentBox() to the core. • It means: they should be included explicitly by user. 16
  • 17. XHR plan • Keep objectToQuery() and queryToObject() separately. • They can be used by SSJS. • Keep all form processing separately. • Cannot be used by web workers. • Keep XHR (the I/O part) as a module. • For browsers and web workers. 17
  • 18. Query plan • What is the problem with query? • A lot of code. • Support issues. • Speed considerations. • Compatibility. 18
  • 19. Query plan • Alternatives: • Use Acme. • Use Sizzle. • Allow to use both? • Use cssQuery. • Use querySelectorAll. 19
  • 20. Query plan • Alternatives: • Use simplified query like EmbedJS and move the full-blown version to the core. • Cons: confusion? appearing less feature-rich? • Allow all options for a custom base. 20
  • 21. Query plan • If we allow options there, we should stop using query in the base itself. 21
  • 22. Query-related notes • From my experience majority of code works with a single node: • DOM construction. • For several nodes templating is a better solution. • Node updates/manipulations. • We have unnecessary overhead. 22
  • 23. Query-related notes • It would be nice to return the first matched element and stop searching. • In this case a single node should be returned rather than a NodeList. • In any case single node functions are important. • Less overhead (proven practically). 23
  • 24. Language helpers • OOP • Should we move declare() out of the base? • It is lighter in Pulsar because the legacy support was removed. • If yes, do we need any light version? • Variant: delegate() + C3MRO 24
  • 25. Globals • Theoretically CommonJS modules can be evaluated in the sandbox. • No globals. All references are explicit. • What to do about dojo.config? 25
  • 26. Legacy support • Dojo 1.x is still the main focus of efforts. • We cannot afford another 0.4/0.9 split. • Dojo 2.0 will use the “soft start”: • The base first. • Some other modules are migrated or developed. 26
  • 27. Legacy support • All SSJS platforms are assumed to be legacy-free (double-check!). • Only browsers need to be augmented. • We can handle browsers in two ways: • Conditional loading of modules (?). • User should include additional script(s), if needed. 27
  • 28. Legacy support • Possible solution: • Use Dean Edwards libraries: Base2, IE7, cssQuery. • Base2 can update prototypes for Array, Date, String to make them more conformant. • Base2 can augment browser objects, but it requires some code from us. 28
  • 29. Legacy support • Why augment prototypes instead of wrapper functions? • By using wrappers we penalize all browsers. Augmentation is free. • No need to augment every object: faster, and automatic. • We do not augment Object. 29
  • 30. Legacy support • We cannot augment DOM objects. • Updating all objects on the fly can be taxing and impractical. • Back to wrapper functions? • IE7 library “updates” IE6-8 to match IE9 HTML-wise and CSS-wise. • No direct effect on DOM. 30
  • 31. Legacy support • We may need to subset Base2 or provide our own solutions. • Base2 and IE7 are MIT licensed, cssQuery is LGPL. • Augmenting DOM is not enough. • We need to migrate from browser sniffing to feature detection. 31
  • 32. Legacy support • Feature detection: • I waited for dojo-fd to be finished, yet it is dormant for several months. • Ultimately I used the trunk. • has.js is done by Dojo contributors. • Should we integrate it somehow? • Pulsar’s browser.js is a sniffer. 32
  • 33. Legacy support • Possible solution: • Reserve a global namespace, which can be populated by a legacy shim. • Normal base modules check that namespace to route their functions properly. 33
  • 34. Dojo Base 1.x/2.0 plan • Produce 1.6 as usual (end of 2010). • 1.7 base should coordinate with 2.0 base. • Backports, deprecating old stuff. • 2.0 produces a compatibility module for 1.7 base to ease the migration. • 1.8 finalizes base changes. 34
  • 35. Marketing 2.0 • Guides how to migrate from 1.x and other major libraries to 2.0. • Possible compatibility layers for other major libraries to ease the transition. • Common market of JS modules. • Porting important modules from 1.x to 2.0 including charting and grid. 35
  • 36. Technical plan • Everything in the base should be: • Documented. • Unit tested. • Benchmarked. • Size tested. • Users should know benefits and tradeoffs exactly. 36
  • 37. Technical plan • All tests/demos should be hosted with optimized builds so we are not embarrassed by unrelated deficiencies. • We have to select tools: • Builder/optimizer - RequireJS? • Inline docs - JSDoc? Dojo doc format? • Test harness - DOH? 37
  • 38. General considerations • JS is at the strange place now. • SSJS is red hot, yet driven by refugees from other languages. • I don’t know a single SSJS project that can partition a load between server and client. • James Burke and Kris Zyp are working on it with CommonJS. 38
  • 39. General considerations • JS the language is not used at 100%. • E.g., JS is capable of Code Generation (CG), yet almost nobody uses it. • CG is a norm for LISP languages. • Crockford: JS is “Lisp in C's Clothing”. Yet... nothing... • Yes, it works in strict mode too. 39
  • 40. General considerations • We need to explore hidden corners of JS and HTML5 to see if we can use them for the betterment of software development. • We need to explore synergy between client and server on all levels. • Intelligent serving? • Smart pre-processing? 40

Notas do Editor

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n
  20. \n
  21. \n
  22. \n
  23. \n
  24. \n
  25. \n
  26. \n
  27. \n
  28. \n
  29. \n
  30. \n
  31. \n
  32. \n
  33. \n
  34. \n
  35. \n
  36. \n
  37. \n
  38. \n
  39. \n
  40. \n
  41. \n