Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-62497

Add a new transpilation tool for ES6

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide

      Test built files

      1. Create a site with a user and enrol them in a few courses
      2. Log in as admin and make sure “cachejs” is enabled and debugging is off
      3. Purge the caches
      4. Log in as the user
      5. View the dashboard
      6. CONFIRM it all loads without any errors (check the console in your browser’s web dev tools)
      7. Open the messaging drawer and try to message someone / search / what ever
      8. CONFIRM it all loads correctly

      Test source maps

      1. Log in as admin and turn off “cachejs”
      2. Open the dev tools in your browser and view the source files
      3. CONFIRM that you see the list of JavaScript modules in the source tree. The should be named according to their location on disk in the Moodle source.
      4. Click on one of the JS modules that is loading on that page to view it in the dev tools
      5. CONFIRM that you see the unminified original source (same as what is on disk in the /amd/src/ folder)
      6. Add a break point in and reload the page
      7. CONFIRM the browser breaks when it hits the breakpoint you added
      8. CONFIRM that you can step through the code execution

      Test grunt watch without Watchman

      1. Without installing Watchman, run “grunt watch”.
      2. CONFIRM that you see a message recommending that you install Watchman but the old grunt watch still runs
      3. Modify a JavaScript file
      4. Save the changes
      5. CONFIRM that the grunt watch picks up the change and rebuilds only that file (this will take ages on MacOS which is why I added Watchman support)

      Test grunt watch with Watchman

      1. Install Watchman
      2. Run “grunt watch”
      3. CONFIRM that you don’t see a message about installing Watchman
      4. Modify one of the files that is being watched (AMD, YUI, SCSS, LESS, CSS, behat feature file)
      5. Save the changes
      6. CONFIRM that your change is picked up and the file you modified is build (or linted depending on the file type). The change detection should be practically instant.
      7. This test will need to be repeated on MacOS, Linux, and Windows.
      Show
      Test built files Create a site with a user and enrol them in a few courses Log in as admin and make sure “cachejs” is enabled and debugging is off Purge the caches Log in as the user View the dashboard CONFIRM it all loads without any errors (check the console in your browser’s web dev tools) Open the messaging drawer and try to message someone / search / what ever CONFIRM it all loads correctly Test source maps Log in as admin and turn off “cachejs” Open the dev tools in your browser and view the source files CONFIRM that you see the list of JavaScript modules in the source tree. The should be named according to their location on disk in the Moodle source. Click on one of the JS modules that is loading on that page to view it in the dev tools CONFIRM that you see the unminified original source (same as what is on disk in the /amd/src/ folder) Add a break point in and reload the page CONFIRM the browser breaks when it hits the breakpoint you added CONFIRM that you can step through the code execution Test grunt watch without Watchman Without installing Watchman, run “grunt watch”. CONFIRM that you see a message recommending that you install Watchman but the old grunt watch still runs Modify a JavaScript file Save the changes CONFIRM that the grunt watch picks up the change and rebuilds only that file (this will take ages on MacOS which is why I added Watchman support) Test grunt watch with Watchman Install Watchman Run “grunt watch” CONFIRM that you don’t see a message about installing Watchman Modify one of the files that is being watched (AMD, YUI, SCSS, LESS, CSS, behat feature file) Save the changes CONFIRM that your change is picked up and the file you modified is build (or linted depending on the file type). The change detection should be practically instant. This test will need to be repeated on MacOS, Linux, and Windows.
    • Affected Branches:
      MOODLE_36_STABLE
    • Pull Master Branch:
      MDL-62497-master

      Description

      Need to look at a transpilation tool for ES6.
      It would be nice if it transpiled to and AMD module, and took precedent over the existing AMD modules if there is a name clash.
      This way we can migrate existing AMD code to ES6 native, without breaking existing AMD modules using that code.

        Balsamiq Wireframes

          Attachments

            Issue Links

              Activity

                People

                • Votes:
                  7 Vote for this issue
                  Watchers:
                  16 Start watching this issue

                  Dates

                  • Created:
                    Updated:

                    Time Tracking

                    Estimated:
                    Original Estimate - 5 hours
                    5h
                    Remaining:
                    0m
                    Logged:
                    Time Not Required
                    Not Specified