-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Fetch frequently updated resources instead of bundling them #4994
Comments
`npm install` may refuse to work if it finds the `editor-layer-index/.git` folder
I'm going to do this now that the iD bundle has gotten big and builds are slow. beforeI've added a |
I removed the name-suggestion-index brand data today partially - we can fetch these from the CDN as well. When I say partially - we were bundling NSI brand data just for the outdated_tags validation. Now that it's not bundled, we can run the tests with very minimal data - our tests run significantly faster now! We are still using the NSI brands to generate presets, and these end up in iD.js is now 7.69mb, of which 4.15mb is bundled data. |
Not bundled data, but today I also worked on getting rid that big turf-jsts box. |
This comment reminded me of some projects, such as POSM, that use iD in a more or less offline scenario (wrt fetching presets from some CDN). I'm wondering if there will be some easy way for those projects to override |
Yes, I wrote it so people can change the file map if they want to.. Thinking more about this, it might also be useful to record the version number and a link, so we can have some place in the app where people can see what versions of stuff that iD is using. |
@bhousel what are the blockers for having editor-layer-index update more frequently? Can it not just pull directly from |
If we did that, any broken build would break imagery for everyone. |
I don't mean to take this off topic, if there is another issue discussing this, happy to move it there. It would be nice to see some more details about what's planned by iD. I volunteer a lot of time and effort to help curate the editor-layer-index, the community is already fragmented with JOSM maintaining their own imagery index separate to editor-layer-index, so naturally if there's issues with editor-layer-index preventing it being ideal for iD please open a ticket on editor-layer-index I'd be more than happy try and help out. |
Today I finished moving the presets data external. Wow! The iD.js bundle picture has really changed: iD.js is now 5.35mb, of which 1.8mb is bundled data. We are finally mostly bundling actual source code. I will try to trim down the dependencies and whatever bundled data remains. The rest is mostly the English language strings. The changes to the preset system have probably introduced some bugs, so I'll be testing a lot the next few days. #6840 and #6664 are related and I'll close them somehow. At some point it would be nice to move the presets external into their own repo like the other data that iD depends on. This is #7130 and #2656. We now have name-suggestion-index and osm-community-index running smoothly so I'd probably do it similar. |
We already did have an ELI issue for this (osmlab/editor-layer-index#214, which I mention above as a blocker), and I submitted a PR to fix that and all the other issues with ELI that we have (osmlab/editor-layer-index#490) and nobody wanted it. This was like 2 years ago. If we do end up making a replacement imagery index, I'd definitely welcome your help on it. |
It's funny how we all want to kill ELI in the end :). I'd like to do two things this year:
I don't want to hijack this ticket, so further discussion can happen on the ELI tracker if it isn't wanted here. |
It's not that I want to kill it, but it's more that I don't think we're very well aligned on what we need it to do. This is Open Source, and I've tried fixing the problems with a PR, but at this point there is no use complaining about it when I could just make a thing that works better for us.
I think people should work under the assumption that master branch will get broken sometimes. I think doing actual releases with semantic version numbers is a good thing for anyone who sits downstream from your project.
Fetching all the imagery isn't really a problem that we have. The complete
Yeah, I feel like we've been through this already. Let's keep this ticket just about trimming the data from the iD bundle. |
coreData now owns all the data, and data/index.js should eventually go away (re: #4994)
Today I finally removed the last data bundled from iD - the locale data and English strings. The bundle picture for iD has shrunk considerably! 🎉
I'm going to close this for now - happy with how it turned out 💪 |
@bhousel Awesome! This will make iD so much nimbler for everyone—developers through faster build times and swappable data, mappers through smaller download sizes and more-frequent data updates. Yet another great step toward modular iD 🤙 |
Replacing editor-layer-index being tracked on #7425 🎉 |
@bhousel how did you this stats images? |
iD bundles a few dependencies from other projects:
That means that sometimes these other projects will receive updates, but users of iD will not get to see the update until the next time I release a new version of iD.
It would be great if we can figure out a way to have the released iD on openstreetmap.org pull in more recent data from these other projects.
I could do this today for osm-community-index. This is because that project has releases that follow semantic versioning and are published to npm. We could always fetch the "latest" patch version from the unpkg CDN and know that it shouldn't break anything. We could also fallback to loading a local version if for some reason the CDN doesn't respond.
I could probably do this for name-suggestion-index, but it's a little more complicated because the data in that index needs some processing to turn the results into presets. So it would be, fetch the name suggestion file and then patch in the suggestion presets in the first few seconds while the user is using iD. It would be weird but might work.
I can't do this for editor-layer-index unless we do Start versioning the repo and output osmlab/editor-layer-index#214
I can't really update the translations, because these resources are linked to the current code in
master
branch. However it's worth mentioning that if we do find a way to pull in a more recent community index, it would be useful to pull in the translations that go with it. It's complicated.See also #4019 #3591
Update: Also this blog about fetching a bunch of small files is the way to go in modern HTTP/2 capable browsers.
The text was updated successfully, but these errors were encountered: