Thank you for reporting this bug. We will make it our priority to review this report.
-
Raw `sencha compile` failing to include framework
My minimal build tests from ExtJS 5 are failing with ExtJS 6.0.0 and CMD 6.0.0.92. I couldn't find any new CMD 6 documentation and I don't get any errors about the compile parameters so I'm assuming for now that the syntax is the same as 5.0
Check out this repo, there are branches for various test scenarios (compile.sh needs to be edited with your local ext-6.0.0 path):
https://github.com/themightychris/ex...mal-build-test
minimal branch - build succeeds, but output contains only the input class, no framework
only-xtemplate branch - build fails, Ext.XTemplate not found
only-ajax branch - build fails, Ext.Ajax not found
-
The issue here is that we need to know the "toolkit" (classic or modern). I haven't looked into how to get that information into the compiler for direct use like this but I will ask about it.
Don Griffin
"Use the source, Luke!"
-
Sencha Premium Member
-
Sencha Premium Member
Use:
sencha config \ -prop \ build.id=classic \ -prop \ build.name=classic \then \compile ...
-
I want to compile some code that runs on the frontend of sites (jquery style) and I'd like to skip including any toolkit.
This reference for CMD 6 seems to indicate this usage is still supported but the docs don't appear to have been updated: http://docs.sencha.com/cmd/6.x/advan...reference.html
It says that setting the -sdk flag is all you need to do to get the compiler to pick up framework class sources
I've updated my test cases and checked with the final ExtJS 6 and CMD 6 releases and all builds are still failing
I didn't have any luck with chanand`s suggestion but would love a pull request on my compile.sh in one of the branches if anyone else can get it working
Check out https://github.com/themightychris/ex...mal-build-test
Current Results w/ ext-6.0.0.640-gpl + cmd-6.0.0.202
- only-singleton: Compile succeeds but output only contains the singleton test class, no framework
- only-xtemplate: Compile fails due to Ext.XTemplate not being found, despite -sdk switch being set
- only-ajax: Compile fails due to Ext.Ajax not being found, despite -sdk switch being set
All of these should be able to build without a toolkit and produce a build with the framework base + actual class dependencies suitable for standalone inclusion into a page. This produced extremely bloated builds under 5.x but worked
-
Sencha User

Originally Posted by
chanand
Use:
sencha config \ -prop \ build.id=classic \ -prop \ build.name=classic \then \compile ...
Can I buy a vowel please? I can't find a syntax that sencha will accept for this.
* * *
Rich Waters wrote a comment on this at https://www.sencha.com/blog/blazingl...-sencha-touch/ last August.
If you can find him, he may have solved it...
I think bloated is a way of life now. Witness the blog post.
* * *
Here I am within an extJS 6 workspace.
The original sdk used to create the workspace is ../../../../../sencha/ext-6.0.0/
Code:
sencha \
-sdk ./ext/classic/classic/src \
compile \
-classpath=./chris \
-options=debug:false \
union -r -c MyApp.MyClass \
and concat ./build/minimal.js \
and concat -yui ./build/minimal.min.js \
and meta -f -out ./build/minimal.filenames.js
[ERR] Unable to locate supported Framework
sencha \
-sdk ../../../../../sencha/ext-6.0.0/ \
compile \
-classpath=./chris \
-options=debug:false \
union -r -c MyApp.MyClass \
and concat ./build/minimal.js \
and concat -yui ./build/minimal.min.js \
and meta -f -out ./build/minimal.filenames.js
NO ERRS but minimal contains only MyApp.
sencha \
-sdk ../../../../../sencha/ext-6.0.0/ \
compile \
-classpath=./chris,./ext/classic/classic/src \
-options=debug:false \
union -r -c MyApp.MyClass \
and concat ./build/minimal.js \
and concat -yui ./build/minimal.min.js \
and meta -f -out ./build/minimal.filenames.js
[ERR] Failed to resolve dependency Ext.Widget for file Ext.ProgressBarWidget
* * *
It may be possible to do this with Ant. Or at least that would work around my ignorance of how to set those properties AND compile in the same line.
Sorry I cannot help. I post in ignorance because ya never know
-
the \s indicate escapes for line breaks in a multi-line bash command, I think i'm applying the configs correctly here: https://github.com/themightychris/ex...ops/compile.sh
Code:
sencha \
-sdk $EXT_SDK_DIR \
config \
-prop build.id=classic \
-prop build.name=classic \
then compile \
-classpath=./src \
-options=debug:false \
union -r -c MyApp.MyClass \
and concat ./build/minimal.js \
and concat -yui ./build/minimal.min.js \
and meta -f -out ./build/minimal.filenames.js
but I still get:
Code:
Sencha Cmd v6.0.0.202
[INF] Configuration property changed. Reloading build environment state.
[ERR] C2008: Requirement had no matching files (Ext.XTemplate) -- /Users/chris/Repositories/extjs-minimal-build-test/src/MyClass.js:3:10
[ERR] Failed to find any files for /Users/chris/Repositories/extjs-minimal-build-test/src/MyClass.js::ClassRequire::Ext.XTemplate
-
Manually populating the classpath param with the src/overrides folder from needed framework packages gets the build to complete successfully with a reasonable looking file list:
Code:
sencha \
-sdk $EXT_SDK_DIR \
compile \
-classpath=./src,$EXT_SDK_DIR/packages/core/src,$EXT_SDK_DIR/packages/core/overrides \
-options=debug:false \
union -r -c MyApp.MyClass \
and concat ./build/minimal.js \
and concat -yui ./build/minimal.min.js \
and meta -f -out ./build/minimal.filenames.js
Code:
bootstrap.loadScripts(../../../../../sdk/ext-6.0.0.640-gpl/.sencha/package/Boot.js);
bootstrap.loadScripts(../../../../../sdk/ext-6.0.0.640-gpl/packages/core/src/Ext.js);
bootstrap.loadScripts(../../../../../sdk/ext-6.0.0.640-gpl/packages/core/src/lang/Error.js);
bootstrap.loadScripts(../../../../../sdk/ext-6.0.0.640-gpl/packages/core/src/lang/Number.js);
bootstrap.loadScripts(../../../../../sdk/ext-6.0.0.640-gpl/packages/core/src/lang/Array.js);
bootstrap.loadScripts(../../../../../sdk/ext-6.0.0.640-gpl/packages/core/src/lang/String.js);
bootstrap.loadScripts(../../../../../sdk/ext-6.0.0.640-gpl/packages/core/src/lang/Date.js);
bootstrap.loadScripts(../../../../../sdk/ext-6.0.0.640-gpl/packages/core/src/util/Format.js);
bootstrap.loadScripts(../../../../../sdk/ext-6.0.0.640-gpl/packages/core/src/Template.js);
bootstrap.loadScripts(../../../../../sdk/ext-6.0.0.640-gpl/packages/core/src/util/XTemplateParser.js);
bootstrap.loadScripts(../../../../../sdk/ext-6.0.0.640-gpl/packages/core/src/util/XTemplateCompiler.js);
bootstrap.loadScripts(../../../../../sdk/ext-6.0.0.640-gpl/packages/core/src/XTemplate.js);
bootstrap.loadScripts(../src/MyClass.js);
bootstrap.loadScripts(../../../../../sdk/ext-6.0.0.640-gpl/packages/core/src/lang/Object.js);
bootstrap.loadScripts(../../../../../sdk/ext-6.0.0.640-gpl/packages/core/src/util/Version.js);
bootstrap.loadScripts(../../../../../sdk/ext-6.0.0.640-gpl/packages/core/src/env/Browser.js);
bootstrap.loadScripts(../../../../../sdk/ext-6.0.0.640-gpl/packages/core/src/env/OS.js);
bootstrap.loadScripts(../../../../../sdk/ext-6.0.0.640-gpl/packages/core/src/env/Feature.js);
bootstrap.loadScripts(../../../../../sdk/ext-6.0.0.640-gpl/packages/core/src/lang/Assert.js);
bootstrap.loadScripts(../../../../../sdk/ext-6.0.0.640-gpl/packages/core/src/lang/Function.js);
bootstrap.loadScripts(../../../../../sdk/ext-6.0.0.640-gpl/packages/core/src/Util.js);
bootstrap.loadScripts(../../../../../sdk/ext-6.0.0.640-gpl/packages/core/src/class/Inventory.js);
bootstrap.loadScripts(../../../../../sdk/ext-6.0.0.640-gpl/packages/core/src/class/Config.js);
bootstrap.loadScripts(../../../../../sdk/ext-6.0.0.640-gpl/packages/core/src/class/Configurator.js);
bootstrap.loadScripts(../../../../../sdk/ext-6.0.0.640-gpl/packages/core/src/class/Base.js);
bootstrap.loadScripts(../../../../../sdk/ext-6.0.0.640-gpl/packages/core/src/util/Cache.js);
bootstrap.loadScripts(../../../../../sdk/ext-6.0.0.640-gpl/packages/core/src/class/Class.js);
bootstrap.loadScripts(../../../../../sdk/ext-6.0.0.640-gpl/packages/core/src/class/ClassManager.js);
bootstrap.loadScripts(../../../../../sdk/ext-6.0.0.640-gpl/packages/core/src/env/Ready.js);
bootstrap.loadScripts(../../../../../sdk/ext-6.0.0.640-gpl/packages/core/src/class/Loader.js);
bootstrap.loadScripts(../../../../../sdk/ext-6.0.0.640-gpl/packages/core/src/dom/Helper.js);
But when I try to load the resulting build I get an error that Ext.define is undefined. Shouldn't that be in core/src/Ext.js?
-
Sencha User
Try adding ./ext/packages/core/src/class to the path?
I'm not able to test here and now.
-
./ext/packages/core/src is already in my classpaths and stuff from the class/ folder is already being included in the build by CMD (looks like everything but Mixin is already getting included)
It doesn't look like Ext.define is defined anywhere in the core/src/class files, does anyone know where Ext.define gets...defined?
UPDATE: looks like it is defined in Ext.ClassManager which is getting included in my build already but maybe too late