Closed AlexKrupa closed 5 months ago
Ok, let me try to rephrase the problem. You want to keep generation of namespace safe FeatureStorage.sourcedBuilder()
but not to generate an aggregate for all options or features? Is that correct?
Also, my wild guess, but is the main motivation that keeping safe builder results in a single inspector tab, which is hard to use?
Correct. I want the safe builder without adding pulled features to the inspector tab. I could imagine fine-grained variants of dependency
API that would let me do that…
a single inspector tab, which is hard to use?
… but maybe the solution lies in the inspector UI? Both a single tab and multiple tabs are a bit cumbersome to use with many flags/features.
I could imagine fine-grained variants of dependency API that would let me do that…
Yeah, I'm open to a change like this.
laboratory {
dependency(project(":lib-a")) // An overload that contributes to all mechanisms.
dependency(project(":lib-b"), contributesTo: [FeatureFactory, FeatureSourceFactory, SourcedStorage, OptionFactory])
}
but maybe the solution lies in the inspector UI? Both a single tab and multiple tabs are a bit cumbersome to use with many flags/features.
Honestly, I realize it can get annoying to use when a project uses a lot of flags. I'm open to the UI design changes if you have a good idea on how to handle dozens of flags.
I'm open to the UI design changes if you have a good idea on how to handle dozens of flags.
A Chips-based filter UI seems like a good fit here.
I'm not sure I understand. How would it look like in the UI?
I'd see the UI as a flat list, with the filter chips on top. The filters could be collapsed by default to make space (e.g. single, scrollable line), but with an option to expand them into a multi-line flow layout.
While it's not exactly it, here's an example from Material.
Aren't tabs above the view pager just simpler and easier to navigate? How many features and tabs do you have that it is not sufficient?
12 tabs, so no. It's not a deal-breaker, but I'd personally prefer a flat list with sections (collapsible?).
(I'm aware that I can achieve a flat list by combining factories.)
Problem
Feature sources from library modules can't be provided through dependency without also providing their factories.
Context
Laboratory
instance along with its (sourced) storage."Remote"
.Sources can be provided to app with
dependency(...)
. This way the app's sourced storage builder knows that it needs to configure a remote storage.However, depending on a project also pulls in feature factories and option factories, which get merged into app's ones.
Workarounds
1) Dependencies-only
dependency(...)
2) No dependencies + dummy sourced flag in app
dependency(...)
calls)"Remote"
to force plugin to generate sourced storage builder step (con: unnecessary flag)3) No dependencies + stringly-typed remote source
Ignore the Gradle plugin here and use
FeatureStorage.sourced
that accepts aMap<String, FeatureStorage>
. Con: referring to"Remote"
source by string.Any other ideas? Maybe I'm misusing the library? If not, can anything be done/changed in laboratory to accommodate this use case?