- Event handling history- we normalized the event listening mechanism and the event objects are normalized today.
- Normalized subscription, normalized event handling, DOM like method names
- In YUI3 the node instance gives a dom like contenxt, we give you the DOM and it works!
- example - node.on("click", clickHandler) - this is more of JQuery style where everything is JQuery
- custom events are normalized too from YUI 2 to 3. The event methods are shortened now
Wednesday, October 28, 2009
Events Evolved by Luke Smith
YUI3 Performance - Matt Sweeney
- use the minimal seed or the seed plus loader
- third way to do it is to have one big combo handler and do YUI().use("*", function(){}) This will make sure that you have everything you need at the beginnning. It also avoids addditional http request
- lazy loading - using the use statements you can literally load everyhing on demand, except for the seed. This works for any dependencies such as css, etc.
- imageloader helps deferring the load of images - developer.yahoo.com/yui/imageloader
- you can either use modules to load your own code, or do a get script call with a function callback. The modules has the dependencies detection feature and load them which is great.
- You can use custom class to do manual event delegation in YUI2. You can do the same using delegate() in YUI3, which is a performance benefit?
- the listener objects that you get back for event listeners have methods on which you can call detach() to remove them
- Y.later - runs asynchronously
YUI3 First Concepts
- yui+loader is the seed file which should be loaded initially and it will take care of loading the rest
- yui-min is still minimal if you are concerned about the yui + loader size which is 11kb. yui-min is just 6kb
- add phase is where you can load your custom code from custom location
- Al the modules in YUI3 are broken down into submodules so that you can selectively load what you want. For example if you are using just xhr in connection, you can just load io-min and you are done. This helps you a lot in bringing down the overall footprint
Monday, October 19, 2009
Benefits of Drinking!
|
Wednesday, October 7, 2009
10 (may be more) Essential Things To Develop On Opera
Below are quick notes that I could take from a presentation by Opera team at Yahoo!
- Tools -> Advanced -> Developer Tools: This opens up development utilities very similar to firebug
- You can download web developer extensions from opera website
- Info panel shows information about the current page such as scripts, css, etc
- Reload from cache reloads the page from cache
- X-Forwarded-For HTTP Header: For opera mini and opera turbo the rendering is done on hte server. So do not use IP addresses to detect the location on a server. Instead use the X-Forwared header to detect the location of th user.
- viewport meta tag is used to specify the dimensions of a webpage which was introduced by Apple on iphones. Opera supports this for mobile as well as desktop. Do not use "fixed width" though. For example, use <meta name="viewport" content="device-width"> instead of <meta name="viewport" content="width=320">
- use media queries: you can totally change the layout based on the media queries. Its supported live on Opera (at runtime) whereas you have to reload the page in case of browsers like safari and firefox
- media queries are very powerful to present your page under different resolutions
- use window.opera to detect if its opera browser
- Opera 10 still pretends that its 9.8, so if you check for the Opera version from the User Agent string then you will be treating opera 10 as 9.8 You can use the layout rendering engine Presto version to make this detection if you really need to. The version of rendering engine is different, By the way, they decided to pretend as 9.8 because IIS servers (hail MSFT!) parses only the first digit in the version number and they started treating Opera 10 as Opera 1. This is simply hilarious to me. I will appreciate if they screw MSFT and send the user agent as 10
- marker share for opera: people say its only 1% but its really not. If you do not support you loose a huge user base in european network. This is because european countries has lower network speeds and Opera is optimized to work under this conditions
- Opera has 37% of the market in Russia
- BRIC - Brazil, Russia, India and China are the developing markets in internet space and the next 11 countries
10 Essential Things To Develop On Opera
Tools -> Advanced -> Developer Tools: This opens up development utilities very similar to firebug