-
Notifications
You must be signed in to change notification settings - Fork 424
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
Add Dev Module #4087
base: 1.21.1
Are you sure you want to change the base?
Add Dev Module #4087
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please make sure it also builds.
fabric-api-dev/src/main/java/net/fabricmc/fabric/FabricDev.java
Outdated
Show resolved
Hide resolved
fabric-api-dev/src/main/java/net/fabricmc/fabric/FabricDev.java
Outdated
Show resolved
Hide resolved
fabric-api-dev/src/main/java/net/fabricmc/fabric/mixin/dev/ArgumentTypesMixin.java
Outdated
Show resolved
Hide resolved
fabric-api-dev/src/main/java/net/fabricmc/fabric/mixin/dev/ArgumentTypesMixin.java
Outdated
Show resolved
Hide resolved
fabric-api-dev/src/main/java/net/fabricmc/fabric/FabricDev.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
None of these should be enabled by default imo.
fabric-api-dev/src/main/java/net/fabricmc/fabric/impl/FabricDevProperties.java
Outdated
Show resolved
Hide resolved
fabric-api-dev/src/main/java/net/fabricmc/fabric/mixin/dev/BlockAndItemMixin.java
Outdated
Show resolved
Hide resolved
fabric-api-dev/src/main/java/net/fabricmc/fabric/impl/FabricDevProperties.java
Outdated
Show resolved
Hide resolved
fabric-api-dev/src/main/java/net/fabricmc/fabric/impl/FabricDevProperties.java
Outdated
Show resolved
Hide resolved
fabric-api-dev/src/main/java/net/fabricmc/fabric/impl/FabricDevProperties.java
Outdated
Show resolved
Hide resolved
@@ -14,6 +14,7 @@ include 'fabric-api-bom' | |||
include 'fabric-api-catalog' | |||
|
|||
include 'fabric-api-base' | |||
include 'fabric-api-dev' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be set as a dev only module, and not included in the prod jar.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason it's included in prod is since some developers requested that they would be able to use it outside of dev envs to be debugging in prod easier
fabric-api-dev/src/main/java/net/fabricmc/fabric/impl/FabricDevProperties.java
Outdated
Show resolved
Hide resolved
fabric-api-dev/src/main/java/net/fabricmc/fabric/impl/FabricDevProperties.java
Outdated
Show resolved
Hide resolved
* Default value: true</br> | ||
* {@link CommandManager#execute(ParseResults, String)} | ||
*/ | ||
public static final boolean ENABLE_COMMAND_EXCEPTION_LOGGING = getProperty("enableCommandExceptionLogging", true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if these should be named such as fabric.dev.command.logging.exception
(with all of the others following the same pattern?
fabric-api-dev/src/main/java/net/fabricmc/fabric/api/dev/v1/FabricDevProperties.java
Show resolved
Hide resolved
Hi, sorry for not taking a look at this PR in a while, please don't heasiate to ask me to look at PRs its impossible for me to check them all. If you need to ask me multiple times please do. I worry that very few people will opt into these features, most of whitch are some additional logging that may not always be useful to someone other than Mojang. Warnings that we log we need to be 100% sure that they are important otherwise developers will just start ingoring them all. If its bad enough that it should never happen we should crash the game instead. We already enable the most useful features that are locked behind The module name also doesnt feel right as well, I think it maybe should include Before you spend anymore time on this lets discuss this and get input from others to see what they think, I think we need to strongly consider if this is in scope, adding a new sub-module has a none zero peformance cost let alone the maintaince this module will require on updates (its unlikely people are going to search for new usages of |
An alternative could be that we enable more things by default, this is gonna be a bit subjective, so it would require some conversations to see what exactly people feel should be enabled by default, but for a start i think the following are good:
|
I dont think there is a perfect solution either way, some people want these additional checks enabled, others dont care. I think the better of the two evils is having them disabled by default. I do worry having too many warnings will make people ingore them all. Again this is likely out of scope but having a way for these warnings to crash the game might nice, this way a project such as Fabric API can ensure that the warnings never happen again.
|
Some of these should absolutely be enabled by default, such as Additionally, there are some other things that could be useful in the dev module that Mojang doesn't have, like fixing the server watchdog to not crash after being stopped at a breakpoint. |
This can be done in the command module.
I think this was discussed, and we agreed it was a good idea but couldnt come to a solid way to do it. Can be done in the crash reports module. |
Making the warnings crash wouldn't be a bad idea As for exception pausing it's useful as you can go down the stacktrace whenever a exception is thrown with it and see exactly what every variable or field is set to while the error was thrown |
But you can do this by setting a breakpoint on the exception its self, without needing to place a breakpoint in a weird location. |
Sure, but now your needing to place a breakpoint at multiple different exceptions rather than just a single breakpoint in the Util class |
Also adds properties for enabling certain things controlled by SharedConstants.isDevelopment so developers can pick and choose what they want to enable instead of everything being enabled