-
-
Notifications
You must be signed in to change notification settings - Fork 21.6k
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
Exclude unexposed classes from the extension_api.json
#80852
Exclude unexposed classes from the extension_api.json
#80852
Conversation
25adcee
to
c73135b
Compare
I think this would resolve this FIXME in
(those two files can be listed among the others which were intentionally unexposed) See also:
The same check may be needed in other places, such as the EditorHelp, or GDScript code completion. I'm still unclear on when we want a class to be registered in ClassDB, but not exposed. I wonder if those are indeed meant to be skipped as done here, or whether they should not be in ClassDB in the first place. I guess their existence in ClassDB comes from using |
An unexposed class is a class that has Personally, I think it makes sense for all classes descending from However, for the purposes of this PR, I don't think we need to figure out if these specific classes should have used |
c73135b
to
39a604c
Compare
In my latest push, I've removed the "Misc" section and moved those down to be included with the other unexposed classes that are removed via this PR. Until we update the |
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.
Those GLTF classes are indeed internal and do not need to be exposed at all.
extension_api.json
Thanks! |
We've discuss this a bit, and it seems it's better to avoid cherry-picking this. While absolutely beneficial, it does introduce a change to the dumped API, and because of that to our compatibility checker. The changes here would make |
@Bromeon noticed that
GDScriptNativeClass
was included in theextension_api.json
but that it wasn't possible to actually get that class at runtime. Looking at the code, it appears thatGDScriptNativeClass
isn't exposed (ie. there's noGDREGISTER_CLASS(GDScriptNativeClass)
anywhere).This PR adds a
ClassDB::is_class_exposed()
check inGDExtensionAPIDump::generate_extension_api()
to ensure that unexposed classes aren't included in theextension_api.json
.Up until now, I think unexposed classes were mostly not included in the
extension_api.json
by accident: most simply weren't inClassDB
by the time that we were generating theextension_api.json
.Aside from
GDScriptNativeClass
, this change also removes the following other unexposed classes (at least for me - I did a diff of theextension_api.json
with and without this PR):FramebufferCacheRD
GDScriptEditorTranslationParserPlugin
GLTFDocumentExtensionPhysics
GLTFDocumentExtensionTextureWebP
GodotPhysicsServer2D
GodotPhysicsServer3D
IPUnix
MovieWriterMJPEG
MovieWriterPNGWAV
ResourceFormatImporterSaver
UniformSetCacheRD
I'm not familiar with all of these classes, but I think they are all meant to be internal, and not interacted with directly.