-
Notifications
You must be signed in to change notification settings - Fork 2.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
Throw an error when a used source is removed and not readded #5562
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the aim of simplicity and consistency with native, I don't think we should support the "temporarily remove an in use source" case. If you attempt to remove an in use source, it should immediately produce an error.
@jfirebaugh I simplified per your feedback. I prefer this way but it may cause headaches for some users relying on the edge case. What do you think about using a warning & deprecation notice rather than an error? |
Signal the error via Secondarily, I favor making the change now to return immediately in the error case (i.e. not removing the layer), but if you want to delay making that change for a release or two that's ok too. Let's leave the issue open if you do though. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Congrats on the first PR after a while!
✅ I made the suggested changes to the error handling flow. We'll should come back to this file and get rid of existing uses of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💯
Currently, the below code does not throw an error. Instead it quietly fails to render
mapbox-layer
.This PR causes an error to be fired in the above case while still allowing the below case where a source is removed and then re-added before the next call to
Style#update
fixes #1711
Launch Checklist