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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

return promise from isomorphic.server #8

Closed
wants to merge 2 commits into from
Closed

return promise from isomorphic.server #8

wants to merge 2 commits into from

Conversation

romeovs
Copy link

@romeovs romeovs commented Oct 19, 2015

I've modified the code to return a promise from the isomorphic.server when no callback is given. This shouldn't break existing code:

const isomorphic = new Isomorphic(conf);
isomorphic.server(path, callback); // still works!

but adds the option to write this more declaratively:

const isomorphic = new Isomorphic(conf);
isomorphic.server(path)
  .then(() => /* do some more stuff */);

@catamphetamine
Copy link
Owner

thanks, I'll add the code you provided to the project after I finish a couple of tests for it.

@romeovs
Copy link
Author

romeovs commented Oct 19, 2015

cool thanks! I tested it in a project where I'm using it. I could really see where it would fit in your tests.

@catamphetamine
Copy link
Owner

released a new version, try it out
npm install webpack-isomorphic-tools@latest --save

@catamphetamine
Copy link
Owner

FYI
I'm posting this in every issue and PR to notify whoever may be interested:
today I've released an alternative helper library called universal-webpack.
It takes a different approach than webpack-ismorphic-tools and instead of hacking Node.js require() calls it just compiles all code with target: 'node' webpack configuration option.
As a result, all Webpack plugins and features are supported.
If you think you might need that here's an example project:
https://github.com/halt-hammerzeit/webpack-react-redux-isomorphic-render-example

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

Successfully merging this pull request may close these issues.

None yet

2 participants