Skip to content
Snippets Groups Projects

Adopt ES module syntax

Merged username-removed-636429 requested to merge adopt-es-module-syntax into master
All threads resolved!

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?

What are the relevant issue numbers?

#27486 (moved)

Edited by username-removed-636429

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Filipa Lacerda resolved all discussions

    resolved all discussions

  • @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!

  • @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?

  • @filipa I created a new issue for the bug you described here: #32703 (closed)

  • Filipa Lacerda approved this merge request

    approved this merge request

  • Filipa Lacerda mentioned in commit b261fb7b

    mentioned in commit b261fb7b

  • Please register or sign in to reply
    Loading