-
Notifications
You must be signed in to change notification settings - Fork 12k
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
UpdateRecorder should support multiple adjacent inserts #21110
Comments
Due to my limited understanding of the context of the UpdateRecorder I don't know if my solution suggestion is valid. One way to do this, would be to track all changes in a list without mutating the original. When calling apply(), all changes are applied sequentially, sorted descending by index. A naive implementation: |
Updated the StackBlitz example to use jasmine: |
So, I've been looking at the UpdateBuffer spec and I have to admit I don't understand the requirements. Is this complexity really required? |
@kyubisation, I don't think this complexity is strictly required. We do recommend using |
That's fine with me. |
I think we would probably accept a PR as it is something which should work and is a legitimate bug. The existence and recommendation of I think I'll leave the issue open just because it is a real issue that should be fixed eventually (whether with a direct fix or a switch to |
I have implemented a PR, switching usage of UpdateBuffer to magic-string: #21209 |
…ring This PR adds UpdateBuffer2 which should eventually replace UpdateBuffer. UpdateBuffer2 internally uses the magic-string library. UpdateBuffer and related symbols have been marked as deprecated. Closes #21110
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
🐞 Bug report
Command (mark with an
x
)Is this a regression?
No
Description
From #20190.
UpdateRecorder
doesn't support multiple adjacent inserts.🔬 Minimal Reproduction
Anything else relevant?
Best workaround is probably to use something more comprehensive like
magic-string
, but that probably shouldn't be required for something this simple.The text was updated successfully, but these errors were encountered: