Skip to content
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

Google maps lazy loading #370

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jHabjanMXP
Copy link

Changes

  • created script-loader.js that gets loaded as Module object which allows loading of javascript files in header.
  • minified objectManager.min.js using minify-js.com
  • removed objectManager.js from _Host.cshtml and index.html as they're not needed anymore

Reason

  • This allows us to load all scripts dynamically (see what scripts are loaded on main page of demo app - they're loaded only when you navigate to Maps page)

Other notes

## Changes
- created script-loader.js that gets loaded as Module object which allows loading of javascript files in header.
- minified objectManager.min.js using minify-js.com
- removed objectManager.js from _Host.cshtml and index.html as they're not needed anymore

## Reason
- This allows us to load all scripts dynamically (see what scripts are loaded on main page of demo app - they're loaded only when you navigate to Maps page)

## Other notes
- server demo doesn't work - see rungwiroon#369
@valentasm1
Copy link
Collaborator

It should be optional not forced behavior.
Maybe it is possible to merge both scripts.
It looks like there will be two js scripts. Min and normal. Will it both go into nuget and in release mode publish folder?
If you make back to map page it renders script tag again, isnt it?

@Nickztar
Copy link
Contributor

I agree with @valentasm1 here. It doesn't seem great to have manually minified files here. Minifying is nice but if we want that then we should have the publish auto minify the files (I have something like this in my own project https://github.com/excubo-ag/WebCompiler).

Also agree that this shouldn't be forced. The simplest way to manage this would be to just make a new component that wraps GoogleMaps.razor and handles to loading. Could be a component in the library if that's something people would like. Seems like it shouldn't be to hard to do since thats kind of what you have done here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants