Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Asset listing generator should run last #837

Open
davesmith00000 opened this issue Feb 6, 2025 · 1 comment
Open

Asset listing generator should run last #837

davesmith00000 opened this issue Feb 6, 2025 · 1 comment

Comments

@davesmith00000
Copy link
Member

I think at the moment the generators just run in order, but there's a minor race condition possible when you have a generator that makes an asset run after the asset listing generator, because the new asset won't be picked up.

Think about how to formulate the generators so that the order is known and good.

@davesmith00000
Copy link
Member Author

I've idly be pondering this.

What we currently have is an effective, but dumb set up of code generators - just a list of generators that run in order - that work well but lack sophistication. A high quality problem to be sure. 🙂

What we can't do right now is the sort of feedback loop wanted in #845, or any sort of order guarantees.

To solve that, I propose changing the set up of the generators so that:

  1. All 'resource' generators run first. (Things that make assets)
  2. All code generators run next, but do not actually write out their data, instead they provide metadata that can be completed later and then written.
  3. Config gen, Asset listing happens next (ALWAYS, whether the dev uses it or not), both writing files and producing meta data that can be used by...
  4. Finalised code generators (from step 2), and...
  5. A new BootData generator that uses the metadata to automagically wire up all the basic fonts and assets and so on. (?)

For bonus points, we should have a formal (or way to define) "initial assets / things" set of things that are safe to include in the BootData.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant