Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop alt-resolver use AltIso.render #68

Closed
2 of 3 tasks
iam4x opened this issue Jun 4, 2015 · 6 comments
Closed
2 of 3 tasks

Drop alt-resolver use AltIso.render #68

iam4x opened this issue Jun 4, 2015 · 6 comments
Assignees

Comments

@iam4x
Copy link
Owner

iam4x commented Jun 4, 2015

goatslacker/alt@4cf98e3

  • Drop alt instances, come back to singleton!
  • Rewrite async actions with datasources from alt (http://alt.js.org/docs/async/)
  • Use AltIso.render helper

馃帀

@iam4x iam4x self-assigned this Jun 4, 2015
@quicksnap
Copy link
Contributor

Think rewriting with datasources could be done independently of other tasks? I might be able to help out if so. Looking to cut my teeth on some Alt stuff; thinking of switching over to it.

@iam4x
Copy link
Owner Author

iam4x commented Jun 18, 2015

@quicksnap We can't use datasource with the current alt-resolver made for the boilerplate, these tasks need to be done together.

I'll start a new branch with react-router@1.0-beta and try to merge with new IsoRender from Alt, maybe it will work. For now I can't make them work together.

@jonaswindey
Copy link

I'm looking at the 'use-alt-for-render' branch. Do you have any idea what's going wrong with the router? It seems you can only switch page once, and then the router stops working.

I tried stripping out some datasources-related stuff but can't get it to work.

I'm looking at https://github.com/goatslacker/iso/tree/master/examples/react-router-flux to see what could be the difference.

@jonaswindey
Copy link

I think I found it,

in main.js

Router.run(
  routes,
  Router.HistoryLocation,
  (Handler) => AltIso.render(alt, Handler)
);

Should become:

Iso.bootstrap(function (state, _, container) {
  alt.bootstrap(state);

  Router.run(
    routes, 
    Router.HistoryLocation, 
    (Handler) => {
        var node = React.createElement(Handler);
        React.render(node, container);
  });
});

Although it only works when putting
@AltIso.define(() => UsersStore.fetch()) in comment.

If I add it back, I get the following error (from /alt/utils/Render.js):
Uncaught TypeError: Cannot read property 'locked' of undefined

Putting
UsersStore.fetch();
back in componentWillMount() solves the issue.

@iam4x
Copy link
Owner Author

iam4x commented Jun 30, 2015

@jonaswindey I'm waiting for goatslacker/alt#364 to be merged and new Alt released 馃憤

Right now nested components won't have its datasources resolved, so when App fetches locale which is our root component nothing else will be resolved.

@iam4x
Copy link
Owner Author

iam4x commented Nov 16, 2015

It's not in the scope of Alt anymore, will keep our internal solution.

@iam4x iam4x closed this as completed Nov 16, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants