OK, I have some good news to report. After a few changes, I have the latest version of Extensible building with Sencha Cmd 3, though with some caveats. I plan on getting this so that it can be fully automated, but for now at least, if you must use Cmd v3 today, this should get you going.TL;DR
The latest code in Github (and shortly, 1.6.0 RC) now builds with Cmd. There are a few manual steps required at this time (this assumes an app structure generated by Cmd):
One-time setup per application:
- Modify your index.html file's <x-bootstrap> section to include the Extensible.js file after Ext is included, e.g. <script src="/extensible/src/Extensible.js"></script>. Note that this should be the Extensible class file from the src folder, not a pre-built extensible-all file. It is only used to bootstrap the loading of Extensible's classes.
- Update your .sencha/app/sencha.cfg file to include Extensible's /src folder (wherever you have it on your system) in the app path, e.g.:
- Code: Select all
: Apparently now as of Cmd 4.x, the classpath order matters, and it seems that Extensible's path MUST be included before the app path, or else the Extensible class will be overwritten during the build process.
That should be all that's required to get the app compiling with Extensible.
Fix Extensible resources (to be done after each build
- Copy extensible-all.css from the Extensible distribution into your app's /build/[app]/[environment]/resources folder and put it into its own subfolder called "css" (name doesn't really matter, it just needs to be in a subfolder for its image paths to work by default)
- Copy the Extensible resources/images/default folder to your app's /build/[app]/[environment]/resources/images folder
- Modify the generated index.html to include the Extensible stylesheet you just copied over, e.g. <link rel="stylesheet" href="resources/css/extensible-all.css"/>
With that, your compiled app should be working with the calendar. If you run into any issues or I've left anything out, please let me know. I realize this is not ideal, and I'm going to try to write a script to automate this last section, but for now at least it will get you going.More Details, if you're interested
The basic issue with the Mappings classes is that Cmd doesn't like them, but any way that you try to change the classes directly (by wrapping them in Ext.define), while making Cmd happy, breaks the mapping logic. I spent a while on this, and never could figure out an appropriate fix that would preserve API compatibility
(that's the key). The long-term fix will be to refactor and/or remove those classes, but that will have to be in 2.0 as it will not be backwards-compatible. The good news is that I've learned about a Cmd-specific annotation you can add to a file to force Cmd to treat something as a proper Ext class, even if it isn't:
- Code: Select all
// @define Extensible.calendar.data.EventMappings
With that, the mappings work correctly with Cmd and do not break the calendar -- easy enough! I also removed a handful of old unused classes that Cmd was complaining about, as well as removed the conditional requires hacks I had in place from the Ext 4.1.0 release (Sencha appears to have fixed the issues I was having at that time). With those changes, I am able to successfully both compile (sencha compile concatenate myapp.js) and build (sencha app build).
The main issue with getting the resources to work automatically with Cmd is that Extensible still uses basic CSS (no SASS yet) and the old pre-Ext 4 image structure, so Cmd doesn't recognize them as things it knows how to manage. It should be easy to fix, but will require reorganizing the resources folder in a way that I do not want to do until 2.0, again because it could potentially cause problems for anyone who relies on the current structure in their app.
For Extensible 2.0, I plan to make the changes necessary to generate a Sencha-formatted package. That way anyone using Cmd will simply be able to require Extensible as a dependency of their application and Cmd will magically pull it in and build everything correctly. Until then, at least there's a manual workaround.