
Since the ExtJS framework has long become our main and favorite tool, we very much look forward to the upcoming announcements at the first conference for developers and users of
ExtJS . In the meantime, the Lexists have pleased us with the release of a long-promised product, and also under an excellent license (for those to whom it really was important). And so,
we waited for Ext Core 3.0 , apparently, the first sign from the series of releases of the third line, which we very much expect (first of all, this, of course, is the release of a new version of the full framework, in particular, new visual components). Let's take a closer look at Ext Core 3.0.
And so, Ext Core is an attempt to enter the world of simple websites and development, where a minimum of AJAX tools is required, and where such tools as jQuery or Dojo have worked before that time. If earlier development using ExtJS required connecting the entire library (or your custom build), that for simple projects where only a couple percent of the possibilities were used was unacceptable, now we have a completely ready kernel that has the same API as the main library and sufficient to implement the many necessary functions. Yes, yes, you may notice similarities with the main library, which is also divided into ext-core, ext-adapter and the main file. In this case, we have something in between, combining functionality from adapters (using only your own adapter, which is ext-base, you cannot use third-party adapters in Ext Core) and basic library capabilities, while everything is combined into one file, without even requiring styles no, since there is no possibility to work with widgets and interface elements. Yes, Ext Core removes the unique and best, in my opinion, system of visual components from the wealth of possibilities available to us, leaving only the basic functions and methods on the basis of which we can build anything.
By the way, if you look closely, in the src directory there is a complete set of components that make up Core, which is very convenient for exploring its insides. Although, if you worked with the usual ExtJS Framework, then there will be nothing new for you, you can connect the library to the project and immediately get to work. The MIT license, under which the project is distributed, allows, unlike the GPL, which is used in ExtJS, to use the code in its own closed and commercial projects without the need to open source codes. So, if you don’t really need all the features of ExtJS, but, let's say, are planned in the future, then you can use it here and now, it seems to me that adding support for the remaining components to a project that already uses the Core version does not there will be no difficulties (but you need to experiment, which I will do the other day).
')
The size of the code also leaves a pleasant impression - without archiving, the Core only takes 76 Kb, which, in my opinion, is even better than that of jQuery, the debug version is certainly larger, as much as 180 Kb, but it is stated that using gzip compression reduces the size to 25 Kb , which is comparable to the best performance of modern libraries of similar functionality.
What is included in the core library?
- All possibilities for working with page elements are manipulation with DOM, CSS, unified work with events, hiding browser nuances, a subsystem responsible for visual effects that are used when working with page elements, animation, and similar classic functions. After a cursory inspection, it seems to me that the API is not altered in any way as compared to full ExtJS, so in many cases compatibility with the code is ensured. I will provide a list of classes included in Core - Ext.CompositeElementLite, Ext.DomHelper, Ext.DomQuery, Ext.Element, Ext.EventManager, Ext.EventObject, Ext.Fx.
- The template system support is Ext.Template, however, it is a pity that the more powerful and advanced XTemplate template system from the main version is not migrated. However, all the basic functions are available, so it is quite possible to work on the client in almost the same style as on the server (I mean something like Smarty or another template engine).
- AJAX support. To preserve the same architecture, a Data module is introduced into Core, in which the Connection component is defined, which provides low-level access to XMLHTTPRequest. Unfortunately, in Core, only work via this component is available, respectively, there are no proxies we are familiar with for connecting via a script tag or iframe. However, this is not so often used, and mostly already in the web application, which means that it is better to use full ExtJS. The traditional Ajax class extends the Connection component, providing unified access to request processing. You can also specify your own HTTP headers, send forms and override the method of sending data, intercept global events. Strange and even sad is the absence of the UpadateManager component, which, for any element, provided the ability to modify the content via ajax using one update / load method. Although no, stop, the load method is and is available, but with a restriction on the execution of scripts, which in many cases is still a restriction and requires some twists. Personally, I will try to add the traditional UpdateManager to this library.
- Expansion of basic JavaScript classes. Indicating that JS itself is a very flexible language, the developers complement and extend the basic functionality of some built-in objects, nevertheless trying to minimally influence the language itself, so that the opportunity to work, for example, with several libraries at the same time. Among the advanced features is to highlight the expansion of functions - createCallback, createDelegate and defer, to the capabilities of the Array class added methods for determining the index by the value of the element and its removal. The String primitive is expanded by the format function, which is essentially such a low-level templating engine (in this case there is a special note that this method may conflict when used on Ajax.NET pages, this is probably about this library )
- Utility methods, including the main functionality encapsulated in the global Ext class - platform and browser definition, working with URL and JSON data, working with arrays through each, determining types of variables.
- Work with timers and periodic events. Few described but very useful components are deferred tasks (DelayedTask), an extended version of the TaskRunner timer for periodic data processing (starting the specified function). I honestly am very happy with these opportunities, as I used them quite often in projects.
- And, finally, Core includes all powerful OO infrastructure, on the basis of which, in fact, the entire framework is built. You can freely create your own classes, use inheritance (in terms of the library - extend), override / override, work with prototypes. This also includes the implementation of some of the most commonly used patterns - Singlton, Observable. And, in addition, support for namespaces.
Actually, that's all that makes us ExtJS happy. I would say that very well, although having grown up on the main framework, sometimes you feel the lack of some of its capabilities, but we should not forget that the scope of Ext Core and the main framework is fundamentally different. But if you, for example, make a web application, then the site itself is quite logical for him to do together with the same library, but not forcing the visitor to download a megabyte ExtJS, instead, we just take Core, while there is no need to retrain the developers, and further expansion of the project will not be faced with the need to rewrite the code. It seems to me that Core is just a bridge between developments, when for the basic front-end we use a lightweight library, and then the heavy artillery is represented in the face of widgets and data-handling components. And here, the implementation of dynamic loading of new components would be very useful, similar to the one done in Dojo.
Core is also excellent for basic exploring the capabilities of the entire framework, since there are not so many classes and their intricacies, which means that a novice developer can gradually figure out and then move on to working with an already larger project. Although the absence of some familiar tools may initially confuse a professional developer, you will quickly get used to this, and the status of the current version is only beta, perhaps soon everything that we have been dreaming about will appear there ...