Skip to content

chore: the project could use some refactoring #14

@Nitish-bot

Description

@Nitish-bot

The whole project is currently contained within a ~4k LOC L5.lua file. This makes the dev experience less than ideal by having everything mashed into one file instead of being separated into modules introduced in lua 5.1

The folders structure could be simply as it is in other processing repos (ref: libprocessing)

We don't really export any tables, everything we do is global. So I imagine all the smaller components going into an L5 folder, and the top level L5.lua file would look something like:

  require("l5.color")
  require("l5.shape")
  require("l5.typography")
  ...

The current L5.lua already has section headers. Those section headers are basically our future modules:

  • runtime
  • input/events
  • transform
  • shape
  • color
  • rendering
  • vertex
  • math
  • typography
  • system
  • media/loading

This is the safest refactor as of yet, but in the future I think it makes sense to have a segregation between the internals like local state/functions and the global public APIs like size.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions