-
Notifications
You must be signed in to change notification settings - Fork 145
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
Draft of how widgets could be organized #8035
Conversation
I don't know how many widgets we'd like to defer loading on, but something like completion that has to be activated and which also has to fetch completion data might as well be deferred. I'd assume the deferred JS is quickly loaded on subsequent page loads anyways :D |
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.
Small nits.
), | ||
]; | ||
|
||
Future<void> setupWidgets() async { |
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.
setupWidgets
became asynchronous, but in script.dart
we still call it as a sync method, no indication that the future is not awaited.
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'm making it void
because I don't want people to await it :D
setupWidgets
does what it does, you don't need to know if it failed, it'll report errors in console.
Let's do separate packages only when we want to publish them (or have other compelling reasons for them).
I think that should be the case, at least I haven't seen anything else to the contrary. |
Also: needs to update the size check (which is nice as we know that the deferred loading works!). |
This also makes widget loading a deferred, or at-least offers the option.
It's possible we should do a
pkg/web_widget/
package and put all widgets in there.Then maybe, move
app/lib/frontend/dom/dom.dart
into apkg/html_as_code/
package.Or we could choose to only organize into packages in the cases where we want to publish.
Do we really have much motivation to use different versions of libraries on the server and in the client. I suspect this was mostly relevant when pana and dartdoc were fully embedded in the server.
We currently only use
dartdoc
as a subprocess, and there could be a future wherepana
isn't embedded any. We'd need to formalize the data structures a bit, but keeping pana is probably not so bad 🤣