Adopt ES module syntax
What does this MR do?
Replaces all CJS module syntax:
// foo.js
module.exports = class Foo { /* ... */ };
// bar.js
const Foo = require('foo');
with ES module syntax:
// foo.js
export default class Foo ( /* ... */ };
// bar.js
import Foo from 'foo';
Are there points in the code the reviewer needs to double check?
Why was this MR needed?
ES module syntax is supported natively in webpack and allows for declarative, statically analyzed dependencies. It will also allow us to do fun things like tree shaking.
Screenshots (if relevant)
n/a
Does this MR meet the acceptance criteria?
-
Changelog entry added -
Documentation created/updated - Tests
-
All builds are passing
-
-
Conform by the merge request performance guides -
Conform by the style guides -
Branch has no merge conflicts with master
(if it does - rebase it please) -
Squashed related commits together
What are the relevant issue numbers?
Merge request reports
Activity
added 825 commits
-
f60d1cfe...1110b2f1 - 822 commits from branch
master
- b4a5a9bb - fix failing test due to import syntax
- 758fe969 - Merge branch 'master' into adopt-es-module-syntax
- fb79e2cb - fix additional CJS uses after merge
Toggle commit list-
f60d1cfe...1110b2f1 - 822 commits from branch
added 2 commits
added 1 commit
- 918a73af - fix global Vue dependency in issuable bundle
added 584 commits
-
918a73af...b26d4d2a - 584 commits from branch
master
-
918a73af...b26d4d2a - 584 commits from branch
added 4011 commits
-
b26d4d2a...ba44ca13 - 4011 commits from branch
master
-
b26d4d2a...ba44ca13 - 4011 commits from branch
added 7 commits
- a8b5878b - update boards_bundle to ES module syntax
- 4322d3c2 - update cycle_analytics_bundle to ES module syntax
- c594ed49 - update diff_notes_bundle to ES module syntax
- 0fce2df7 - update filtered_search to ES module syntax
- f5ad1dcb - update shortcuts scripts to use ES module syntax
- 5bd54918 - update remaining uses of CJS syntax to ES module syntax
- 6c695c52 - update dispatcher.js to use ES module syntax
Toggle commit listadded 1 commit
- f68a3f3f - fix implicit window object reference within gl_form_spec
marked the checklist item Documentation created/updated as completed
added 1 commit
- 8892e66c - update linter to catch uses of commonjs syntax
changed milestone to %9.3
@filipa can you review this and gitlab-ee!1913?
assigned to @filipa
- Resolved by Filipa Lacerda
@mikegreiling thank you for this!
The code lgtm, I run it locally and found one problem: (not sure if it was introduced by this MR since it is 266 commits behind master)
- Edit a file, save changes with the
Start a new merge request with these changes
checked, and no merge request is created, it commits to master directly
Can you please confirm this was not introduced by this MR? Thanks!
- Edit a file, save changes with the
assigned to @mikegreiling
@filipa I ran through the steps you outlined and can confirm that it does behave that way, but master does this as well so I think that is a separate issue.
I think you are supposed to change "target branch" to something other than "master" for that "Start a new merge request with these changes" to have any effect.
Can you merge this?
assigned to @filipa
@filipa I created a new issue for the bug you described here: #32703 (closed)
Thank you @mikegreiling
mentioned in commit b261fb7b