Code Monkey home page Code Monkey logo

Comments (11)

johnyanarella avatar johnyanarella commented on July 20, 2024

At first glance, that doesn't appear to be a Deft issue.

Using a debugger (such as WebKit's Developer Tools) are you able to determine what class is being constructed and what event is being fired at the time that error is being thrown?

from deftjs.

jachenry avatar jachenry commented on July 20, 2024

Yeah - its the 'initialize' event fired at the end of the constructor for the activitiesindex class. With latest deft 'options' is null but with previous version 'options' is an empty object.

me.fireEvent('initialize', me);

from deftjs.

jachenry avatar jachenry commented on July 20, 2024

listener.options should never be null according to the code below. Is it possible you are overriding the create function somehow?

Ext.define('Ext.event.ListenerStack', {

    ...

    add: function(fn, scope, options, order) {

        ...

        listener = this.create(fn, scope, options, order);

        ...

        listeners.push(listener);
    },

    create: function(fn, scope, options, order) {
        return {
            stack: this,
            fn: fn,
            firingFn: false,
            boundFn: false,
            isLateBinding: typeof fn == 'string',
            scope: scope,
            options: options || {},
            order: order
        };
    },

from deftjs.

johnyanarella avatar johnyanarella commented on July 20, 2024

In the code example you provided, the only thing Deft is doing is intercepting the call to the Activities controller constructor, setting any injected property values into the instance and merging any injected config values into the options passed to the constructor before calling it. Deft doesn't add or override methods in the target class.

If the options value in the ListenerStack you referenced is undefined, I would suspect that function is being called in the wrong scope. For it to be null would mean it was explicitly set with that value somewhere. Very odd indeed.

I'm curious if Deft is mangling the config object (where you've defined the control config) before it gets to your Activities controller's constructor.

Could you temporarily add a constructor to your Activities controller?

    constructor: function(config) {
        debugger;
        return this.callParent(arguments);
    }

When paused at that programmatic breakpoint, could you inspect the value of config to see if / how it differs between those two Deft versions? If possible, could you paste the runtime value of that config variable here?

Thanks!

from deftjs.

jachenry avatar jachenry commented on July 20, 2024
Object
  application: Ext.apply.create.Class
    _appFolder: "app"
    _application: Ext.apply.create.Class
    _before: Ext.Object.classify.objectClass
    _control: Ext.Object.classify.objectClass
    _controllerInstances: Array[0]
    _controllers: Array[4]
    _history: Ext.apply.create.Class
    _launch: function (){
    _models: Array[2]
    _name: "ParkBeat"
    _profileInstances: Array[0]
    _profiles: Array[0]
    _refs: Ext.Object.classify.objectClass
    _requires: Array[1]
    _router: Ext.apply.create.Class
    _routes: Ext.Object.classify.objectClass
    _stores: Array[3]
    _views: Array[5]
    appFolder: "app"
    application: Ext.apply.create.Class
    config: Ext.Object.classify.objectClass
    configureDevice: function (){
    controllers: Array[4]
    createDevice: function () {
    eventDispatcher: Ext.apply.create.Class
    getEventDispatcher: function () {
    getId: function () {
    getObservableId: function () {
    getUniqueId: function () {
    id: "ext-app-application-1"
    initConfig: function (){}
    initialConfig: Object
    launch: function (){
    loadDevice: function () {
    managedListeners: Object
    models: Array[2]
    name: "ParkBeat"
    observableId: "#ext-app-application-1"
    registerIdentifier: function ( uuid ){
    renderError: function (record, operation) {
    renderViews: function () {
    requires: Array[1]
    stores: Array[3]
    usedSelectors: Array[1]
    viewport: Object
    views: Array[5]
    __proto__: TemplateClass
  __proto__: Object

from deftjs.

johnyanarella avatar johnyanarella commented on July 20, 2024

That looks good - the Controller is being instantiated with the application config populated to reference the application.

I misspoke earlier - Deft JS injects configuration values by intercepting the initConfig() method and merging the injected values into the configuration options that were originally passed to initConfig(). If the class is already instantiated when injection is requested, it calls the generated config setter functions instead.

Could you add a similar temporary override for initConfig()?

    initConfig: function(config) {
        debugger;
        return this.callParent(arguments);
    }

What is the value for config there?

from deftjs.

jachenry avatar jachenry commented on July 20, 2024

config is the same as it was in the constructor. However, I notice 'initConfig' gets called twice for the same controller. Is this common?

from deftjs.

jachenry avatar jachenry commented on July 20, 2024

I'm really excited to use the new ViewControllers but I can't until this issue is resolved. I created a barebones project at https://github.com/jachenry/DeftJS_Issue3 so you can see the issue first hand.

from deftjs.

johnyanarella avatar johnyanarella commented on July 20, 2024

Thank you so much for making the barebones example. That will be immensely helpful in diagnosing the problem.

I will look into this today.

from deftjs.

jachenry avatar jachenry commented on July 20, 2024

Awesome. I also asked for help on the Sencha Forum. http://www.sencha.com/forum/showthread.php?198388-DeftJS-Bug-Uncaught-TypeError-Cannot-read-property-buffer-of-undefined

from deftjs.

johnyanarella avatar johnyanarella commented on July 20, 2024

Thanks to your sample project, I've tracked down the cause. I'll be pushing a new build with a fix shortly.

from deftjs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.