Repository navigation
fix: preserve removed drafts with optimized array methods - #1349
Open
jipeng6036-del wants to merge 1 commit into
Open
jipeng6036-del wants to merge 1 commit into
jipeng6036-del wants to merge 1 commit into
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
With
enableArrayMethods(), a recipe that moves an object between lists and then updates it can mutate the original state, or throw when the base is frozen:Read only the removed element through the existing draft proxy before optimized
pop/shift. Use the normal proxy path forsplice, preserving removed drafts, native argument coercion and sparse-array behavior. Newly inserted external objects keep their existing undrafted behavior.spliceconsequently has the standard proxy cost;pop/shiftretain their internal-copy optimization. The documentation makes that tradeoff explicit.Validation:
yarn test(4,244 source and 3,693 production tests pass; 8 skips in each), Flow, coverage and all four existing performance scripts passed. The unchanged fork Test workflow also passed on this commit.npm packartifacts: 102 public CJS/ESM checks pass across Windows/Linux; baseline defects reproduce. These are local artifacts, not a registry release.Reproduction, exact artifacts, independent checks and size/performance limitations. The size tool needed a size-only OpenSSL compatibility option; the original failed measurements are retained separately.
Prepared and validated with Codex.