-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Remove homogeneous collection API from records #505
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
Comments
I just ran into this issue and spent a while trying to debug it. Is there any way we can add this to the docs so that future developers don't spend a while debugging this issue? I'd be more than happy to make that change |
👍 |
I found all methods that called var R = Immutable.Record({});
var r = new R();
r.merge({}); // no problem, return "r" itself
r.merge({a: 1}); // return undefined |
Why remove them altogether though ? Record.map seems very useful for instance. |
Note when tackling this, ensure |
This is a breaking change refactor of Record which no longer extends a collection type and therefore does not inherit sequence methods - which was a constant source of confusion and breakage. It also refactors the internals to no longer rely on a Map, but instead a fixed size List which should result in dramatically faster performance. This is also a breaking change as `delete()` (aka `remove()`) and `clear()` are no longer available - previously these methods reverted values to their default value, now that can be done with `set(k, undefined)`. This adds a predicate function `isRecord()` and also minorly refactors related functionality such as `Seq()` constructors. Fixes #505 Fixes #286
This is a breaking change refactor of Record which no longer extends a collection type and therefore does not inherit sequence methods - which was a constant source of confusion and breakage. It also refactors the internals to no longer rely on a Map, but instead a fixed size List which should result in dramatically faster performance. This is also a breaking change as `delete()` (aka `remove()`) and `clear()` are no longer available - previously these methods reverted values to their default value, now that can be done with `set(k, undefined)`. This adds a predicate function `isRecord()` and also minorly refactors related functionality such as `Seq()` constructors. Fixes #505 Fixes #286
* RFC: Refactor Record. No longer a Collection. Faster guts. This is a breaking change refactor of Record which no longer extends a collection type and therefore does not inherit sequence methods - which was a constant source of confusion and breakage. It also refactors the internals to no longer rely on a Map, but instead a fixed size List which should result in dramatically faster performance. This is also a breaking change as `delete()` (aka `remove()`) and `clear()` are no longer available - previously these methods reverted values to their default value, now that can be done with `set(k, undefined)`. This adds a predicate function `isRecord()` and also minorly refactors related functionality such as `Seq()` constructors. Fixes #505 Fixes #286 * Add perf test
* RFC: Refactor Record. No longer a Collection. Faster guts. This is a breaking change refactor of Record which no longer extends a collection type and therefore does not inherit sequence methods - which was a constant source of confusion and breakage. It also refactors the internals to no longer rely on a Map, but instead a fixed size List which should result in dramatically faster performance. This is also a breaking change as `delete()` (aka `remove()`) and `clear()` are no longer available - previously these methods reverted values to their default value, now that can be done with `set(k, undefined)`. This adds a predicate function `isRecord()` and also minorly refactors related functionality such as `Seq()` constructors. Fixes #505 Fixes #286 * Add perf test
Records should not have the map/filter/reduce and other API methods useful for homogeneous collections like List and Map. Their operation does not do what is expected.
#220 #268
The text was updated successfully, but these errors were encountered: