Results 1 to 8 of 8

Thread: Modern documentation referring to Classic API

    Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Sencha Premium User sdodierl's Avatar
    Join Date
    Oct 2017
    Location
    Paris
    Posts
    22

    Default Modern documentation referring to Classic API

    https://docs.sencha.com/extjs/6.6.0/...anagedListener talks of initComponent, but initComponent is a classic method.
    We're recruiting

    EcoMundo is looking for ExtJS architects and developers in their offices in πŸ‡«πŸ‡· Paris, πŸ‡²πŸ‡¬ Tananarive and πŸ‡»πŸ‡³ Ho Chi Minh City!

    Check out https://www.ecomundo.eu/fr/recrutement or get in touch with me. We're a global actor in software for chemical regulatory compliance, with the size and state of mind of a start-up.

  2. #2
    Sencha Premium User dawesi's Avatar
    Join Date
    Mar 2007
    Location
    Melbourne, Australia (aka GMT+10)
    Posts
    1,208

    Default

    just for clarification, the example references it. It's clearly a docco oversight, and a nice catch!

    As mentioned, addManagedListener is no longer a best practice use, so probably why it's been overlooked.
    Cloud Application Architect

    Sencha Specialist / Sencha MVP
    ExtJs Developer + Contributor since 0.2.2 - Champion of the per developer license.

  3. #3
    Sencha Premium User evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    19,239

    Default

    As mentioned, addManagedListener is no longer a best practice use, so probably why it's been overlooked.
    Best practice isn't really relevant, it's just typically not needed in the default case.

    Consider the following fiddle:

    https://fiddle.sencha.com/#view/editor&fiddle/2ojc

    - Press click me, notice the event fires for all 3 components.
    - Run "destroy it"
    - Press click me again, notice the event for "c2" is still attached.

    There are still legitimate uses for addManagedListener/mon,
    Twitter - @evantrimboli
    Former Sencha framework engineer, available for consulting.
    As of 2017-09-22 I am not employed by Sencha, all subsequent posts are my own and do not represent Sencha in any way.

  4. #4
    Sencha Premium User sdodierl's Avatar
    Join Date
    Oct 2017
    Location
    Paris
    Posts
    22

    Default

    Ironically, in the toolkit I'm currently developing on top of ExtJS for my company's apps, we are dumping data binding and ViewController in favour of wrappers to addManagedListener in our ExtJS modern code, because we find it more robust. If it was deprecated we would either maintain patches over ExtJS to re-introduce it, or stop updating.

    @evant's example is why addManagerListener is crucial to us. Our wrapper connects managed listeners, and ensures the initial value is passed over when the listener is installed. It's as close to a between-components binding as it gets. Having the listener automatically clean up is vital. In fact, back in ExtJS 4 we developed an equivalent override to tie network requests to a component's lifecycle too, to avoid executing request handlers that reference destroyed components (we listen to the tied observable's destroy event and cancel the request when it is fired). I don't think ExtJS 6 could supersede that kind of use case, since not all our requests can be handled via stores and proxies.

    Either way, I'm glad action will be taken to update the doc. There are a few other areas where I've stumbled upon doc issues like that. Should I report them separately, or add them to this topic if I find them again (or add them till the topic is closed, and then open a new topic afterwards)?
    We're recruiting

    EcoMundo is looking for ExtJS architects and developers in their offices in πŸ‡«πŸ‡· Paris, πŸ‡²πŸ‡¬ Tananarive and πŸ‡»πŸ‡³ Ho Chi Minh City!

    Check out https://www.ecomundo.eu/fr/recrutement or get in touch with me. We're a global actor in software for chemical regulatory compliance, with the size and state of mind of a start-up.

  5. #5
    Sencha Premium User evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    19,239

    Default

    Either way, I'm glad action will be taken to update the doc.
    Nobody who works at Sencha has responded. I wouldn't hold your breath. Arguably, the only reason it needs changing is because it just happens to refer to a method used in the classic lifecycle. Replace "initComponent" with "foo" and the problem is solved...?
    Twitter - @evantrimboli
    Former Sencha framework engineer, available for consulting.
    As of 2017-09-22 I am not employed by Sencha, all subsequent posts are my own and do not represent Sencha in any way.

  6. #6
    Sencha Premium User sdodierl's Avatar
    Join Date
    Oct 2017
    Location
    Paris
    Posts
    22

    Default

    Quote Originally Posted by evant View Post
    Nobody who works at Sencha has responded. I wouldn't hold your breath. Arguably, the only reason it needs changing is because it just happens to refer to a method used in the classic lifecycle. Replace "initComponent" with "foo" and the problem is solved...?
    Oh, I thought dawesi still worked there, somehow. My bad.

    Well, the issue with the rather poor documentation of Modern (sometimes referring to code from Classic, and, sometimes, Modern guides showing Classic code as examples) is that it doesn't help in the already steep learning curve. I ended up having to read how classes are generated by ExtJS to find out how configs work, for instance.

    Arguably, too, if the doc has been copy/pasted from Classic, it could be as well that it simply isn't up-to-date and doesn't describe accurately the API of the function. So, I do need Sencha to check that out.
    We're recruiting

    EcoMundo is looking for ExtJS architects and developers in their offices in πŸ‡«πŸ‡· Paris, πŸ‡²πŸ‡¬ Tananarive and πŸ‡»πŸ‡³ Ho Chi Minh City!

    Check out https://www.ecomundo.eu/fr/recrutement or get in touch with me. We're a global actor in software for chemical regulatory compliance, with the size and state of mind of a start-up.

  7. #7
    Sencha Premium User evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    19,239

    Default

    The doc hasn't been copy/pasted, it refers to code that it shared between Modern and Classic. It should probably use some other method name, just for the sake of clarity.
    Twitter - @evantrimboli
    Former Sencha framework engineer, available for consulting.
    As of 2017-09-22 I am not employed by Sencha, all subsequent posts are my own and do not represent Sencha in any way.

  8. #8
    Sencha Premium User sdodierl's Avatar
    Join Date
    Oct 2017
    Location
    Paris
    Posts
    22

    Default

    Ah, not sure why this did not occur to me, evant. Thanks for clarifying.
    We're recruiting

    EcoMundo is looking for ExtJS architects and developers in their offices in πŸ‡«πŸ‡· Paris, πŸ‡²πŸ‡¬ Tananarive and πŸ‡»πŸ‡³ Ho Chi Minh City!

    Check out https://www.ecomundo.eu/fr/recrutement or get in touch with me. We're a global actor in software for chemical regulatory compliance, with the size and state of mind of a start-up.

Similar Threads

  1. 6.5.3.xx Ext toast Modern vs Classic
    By dtex-lab in forum Ext JS 6.x Q&A
    Replies: 2
    Last Post: 25 Apr 2018, 5:53 AM
  2. Migrating app from classic to modern
    By bogc in forum Sencha Architect 4.x: Q&A
    Replies: 2
    Last Post: 8 Nov 2017, 4:01 PM
  3. Different folder name for classic/modern
    By demongloom in forum Ext JS 6.x Q&A
    Replies: 6
    Last Post: 29 May 2016, 11:26 PM
  4. [OPEN] removeCls Classic v. Modern
    By mcCrimson in forum Ext JS 6.x Bugs
    Replies: 1
    Last Post: 1 Feb 2016, 11:31 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •