rescript-lang / rescript-lang/rescript

Request for @functionExpression attribute to opt-out from arrow functions

Open
#7,061 10 comments 0 reactions 1 assignee View on GitHub

@cometkim is already working on this.

Since Sep 30, 2024.

enhancement
Dominant language
OCaml
Stars
7.5k
Forks
485
Avg merge
1d 2h
Merged PRs (30d)
55

Description

After the PR https://github.com/rescript-lang/rescript-compiler/pull/6945 function expressions were changed to arrow functions to improve readability and bundle-size. But it also broke this and arguments binding to the function context, which could be accessed via %raw("this") when needed for some advanced logic.

I need it for rescript-schema, so I think introducing an attribute @functionExpression to opt-out from arrow functions would be a good solution.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.