Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-21702

As a frontend developer, I want to manage our custom YUI modules in a configuration file

    XMLWordPrintable

Details

    Description

      In the current EditorialBundle implementation, our custom YUI modules with their dependencies are directly declared in the Twig pagelayout and we are using Assetic to generate a minified version of each module file while the grunt build system is able to generate the static minifed versions.

      To ease the process, the YUI modules and some configuration settings (like filter) should be declared in a Symfony YML configuration file and a Twig function should be responsible for generating a correct YUI configuration.

      For instance with the following configuration:

      yui.yml
      parameters:
          yui:
              modules:
                  ez-editorialapp:
                      requires: ['app', 'app-transitions', 'node-screen', 'json', 'parallel', 'ez-contenteditview']
                      path: js/apps/ez-editorialapp.js
                  ez-templatebasedview:
                      requires: ['view', 'handlebars']
                      path: js/view/ez-templatebasedview.js
              filter: min
      

      The following Twig template:

      editorial.twig
      <script>
      {{ ez_editorial_yui_config( "YUI.GlobalConfig" ) }}
      </script>
      

      would result in

      result.html
      <script>
      YUI.GlobalConfig = {
          modules: {
              "ez-editorialapp": {
                  requires: ['app', 'app-transitions', 'node-screen', 'json', 'parallel', 'ez-contenteditview'],
                  fullpath: "/bundles/ezeditorial/js/apps/ez-editorialapp.js"
              },
              "ez-templatebasedview": {
                  requires: ['view', 'handlebars'],
                  fullpath: "/bundles/ezeditorial/js/view/ez-templatebasedview.js"
              }
          },
          filter: "min"
      };
      </script>
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            damien.pobel-obsolete@ez.no Damien Pobel (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Time Spent - 2 days, 2 hours Remaining Estimate - 2 hours
                2h
                Logged:
                Time Spent - 2 days, 2 hours Remaining Estimate - 2 hours
                2d 2h