The big change is content loaders. darklua now accepts glob patterns that map to configurable loaders in your config file. Most loaders are already there by default, but you can override or extend them:
{
generator: "retain_lines",
rules: [
// ...
],
loaders: {
"**/*.model.json": "copy",
"**/*.json": "json",
"**/*.md": "string",
},
}This solves a few issues I know people had and it opens up new possibilities too:
- Rojo model files can now be copied when processing files (no more manual
cpworkaround) with thecopyloader - when bundling, darklua could already load data files (json, toml, yaml) and inline the converted data as Lua code, but now there are actual loaders to make that work in the regular
processflow too - there is now a path to support more Lua parsers, since there is a way to add loaders like a future
lua53loader. (this is not currently planned, but it could be sponsored)
Available loaders: luau, copy, skip, string, buffer, bytes, data loaders (json, json_lines, toml, yaml), and encoding variants for embedding content (/base64, /zstd, /gzip, /zlib)
Other changes:
constdeclarations are now supported, with a newmake_assignment_localrule to convert them tolocalassignments- type instantiation prefixes and methods are now supported (e.g.
func<<string>>()) - the
rename_variablesrule can now detect globals automatically and avoid renaming them
What's Changed
- Support type instantiation prefixes and methods by @jeparlefrancais in #345
- Add
make_assignment_localrule by @notpoiu in #346 - Add
detect_globalsparameter torename_variablesrule by @jeparlefrancais in #348 - Fix file watcher to handle rename events by @jeparlefrancais in #351
- Create content loaders by @jeparlefrancais in #354
- Support infinity for generators
column_spanparameter by @jeparlefrancais in #355 - Add content loader for json-lines and
ztsd,gzipandzlibencoding by @jeparlefrancais in #356
New Contributors
Full Changelog: v0.18.0...v0.19.0