-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Restore non-enumerability of resultFields[ID_KEY]. #3544
Merged
Merged
Conversation
This file contains 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
Generated by 🚫 dangerJS |
benjamn
force-pushed
the
restore-non-enumerability-of-ID_KEY
branch
from
June 5, 2018 18:34
e92f839
to
3960163
Compare
benjamn
added a commit
that referenced
this pull request
Jun 5, 2018
Restoring non-enumerability of the ID_KEY Symbol in #3544 made ID_KEY slightly more hidden from application code, at the cost of slightly worse performance (because of Object.defineProperty), but tests were still broken because Jest now includes Symbol keys when checking object equality (even the non-enumerable ones). Fortunately, given all the previousResult refactoring that has happened in PR #3394, we no longer need to store ID_KEY properties at all, which completely side-steps the question of whether ID_KEY should be enumerable or not, and avoids any problems due to Jest including Symbol keys when checking deep equality. If we decide to bring this ID metadata back in the future, we could use a WeakMap to associate result objects with their IDs, so that we can avoid modifying the result objects.
benjamn
added a commit
that referenced
this pull request
Jun 6, 2018
Restoring non-enumerability of the ID_KEY Symbol in #3544 made ID_KEY slightly more hidden from application code, at the cost of slightly worse performance (because of Object.defineProperty), but tests were still broken because Jest now includes Symbol keys when checking object equality (even the non-enumerable ones). Fortunately, given all the previousResult refactoring that has happened in PR #3394, we no longer need to store ID_KEY properties at all, which completely side-steps the question of whether ID_KEY should be enumerable or not, and avoids any problems due to Jest including Symbol keys when checking deep equality. If we decide to bring this ID metadata back in the future, we could use a WeakMap to associate result objects with their IDs, so that we can avoid modifying the result objects.
benjamn
added a commit
that referenced
this pull request
Jun 6, 2018
Restoring non-enumerability of the ID_KEY Symbol in #3544 made ID_KEY slightly more hidden from application code, at the cost of slightly worse performance (because of Object.defineProperty), but tests were still broken because Jest now includes Symbol keys when checking object equality (even the non-enumerable ones). Fortunately, given all the previousResult refactoring that has happened in PR #3394, we no longer need to store ID_KEY properties at all, which completely side-steps the question of whether ID_KEY should be enumerable or not, and avoids any problems due to Jest including Symbol keys when checking deep equality. If we decide to bring this ID metadata back in the future, we could use a WeakMap to associate result objects with their IDs, so that we can avoid modifying the result objects.
benjamn
added a commit
that referenced
this pull request
Jun 9, 2018
Restoring non-enumerability of the ID_KEY Symbol in #3544 made ID_KEY slightly more hidden from application code, at the cost of slightly worse performance (because of Object.defineProperty), but tests were still broken because Jest now includes Symbol keys when checking object equality (even the non-enumerable ones). Fortunately, given all the previousResult refactoring that has happened in PR #3394, we no longer need to store ID_KEY properties at all, which completely side-steps the question of whether ID_KEY should be enumerable or not, and avoids any problems due to Jest including Symbol keys when checking deep equality. If we decide to bring this ID metadata back in the future, we could use a WeakMap to associate result objects with their IDs, so that we can avoid modifying the result objects.
benjamn
added a commit
that referenced
this pull request
Jun 12, 2018
Restoring non-enumerability of the ID_KEY Symbol in #3544 made ID_KEY slightly more hidden from application code, at the cost of slightly worse performance (because of Object.defineProperty), but tests were still broken because Jest now includes Symbol keys when checking object equality (even the non-enumerable ones). Fortunately, given all the previousResult refactoring that has happened in PR #3394, we no longer need to store ID_KEY properties at all, which completely side-steps the question of whether ID_KEY should be enumerable or not, and avoids any problems due to Jest including Symbol keys when checking deep equality. If we decide to bring this ID metadata back in the future, we could use a WeakMap to associate result objects with their IDs, so that we can avoid modifying the result objects.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
The change to create a simple property rather than using
Object.defineProperty
was originally made in the interest of performance, but it seems to be causing problems for some users: #3300 (comment)