-
-
Notifications
You must be signed in to change notification settings - Fork 127
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
Make the Application
fully composable
#705
base: main
Are you sure you want to change the base?
Conversation
5c89d1f
to
d722a13
Compare
@@ -39,7 +39,7 @@ export { type IPlugin }; | |||
* UI applications with the ability to be safely extended by third | |||
* party code via plugins. | |||
*/ | |||
export class Application<T extends Widget = Widget> { | |||
export class Application<T extends Widget | HTMLElement = Widget> { |
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.
Just to have the full picture here, and to provide more context for the future when looking back at that PR.
The main purpose for allowing an HTMLElement
directly would be for apps reusing the Lumino plugin system to not have to depend on @lumino/widgets
to instantiate a placeholder shell widget, for example like in the following example?
lumino/packages/application/tests/src/index.spec.ts
Lines 21 to 24 in 0fb17ae
const shell = new Widget(); | |
const app = new Application({ | |
shell | |
}); |
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.
Yes, although that the ContextMenu
API is preventing to make @lumino/widgets
an optional dependency;
lumino/packages/application/src/index.ts
Line 70 in 0fb17ae
readonly contextMenu: ContextMenu; |
This follows the extraction of the plugin logic #703 to make the
Application
fully composable.It also reduces the constrain on the shell to be a raw html element. The reason to remove the
Widget
constrains is to allow other frameworks to be used with the Lumino Application without using the widgets framework (as the context menu can be switched to a custom one).