Results 1 to 6 of 6

Thread: Some requires require manual adding

  1. #1
    Ext JS Premium Member tangix's Avatar
    Join Date
    Mar 2010
    Location
    Stockholm, Sweden
    Posts
    690
    Answers
    8
    Vote Rating
    74
      0  

    Default Some requires require manual adding

    The automatic adding works mainly fine and makes lazy developers...

    I'm dealing with some "sencha app build" issues and I find that the IDE plug-in does not add "Ext.plugin.Viewport" (and thus not Ext.plugin.Responsive" to views containing responsiveConfig.

    Also, in a project using Ext.Direct, the "Ext.direct.*" (or possibly a trimmed down version) should be added to the requires.

  2. #2
    Ext JS Premium Member tangix's Avatar
    Join Date
    Mar 2010
    Location
    Stockholm, Sweden
    Posts
    690
    Answers
    8
    Vote Rating
    74
      0  

    Default

    BTW: Using PHPStorm 2016.3.2 and plugin 6.0.11.531 on Windows 10.

  3. #3
    Sencha Premium Member richardvd's Avatar
    Join Date
    Jun 2011
    Location
    NL
    Posts
    192
    Answers
    16
    Vote Rating
    58
      0  

    Default

    Yeah, the plugin is missing that. Add plugins: ['viewport', 'responsive'] to your Main view, then it will auto require those classes.

    Ext Direct classes are auto required in my case. My addProvider() call is in the launch() method of Application.js.

  4. #4
    Sencha Premium Member richardvd's Avatar
    Join Date
    Jun 2011
    Location
    NL
    Posts
    192
    Answers
    16
    Vote Rating
    58
      0  

    Default

    You are right, here are three examples that fail at runtime after sencha app build testing or sencha app build production:

    1. Ext.direct.Manager.loadProvider(request, me.providerCallback, me);
    The plugin will add Ext.direct.Manager to the requires array, but depending on the content of the request parameter it may need additional classes such as Ext.direct.PollingProvider or Ext.direct.RemotingProvider.

    Workaround: add an array below the requires array just to trigger the plugin:
    Code:
    bogusRequires: [
        'Ext.direct.PollingProvider',
        'Ext.direct.RemotingProvider'
    ]
    2. in a ViewController, listen for data events from the Ext.Direct event domain:
    Code:
    listen: {
        direct: {
            '*': {
                data: 'onDirectEventData'
            }
        }
    }
    It will fail because Ext.app.domain.Direct is missing from the requires array.

    Workaround: add an array below the requires array just to trigger the plugin:
    Code:
    bogusRequires: [
        'Ext.app.domain.Direct'
    ]
    3. When using Ext.Toast() it should require Ext.window.Toast but it doesn't.

    Again, these examples only fail in production / testing builds.

  5. #5
    Ext JS Premium Member tangix's Avatar
    Join Date
    Mar 2010
    Location
    Stockholm, Sweden
    Posts
    690
    Answers
    8
    Vote Rating
    74
      0  

    Default

    Quote Originally Posted by richardvd View Post
    Again, these examples only fail in production / testing builds.
    Yes, always scary when moving from the cozy safety of "sencha app watch" to production... :-)

  6. #6
    Sencha Premium Member richardvd's Avatar
    Join Date
    Jun 2011
    Location
    NL
    Posts
    192
    Answers
    16
    Vote Rating
    58
      0  

    Default

    Another case where classes are missing from the requires array (more of the same):

    4. When setting up Ext.Direct form handling using the Ext.form.Basic.api config in an Ext.form.Panel, the plugin should automatically add Ext.form.action.DirectSubmit if the submit action is set, and Ext.form.action.DirectLoad if the load action is set.

    Workaround:

    Code:
    // workaround for a bug of the Sencha JetBrains plugin
    // not auto requiring essential classes:
    // just mention the classes and it will require it
    bogusRequires: [
        Ext.form.action.DirectLoad,
        Ext.form.action.DirectSubmit
    ],
    
    Also it should autocomplete the possible actions in the Ext.form.Basic.api config: load / submit.

Similar Threads

  1. [OPEN] Not adding to require when creating a widget.
    By MikeRH in forum JetBrains IDE Plugin
    Replies: 2
    Last Post: 17 Aug 2016, 7:19 AM
  2. Synchronously loading...; consider adding Ext.require()
    By marc.fearby in forum Sencha Architect 3.x: Q&A
    Replies: 2
    Last Post: 14 Dec 2014, 1:25 PM
  3. Ext.require vs Ext.class.requires
    By FPXdeveloper_4 in forum Sencha Cmd
    Replies: 4
    Last Post: 29 Mar 2012, 9:41 AM
  4. Manual Adding TreeNodes
    By FireGlow in forum Ext GWT: Help & Discussion (1.x)
    Replies: 0
    Last Post: 8 Jul 2009, 1:24 PM

Posting Permissions

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