You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As of #109, the parking lots JSON file is now 3.3 MB when built with Parcel. That's pretty big for users with slow Internet and mobile.
We can improve this by instead only loading the data for each city when it's relevant. We'll use something like Parcel's glob mechanism (https://parceljs.org/features/dependency-resolution/#glob-specifiers) and JavaScript's dynamic await imports to only load the city when it's in view.
There are two cases for that:
The city is explicitly selected via the URL or city toggle, which calls this function:
Eric-Arellano
changed the title
Consider lazily loading parking lot data only when the city is used
Lazily load parking lot data only when the city is used
Aug 10, 2023
As of #109, the parking lots JSON file is now 3.3 MB when built with Parcel. That's pretty big for users with slow Internet and mobile.
We can improve this by instead only loading the data for each city when it's relevant. We'll use something like Parcel's glob mechanism (https://parceljs.org/features/dependency-resolution/#glob-specifiers) and JavaScript's dynamic
await import
s to only load the city when it's in view.There are two cases for that:
parking-lot-map/src/js/setUpSite.js
Line 180 in 5eac44d
The text was updated successfully, but these errors were encountered: