Skip to content

Changes in compiler output from 9.1.4 to current master #5418

Closed
@cknitt

Description

@cknitt

I diffed the JS output from 9.1.4 to the output from the current master for one of our projects and noticed the following changes:

  • 1. Some superfluous newlines are gone 👍
  • 2. Superfluous returns (for functions returning unit) are gone. 👍
  • 3. Output for template string literals is now different. If the template string literal starts/ends directly with a placeholder, a leading "" + / trailing + "" is added.
  • 4. Promise handling is different, instead of promise.then(f) there is now Js_promise.then(f, promise), similarly for catch. This is normal because of the deprecation of @bs.send.pipe. Bindings in t-first style do not have this.
  • 5. There are now some unnecessary variables generated, e.g.: (fix merged in master)
  • 6. The printer now adds a newline after a switch case with braces (which are redundant anyway).
  • 7. String.length not inlined anymore String.length not inlined in v10 #5480 (legit as strings are now unicode)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions