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

Browserify partial app loading example #9

Closed
pieterv opened this issue May 26, 2014 · 2 comments
Closed

Browserify partial app loading example #9

pieterv opened this issue May 26, 2014 · 2 comments

Comments

@pieterv
Copy link

pieterv commented May 26, 2014

Hey!

I am very impressed by your partial app loading example and after some playing i got it going with browserify, i thought you might be interested :)

https://github.com/pieterv/react-partial-app

I based the code off @petehunt's cjs version from #1 with a couple of things to note that are different:

  • I am using the browserify module loader as the module cache and try requiring the base component on componentWillMount if that fails it will then load in the bundle, this should also in theory allow for synchronous loading of the components when rendering on the server. https://github.com/pieterv/react-partial-app/blob/master/partial-app.js#L58
  • The browserify bundling setup isn't very good at the moment as you have to manually specify what modules go in what bundle, we should be able to automate this in the near future with browserify's factor-bundle plugin but there are a few bugs blocking this.

I really like the direction this router is going, i'm looking forward to using it in my projects!

@mjackson
Copy link
Member

Hey @pieterv! Thanks for sharing your example code. At this point we have some async transition hooks (undocumented) that you can put on your component classes willTransitionTo and willTransitionFrom that are called when your transitioning to/from your component. I think the best place to load the components you need from the server may be in willTransitionTo instead of componentWillMount.

Either way, nice work! Is there something here you wanted us to merge?

@pieterv
Copy link
Author

pieterv commented Jun 12, 2014

Hey @mjackson, the willTransition* hooks sound really useful, i will look into that!

I left the issue open as i was going to update it when i had a nicer solution for the browserify bundling issues, but it looks like the bug fixes i was waiting on have stalled so will close this now and look at doing a PR with an example if i find a solid solution.

Thanks!

@pieterv pieterv closed this as completed Jun 12, 2014
@lock lock bot locked as resolved and limited conversation to collaborators Jan 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants