LuauPolyfill is a package for Roblox Luau that provides Javascript functions to Luau, literally acting as a Polyfill.
LuauPolyfill can provide Javascript functions to your code that are built in Roblox Luau. If you're a Javascript developer and you want to make deviations of your favorite packages for Luau, then LuauPolyfill may be for you! This package offers the following Javascript libraries:
- Array
- AssertionError (NodeJS)
- Boolean
- Console
- Error
- Math
- Number
- Object
- String
- Symbol
- Timers
There are also a few other utilities included within LuauPolyfill. These are mainly just extras for if you want to use them. They include:
- Map
- Promise
- Set
- WeakMap
- encodeURIComponent
- extends
- instanceof
LuauPolyfill was created by engineers at Roblox Corporation to assist with upstreams of popular Javascript tools, such as React, GraphQL, and ApolloGraphQL. However, it can be used by anyone if they so desire. This was released to Github due to it being relatively unknown and that some developers may find it useful.
To install this, you will need Rojo or Foreman. Optionally, if you are a Roblox engineer or user who has Rotriever, support for that has been added too.
Wally and Selene support will be added soon.
To install this with Rojo, take a look at place.project.json and build a place in Rojo with it. Install it from Foreman via the foreman.toml file.