-
Notifications
You must be signed in to change notification settings - Fork 15
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
Inner class name conflict with other plugins #4
Labels
bug
Something isn't working
Comments
Now there's another reason for me to avoid Personally, I prefer the approach of adding underscore prefix. Thanks for the bug report! |
lihop
added a commit
to lihop/gd-plug
that referenced
this issue
Jun 27, 2021
Fixes class name conflict with the [ThreadPool plugin](https://github.com/zmarcos/godothreadpool) and reduces the likelyhood of class name conflicts with other plugins. The underscore prefix also indicates that these classes are "private" (intended for internal use by gd-plug) and not part of the public gd-plug API. Closes imjp94#4
lihop
added a commit
to lihop/gd-plug
that referenced
this issue
Jun 27, 2021
Fixes class name conflict with the [ThreadPool plugin](https://github.com/zmarcos/godothreadpool) and reduces the likelyhood of class name conflicts with other plugins. The underscore prefix also indicates that these classes are "private" (intended for internal use by gd-plug) and not part of the public gd-plug API. Closes imjp94#4
imjp94
pushed a commit
that referenced
this issue
Jun 29, 2021
Fixes class name conflict with the [ThreadPool plugin](https://github.com/zmarcos/godothreadpool) and reduces the likelyhood of class name conflicts with other plugins. The underscore prefix also indicates that these classes are "private" (intended for internal use by gd-plug) and not part of the public gd-plug API. Closes #4
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
After installing and enabling the ThreadPool plugin with the following
plug.gd
:Future invocations of the
plug.gd
script fail with the error messages:This is because the ThreadPool plugin declares the unique global class here:
which conflicts with gd-plug's inner class:
gd-plug/addons/gd-plug/plug.gd
Line 832 in 83cd8f5
I can also see the potential for conflict with gd-plug's other inner classes.
Logger
with some logging related plugin, and (maybe less likely)GitExecutable
with some git related plugin.More widely, this is related to github proposal #1566 Implement namespaces to avoid collisions in third-party add-ons. A suggested workaround there is to add a prefix to class names.
Some ideas (assuming these inner classes are for private use only and not part of the pubilc gd-plug API):
ThreadPool
->GDPlugThreadPool
Logger
->GDPlugLogger
GitExecutable
->GDPlugGitExecutable
This is a little ugly but least-likely to conflict with other plugins.
ThreadPool
->_ThreadPool
Logger
->_Logger
GitExecutable
->_GitExecutable
This marks the inner classes as private and keeps the pretty names. It shouldn't be too likely that these conflict with other plugins, but who knows. Perhaps another plugin developer might declare
class_name _Logger
orclass_name _ThreadPool
for whatever reason.The text was updated successfully, but these errors were encountered: