From 785f6af5f8b2ecce2088579aa56159615f98160e Mon Sep 17 00:00:00 2001 From: Mark-Marks Date: Mon, 10 Aug 2026 19:48:00 +0200 Subject: [PATCH] rfc: Exports by value are const --- rfcx/exports-by-values-are-const.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 rfcx/exports-by-values-are-const.md diff --git a/rfcx/exports-by-values-are-const.md b/rfcx/exports-by-values-are-const.md new file mode 100644 index 00000000..4a37a446 --- /dev/null +++ b/rfcx/exports-by-values-are-const.md @@ -0,0 +1,28 @@ +# Feature name + +FFlag: LuauExportsAreConst + +## Summary + +Amends the export-by-value RFC described in [Luau RFC #179]() making all exports-by-value constant, removing the `export local` syntax and with it marking exports as mutable. + +## Motivation + +Exports-by-value should not be mutable. First and foremost, it greatly simplifies any optimizations which utilize exports-by-value, and secondly removes the objectively ugly syntax of `export local`. + +## Design + +Exports-by-value are now only declared via the syntax of +```luau +export variable_name[: type] = value +``` +instead of optionally accepting the `local` keyword to signify that they're mutable by the module in which they're declared prior to them being returned at the end of the file. +This makes all exports-by-value constant with no way to change it. + +## Drawbacks + +Breaks backwards compatibility with any code that utilizes `export local`. + +## Alternatives (optional) + +Not doing this.