0 Replies Latest reply on Jul 23, 2015 8:27 AM by claisseflorent

    Soy dependencies in FTL

    claisseflorent

      Hi,

       

      In one of our plugins, we needed to call a soy template from a ftl one (after manipulating some data). This worked really fine in v7, but doesn't work at all in v8.

      I attached the current version of plugin to the case, it concerns custom message for abuse reports.

       

      So, in custom-message-abuse.ftl, we define some components using the define method:

      define('apps/abuse_messaging/main', function() {
          ...
      });
      
      

      Some of these components have dependencies that resolve really well:

      define('apps/abuse_messaging/models/message_source', [
          'underscore',
          'apps/shared/models/rest_service',
          'apps/activity_stream/models/rtc_source'
      ], function(_, RestService, RTCSource) {
          ...
      });
      
      

       

      But one component is not loading its dependencies

      define('apps/abuse_messaging/views/create_message_view', [
          'apps/abuse_messaging/controllers/micro_blogging_controller',
          'apps/userpicker/main',
          'jquery',
          'underscore',
          'soy!jive.eae.common.jsI18nHelper',
          'soy!jive.soy.plugin.abuse.successMessage',
          'soy!jive.soy.plugin.abuse.modal',
          'soy!jive.soy.plugin.abuse.notRelated'
      ], function(MicroBloggingController, UserPicker, $, _, jsI18nHelper, successMessage, modal, notRelated) {
          ...
      });
      
      

      This components won't load until jsI18nHelper and jive.soy.plugin.abuse.* are resolved.

       

      In v7, these dependencies were self resolved, without any human action.

      In v8, all the soy dependencies are non existent.

      As soon as I create empty components corresponding to these names, using

      goog.provide("jive.eae.common.jsI18nHelper");
      goog.provide("jive.soy.plugin.abuse.modal");
      goog.provide("jive.soy.plugin.abuse.successMessage");
      goog.provide("jive.soy.plugin.abuse.notRelated");
      
      

      the components are loaded (and the code crash obviously because objects are empty)

       

      Is there any way to force the correct loading of soy components in js?

       

      Regards,

      Florent.