-
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
More modular fields code #3914
Comments
@bhousel I really like the idea. After working on #3822 I realised we definitely need something like this. |
This is amazing @bhousel !! |
Done in #4214 😄 |
We should probably improve how we handle fields in the iD codebase. This is something that @kepta and I were talking about recently.
All of our fields are currently written in a way that you can't just create a field, it's expected that presets "own" fields. The problem with this is when we want to create a special field inside some other field, the only way to do this is to duplicate a lot of code.
This impacts the bridge/tunnel radio field #3911 and @kepta's lane editor #3822, and whatever other "advanced" fields we want to create. In the case of the #3911, just to add a "Type" combo, I had to copy over a lot of the code from
combo.js
. This code duplication adds a bunch of technical debt, and we should clean it up once we find a better way.We can probably fix this by splitting this
UIField
constructor (factory?) out into its own module, making sure to account for all the preset closure variables that it depends on (e.g. it should have its owndispatch
, etc). We might be able to do this without a major semver bump.The text was updated successfully, but these errors were encountered: