-
Notifications
You must be signed in to change notification settings - Fork 143
ImmutableJS dependency #213
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've just put everything that goes into the compiled build under I'd be all for letting users switch out the version of Immutable. Any On Saturday, February 13, 2016, Raul Matei [email protected] wrote:
|
I've had a look on this, externalizing ImmutableJS it's easy but it implies some other changes:
I haven't tested anything related to Bower, and since I'm not using it in my projects I can't really say what should be changed to make sure it works, but I assume that ImmutableJS has to be added into Users that will use the UMD build with I worked on those changes on a NuclearJS fork. You can review the changes here: https://github.com/raulmatei/nuclear-js/commits/raulmatei/remove-immutable-js-dependency . I'll only start a Pull Request when everything is clear and all tests pass. Hot-reloading example Feel free to comment on this. Raul. |
Awesome. I'll take a closer look this week But it'd be happy to merge these improvements into Nucear On Monday, February 15, 2016, Raul Matei [email protected] wrote:
|
Sounds good. In the mean time I've found the issue with the failing test. You've mentioned in #191 that Reactor cannot be called without Although I understand why And the code it's here even if it's not NuclearJS related, the behavior is the same. Removing The question is, should Store & Reactor work without Raul. |
Yeah this is really annoying. It's something Babel complains about when you I agree that we probably want to move forward with the semantic new, We can include this and the new caching changes for a 2.0 version :) On Monday, February 15, 2016, Raul Matei [email protected] wrote:
|
I agree, those are breaking changes. On the other hand, I might try to externalize ImmutableJS with the current configuration (dev dependencies) but only if it makes it as a minor release, otherwise if it will only be released as a part of v2.0 it doesn't make sense to waste time with it and I'll continue on my fork with the changes listed above, including removing the factory wrapper. Would it make sense to expose factories for creating stores and Reactor instances? E.g.: import { createReactor, createStore, toImmutable } from 'nuclear-js';
import * as ActionTypes from './action-types';
const reactor = createReactor({ debug: true });
function increment(state, payload) {
return state.set('count', state.get('count') + 1);
}
function decrement(state, payload) {
return state.set('count', state.get('count') - 1);
}
const counter = createStore({
getInitialState() {
return toImmutable({ count: 0 })
},
initialize() {
this.on(ActionTypes.INCREMENT, increment);
this.on(ActionTypes.DECREMENT, decrement);
}
});
// or createStore can take 2 arguments initialState (a plain JavaScript data type that
// gets converted to a Immutable structure under the hood) and an object
// containing all store handlers, e.g.:
//
// const INITIAL_STATE = { counter: 0 }
//
// createStore(INITIAL_STATE, {
// [ActionTypes.INCREMENT]: increment,
// [ActionTypes.DECREMENT]: decrement
// });
reactor.registerStores({ counter }) It solves the Raul. |
I think we can close this one. |
Hi,
Is there any reason why ImmutableJS is in
"dependencies"
and not in"devDependencies"
+"peerDependencies"
?I think there will be no issue with upgrading to the latest version and probably remove the
Immutable
fromsrc/main
export, and let developers manage the ImmutableJS dependency.Any thoughts?
Raul.
The text was updated successfully, but these errors were encountered: