openstreetmap / iD

🆔 The easy-to-use OpenStreetMap editor in JavaScript.
https://www.openstreetmap.org/edit?editor=id
ISC License
3.38k stars 1.22k forks source link

Split the repo into several dependencies #4822

Open GuillaumeAmat opened 6 years ago

GuillaumeAmat commented 6 years ago

Hi there!

As web developers committed into the osm world for several years, my friends and I would like to discuss about the architecture of the iD repository.

Our first concern is the reusability of the code. You all did an amazing work on that tool but it is self-contained and unusable in other projects.

Eg: the osm module, the data sources, etc.

Can you consider to split the main repo into several targeted repos to able us to use it as dependencies in our projects and in iD?

That way we could all contribute to the same data and code rather than duplicate efforts...

Can't wait to read you ;)

bhousel commented 6 years ago

This is a great idea, and I'd like to do this too whenever we make an iD v3. Hope you understand that it's a low priority right now, below shipping features that matter to our users.

@kepta had started some work on this, but it's a hard problem. Many of the components of iD depend on each other, so although we have the code organized into modules, they aren't really separate.

In the meantime, you can require iD in another project as a dependency and use the pieces of it that we export. A bundler like Rollup.js should be able to include only the parts of iD that you are using.

A really simple and silly example of this is id-area-keys, which depends on all of iD just to import a single .json file and process it.

kepta commented 6 years ago

I managed to extract the id-presets part, you can find the repository here. Please note it is experimental, but all the test cases from the main iD work.

GuillaumeAmat commented 6 years ago

@bhousel I totally understand the low priority. In the meantime, we have started a new project for our needs and will use your advice thank you ;)

bhousel commented 6 years ago

@bhousel I totally understand the low priority. In the meantime, we have started a new project for our needs and will use your advice thank you ;)

Sure- by the way do you want to move your projects into the osmlab organization? It might be more visible that way, and I'm happy to grant you access to do that.

GuillaumeAmat commented 6 years ago

Great! Would you accept to add the 2 other repositories of the organization too? I'm talking about osmose-request et leaflet-nectarivore (wip).

What's the policy of osmlab?

pnorman commented 6 years ago

https://gist.github.com/tmcw/5157262 is the osmlab policy.

Basically, it's like SVN used to be - no real ownership, but you probably want to talk to others active in a repo before merging stuff. If you have a project with a strong notion of maintainers, it's not the right place, but if you're releasing something out there to the development community, it's a reasonable option.

GuillaumeAmat commented 6 years ago

'kay thank you @pnorman. It seems that it fits with our needs. Can you add me to the organization?

cc @bhousel @kepta

bhousel commented 6 years ago

ok @GuillaumeAmat you should have an invite waiting for you 👍

GuillaumeAmat commented 6 years ago

Got it! Thanks ;)

quincylvania commented 5 years ago

Part of #6483.