-
Notifications
You must be signed in to change notification settings - Fork 40
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
Support lazy widget initialization within Marko Widgets #145
Comments
Do you have any thoughts how this would look in practice based on your experience? Maybe some sample code to illustrate the pattern? Also, are you using Lasso? |
I'm thinking a lazy loaded widget would look exactly the same as a regular widget from the standpoint of template. If the application has a list of registered, properly name-spaced widgets, Marko would check the registry when it loads the template (i think it already does this) and if the widget doesn't exist, Marko would attempt to download it. It might go something like:
I'm assuming lasso could be used to bundle the components but it wouldn't be required. Due to my lack of experience, the details of the implementation escapes me. A dialog might look like this... I'm assuming the widgets are properly bundled according to project needs. For instance a dialog bundle might include multiple widgets. But a widget located on a CDN might look like this Configuration could be passed of course |
One problem I've encountered in the past is optimizing so that you aren't loading code you already have. For instance we wouldn't need to include Marko and jQuery since we already have those. |
Looking for a modular approach to loading Marko widgets from the file server.
The thought is that some portions of your app may never be needed. Things like dialogs, detail views, shopping carts. It would make sense to not include those in the initial site load.
The text was updated successfully, but these errors were encountered: