OpenStreetMap 로고 OpenStreetMap

iD with modules 🔜

tmcw님이 English로 2016년 8월 24일에 게시함.

There’s long been a desire & incoming wish for iD to be modular. Modular is a pretty general term, so I’ll narrow it down into three general goals:

  1. Modules as a way of building a system. Using rollup, browserify, etc., in order to structure code and separate internal components in a nice, predictable way.
  2. Modules as a way of letting other systems include yours. Generally, in JavaScript-land, means publishing to npm.
  3. Modules as ways to include new code in your project. This is more in the vein of iD plugins. Supporting plugins would let us support contentious or rare needs without bikeshedding their inclusion to the main project.

With the help of Bryan, Kushan, David, Beau and Martin, we’ve made significant progress toward the first goal and are nearly at the finish line. iD will be switching from a system where we concatenate source files and use GNU make as a build process - to one that uses rollupjs to build a bundle from JavaScript modules. The expected benefits are big, for maintainers:

  • iD no longer relies on the global namespace for dependencies like d3, so there’s less chance for conflict.
  • misnamed requires or invalid requires will be caught early
  • we can use npm modules for our dependencies, rather than keeping them in the project’s source tree
  • we’ll be able to build a faster and more reliable environment for development
  • we’re upgrading d3 to v4, keeping it in line with the changing software world.

This doesn’t immediately win us (2) and (3) but it pulls them closer. Soon, a new editor could reuse iD’s data model, and iD could load new functionality from a plugin.

And there likely won’t be any user-facing change as part of this port. This is the stage where the developers throw tens of hours into the low-level guts so that plugins can be possible and long-term maintenance can be less painful.


Bryan and I are working on the final steps of this modularization. I’ll take some time to land: this is a major refactoring of a large project with a lot of functionality, so it involves a huge amount of work and has many opportunities to introduce regressions. We ask for your patience and/or support during this time.

Once we’ve ensured that the refactored iD is just as good, then it’ll be the future, and we’ll be excited to keep moving toward a more interchangeable stack of tools for OSM.

위치: Logan Circle/Shaw, Ward 2, Washington, District of Columbia, United States
이메일 아이콘 Bluesky 아이콘 Facebook 아이콘 LinkedIn 아이콘 마스토돈 아이콘 텔레그램 아이콘 X 아이콘

토론

2016년 8월 24일 19:32iandees님의 의견

This is great, thanks for all the work making these changes!

2016년 8월 24일 19:40PlaneMad님의 의견

Plugins! The future is looking bright, thanks for all the hard work Tom, Bryan, Kushan, David, Beau and Martin + a whole lot of others.

2016년 9월 1일 20:34nateirwin님의 의견

Pretty excited about this!

2016년 9월 3일 04:03DenisCarriere님의 의견

Awesome to hear!

2016년 11월 30일 12:50Claudius Henrichs님의 의견

Great to see these efforts now landing in 2.0. Looking forward to all the enhancements building on top of it that will arrive over the next months. Thanks for all your work “team modular”

댓글을 남기려면 로그인하세요