-
Notifications
You must be signed in to change notification settings - Fork 954
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
Encourage depending on a subset of the Fabric API rather than the entire thing #175
Comments
IMO this should only be done to the example mod once Loader has the ability to specify the dependencies more precisely, including urls. Currently, users even get confused with where to get the mod called |
This could have been avoided by naming it
I do like this idea, and I do believe it should be included in the next schema version. It can be hard for users to tell the difference between first-party Fabric API modules, and third-party ones like I personally hope Fabric will support/encourage/have first-party support for Modrinth links rather than CF. (shedaniel and his revenue-sharing-only policy can still use CurseForge, I guess.) |
There's an API PR for this (it can be done with Loader's support for aliases with the
I'd say the permissions api is badly named here since it copies the naming pattern (
(this is getting off-topic, but) IMO the best solution here would just be to support an array of URLs where the user can choose one. (So mods could provide both CF and MR for example) |
This at the very least needs to wait for loader changes to make error messages more useful. Module discovery for modders is also an issue that needs to be dealt with. The granule option should be mentioned in the |
This is a valid concern. Usually you can tell which module something comes from based on its package name, but if you haven't brought that into your IDE yet, then you won't be able to find the classes in the first place. If you bring in all of Fabric API, then comes the issue of keeping what you actually use & what you declare in |
This project currently depends on the entire Fabric API, with no mention of
fabricApi.module
:fabric-example-mod/build.gradle
Line 28 in 06e3e43
fabric-example-mod/src/main/resources/fabric.mod.json
Line 31 in 06e3e43
This encourages oversights like QuiltServerTools/Ledger#163, which force server / modpack admins to always include all of Fabric API, even those modules which are not actually required for the mods to function.
The first question on everyone's mind whenever I bring this up is usually "But why in the world wouldn't you want to always include the entirety of Fabric API?", I'll answer that first because it also explains why the current approach isn't the most optimal.
There are API modules that only add harmless mixin hooks, but there are also modules that introduce side effects that may not be needed to support many (or even most) mods. For example, registry sync is only relevant when the registries need syncing (AKA, only when registries are modified), resource loader is only necessary when resources need loading (for example, mod icons for Mod Menu), networking is only necessary when the client needs to know what communication channels the server supports, etc.
Fabric is much, much more performant even with Fabric API than any other mod loader, especially Forge, but having all these unnecessary modules still kind of irks me. Fabric API is designed to be modular and there's already support in Loom for easily declaring support on individual API modules, so why not use it?
I propose commenting out that
modImplementation
line, and adding one that only depends on a singular module - sayfabric-resource-loader-v0
- along with an explanation of what the module does, why include only that module, and how to find the names of other modules you may need. Additionally, infabric.mod.json
, only declare dependencies on the modules you need.It would look something like this:
(That's a rough draft, the final comment would probably look significant different - I'm not great at writing.)
This would teach beginning modders (and also seasoned modders just getting started with Fabric) that Fabric API is not a monolith, and you can pick and choose what you need. This should be encouraged, even - you should be precise, and avoid being too liberal with your dependencies.
This would improve my experience as a modder, as a user, and as a server admin. It will not fix existing mods on its own, but it will set an important precedent for new mods, and serve as a good example for existing ones, encouraging them to switch. I believe this approach is more sustainable than letting every mod depend on the entire ever-growing Fabric API, as not every setup should require every API module to be present.
Plus it would reinforce the fact that Fabric can be a really lightweight mod loader - I love the idea of it just being used to tweak the game and optimize it and build around it. Requiring the entire Fabric API all the time kind of detracts from that, you know?
This may be a niche use case, but I think it's an important one to consider, not because you can expect most or even more than a few Fabric users to install individual API modules, but because, in general, you shouldn't over-depend.
Thanks for reading my super long post, feel free to AMA.
The text was updated successfully, but these errors were encountered: