defold / defold/defold

Clean up Resource implementations in the editor

Open
#13,013 0 comments 0 reactions 0 assignees View on GitHub
editor task
Dominant language
C++
Stars
6.3k
Forks
455
Avg merge
2d 2h
Merged PRs (30d)
129

Description

We have a lot of implementations of the `Resource` protocol. These first ones all serve a purpose:

- `resource/FileResource`
- `resource/MemoryResource`
- `resource/ZipResource`
- `workspace/BuildResource`

Then there's these ones that we use in a few tests. I'm not sure why we need mock `Resources` at all, but surely one should suffice?

- `pipeline-test/TestResource`
- `test-util/FakeFileResource`

Finally, we have these that all appear to be hacks around limitations in `workspace/BuildResource`:

- `game-project/CustomResource`
- `game-project/DependencyMetadataResource` *new!*
- `gamepads/GamepadDatabaseBuildResource` *new!*

Two of these were recently introduced. Presumably to solve similar problems that `game-project/CustomResource` (apologetically, through comments) exists to solve. It seems to be spreading. Let's fix whatever is wrong with `workspace/BuildResource` instead!

Contributor guide

Open the contributing guide

Research direction

Start by reading workspace/BuildResource and comparing it with game-project/CustomResource, game-project/DependencyMetadataResource, and gamepads/GamepadDatabaseBuildResource to identify the shared limitation. Then inspect pipeline-test/TestResource and test-util/FakeFileResource to understand their test uses. Done means consolidating unnecessary mock resources and removing the workaround implementations without breaking the affected tests.

Written by the indexing model from the issue text.

Assessment

Domain
tooling
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.