Skip to content
This repository has been archived by the owner on Feb 19, 2022. It is now read-only.

Add support to use immutable.js data structures #51

Open
JustFly1984 opened this issue May 11, 2017 · 13 comments
Open

Add support to use immutable.js data structures #51

JustFly1984 opened this issue May 11, 2017 · 13 comments

Comments

@JustFly1984
Copy link

JustFly1984 commented May 11, 2017

Currently All my projects using redux with immutable.js instead of Object.assign approach.

If you do not mind, I could help you and make a pull request of immutable.js lib usage for better performance and all goods which comes with immutability.

@JustFly1984
Copy link
Author

JustFly1984 commented May 12, 2017

I give up, cos there is no possible way to use freactal with immutable.js

Whole idea of freactal is great, but when it comes to performance, I choose immutable.js on top of redux.

It looks like freactal need complete rewrite to support immutable data types. It is really sad, cos I do not have time to do that.

@JustFly1984
Copy link
Author

Object.assign({}, ... creates new object, which is kind of good, if you do not want to mutate, but Garbage Collector will do it's dirty work each state is update.
In my case I can't afford GC, and this is why I'm stuck with immutable.js

After fast lookup into freact source code, I see the MAGIC under the hood and it just doesn't feels right for me.

@JustFly1984 JustFly1984 changed the title Add documentation to use immutable.js Add support to use immutable.js data structures May 12, 2017
@JustFly1984
Copy link
Author

Please, put some mention in docs, that there is no support for immutable.js, so people save time.

@everdimension
Copy link
Contributor

@JustFly1984

In my case I can't afford GC, and this is why I'm stuck with immutable.js

I don't get this argument. Immutable.js does basically the same thing that Object.assign({}, /* ... */) does, but with arguably more convenient syntax.

What is it exactly that you couldn't do with this library by using Immutable?

@divmain
Copy link
Contributor

divmain commented May 23, 2017

@everdimension is correct - there should be no measurable performance difference between the two approaches. And, in fact, you could use Immutable.js for everything aside from the top-level state container. However, I'll leave this issue open until I decide how I want to address this in the docs. I'm moving to gitbook-style documentation, so it's not an immediate fix.

@divmain divmain added the docs label May 23, 2017
@tomisme
Copy link

tomisme commented Jun 29, 2017

there should be no measurable performance difference between the two approaches

Immutable uses structual sharing for some significant performance improvements over Object.assign (for large collections).

@JustFly1984
Copy link
Author

JustFly1984 commented Jun 29, 2017 via email

@divmain
Copy link
Contributor

divmain commented Jun 29, 2017

Alright, I'm convinced. I'm going to look into what it would take for the data-store to be pluggable, allowing the dev to use the default, immutable.js, or some other alternative.

@divmain divmain added enhancement and removed docs labels Jun 29, 2017
@JustFly1984
Copy link
Author

Can't wait to see your progress)

@JustFly1984
Copy link
Author

I wanna give you heads up. There is an article: https://medium.com/azendoo-team/immutable-record-react-redux-99f389ed676

Current issue I'm experiencing, that it is not possible to use Immutable.Record as rootReducer initialState with redux-immutable combineReducers. Can you please think through an Idea to have Immutable.Record as main initialState? It has very nice API which is very close to native JS API.

@JustFly1984
Copy link
Author

Do you have any updates on this issue? I'm eager to try it out in my next project.

@ryan-roemer
Copy link
Member

@JustFly1984 -- Can you open up a minimal repository with a sample app that uses Immutable the way you'd like to with freactal so we have something easy and tangible to work with as we develop out support for immutable?

If you're up for this, please also provide install, build, and dev instructions that so that we can make sure we're on the same page for supporting your use case. Thanks!

@JustFly1984
Copy link
Author

JustFly1984 commented Oct 26, 2017 via email

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants