Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

Closed
leebyron opened this issue Jun 18, 2015 · 5 comments · Fixed by #1135
Closed

Remove homogeneous collection API from records #505

leebyron opened this issue Jun 18, 2015 · 5 comments · Fixed by #1135

Comments

@leebyron
Copy link
Collaborator

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

@leebyron leebyron added the 4.0 label Jun 18, 2015
@leebyron leebyron modified the milestone: 4.0 Jun 18, 2015
@leebyron leebyron added enhancement and removed 4.0 labels Jun 18, 2015
@negativetwelve
Copy link

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

@andrinealver
Copy link

👍

@anjianshi
Copy link

I found all methods that called record.constroctor() has problem, includes merge (actully mergeIntoCollectionWith).

var R = Immutable.Record({});
var r = new R();
r.merge({});   // no problem, return "r" itself
r.merge({a: 1});  // return undefined

@AlexGalays
Copy link

Why remove them altogether though ? Record.map seems very useful for instance.

@leebyron
Copy link
Collaborator Author

leebyron commented Mar 8, 2017

Note when tackling this, ensure isImmutable() still returns true for record instances

leebyron added a commit that referenced this issue Mar 10, 2017
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
leebyron added a commit that referenced this issue Mar 10, 2017
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
leebyron added a commit that referenced this issue Mar 10, 2017
* 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
leebyron added a commit that referenced this issue Mar 10, 2017
* 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants