You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As part of the transition from the Sencha SDK tools to Sencha Cmd, third-party classes lost the ability to trigger automatic import of classes via syncRequire(). There is a now a special file in the Sencha SDKs defining magic properties that Sencha Cmd considers when evaluating classes to provide auto-require functionality. These properties are specific to Sencha framework classes and any subclasses (ex. the magic model: property in Ext.Store), but there is no public API to do define magic auto-require properties specific to third-party classes.
Currently, in the development environment, Deft JS's controller: class preprocessor syncRequire()'s the specified controller class. When an application is built using the Sencha SDK tools, this triggers automatic inclusion of that dependency in the resulting app.jsb3 file. However, when an application is built using Sencha Cmd, this call is not evaluated (because the class is now loaded into an AST and inspected rather than instantiated with require() and syncRequire() calls tracked to determine its dependencies). Consequently, the specified ViewController class dependency is not automatically included -- resulting in runtime errors that only occur in the production build due to missing ViewController classes.
This creates a negative experience for developers using the Deft JS framework - their application works in the development environment, but not in production.
We should show a warning in the development environment when a ViewController class is specified via controller: but has not been require:-ed. This might be as simple as removing the syncRequire() statement and relying on the standard class loader warning built in to Ext.create() when we attempt to instantiate the specified ViewController class within the controller: class preprocessor.
We should also reach out to Sencha to determine if in future releases of their frameworks they plan is to eliminate the existing magic properties in favor of requiring developers to always make explicit require: statements, or whether there is a chance they will open a public API to allow Sencha Cmd packages to define magic properties similar to those provided as configuration with the Sencha SDKs. It would definitely be a better developer experience to only have to specify the class in the controller: annotation, rather than specifying the class in the controller: annotation andrequire:-ing it as well.
The text was updated successfully, but these errors were encountered:
As part of the transition from the Sencha SDK tools to Sencha Cmd, third-party classes lost the ability to trigger automatic import of classes via
syncRequire()
. There is a now a special file in the Sencha SDKs defining magic properties that Sencha Cmd considers when evaluating classes to provide auto-require functionality. These properties are specific to Sencha framework classes and any subclasses (ex. the magicmodel:
property inExt.Store
), but there is no public API to do define magic auto-require properties specific to third-party classes.Currently, in the development environment, Deft JS's
controller:
class preprocessorsyncRequire()
's the specified controller class. When an application is built using the Sencha SDK tools, this triggers automatic inclusion of that dependency in the resultingapp.jsb3
file. However, when an application is built using Sencha Cmd, this call is not evaluated (because the class is now loaded into an AST and inspected rather than instantiated withrequire()
andsyncRequire()
calls tracked to determine its dependencies). Consequently, the specified ViewController class dependency is not automatically included -- resulting in runtime errors that only occur in the production build due to missing ViewController classes.This creates a negative experience for developers using the Deft JS framework - their application works in the development environment, but not in production.
We should show a warning in the development environment when a ViewController class is specified via
controller:
but has not beenrequire:
-ed. This might be as simple as removing thesyncRequire()
statement and relying on the standard class loader warning built in toExt.create()
when we attempt to instantiate the specified ViewController class within thecontroller:
class preprocessor.We should also reach out to Sencha to determine if in future releases of their frameworks they plan is to eliminate the existing magic properties in favor of requiring developers to always make explicit
require:
statements, or whether there is a chance they will open a public API to allow Sencha Cmd packages to define magic properties similar to those provided as configuration with the Sencha SDKs. It would definitely be a better developer experience to only have to specify the class in thecontroller:
annotation, rather than specifying the class in thecontroller:
annotation andrequire:
-ing it as well.The text was updated successfully, but these errors were encountered: