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

Sente connections should only fetch bootstrap first time #13

Open
metasoarous opened this issue May 21, 2016 · 4 comments
Open

Sente connections should only fetch bootstrap first time #13

metasoarous opened this issue May 21, 2016 · 4 comments

Comments

@metasoarous
Copy link
Owner

This tends to work best for most development workflow; page refresh works fine for resourcing db, given how often this is needed.

@bamarco
Copy link
Collaborator

bamarco commented Jun 13, 2016

I think I figured out part of the problem. In ws.cljs you have a lot of initialization not hidden behind a defonce. So all the sente
get-flexi-packer defs
and the
(sente/start-chsk-router! ch-chsk event-msg-handler)
get called everytime you save a file not just on refresh. This forces you to use the opened? atom hack (which is defonced as it should be).

Besides the above did you want it to bootstrap once per figwheel startup or once per refresh?

@metasoarous
Copy link
Owner Author

Good find! This should get taken care of in the System Component rewrite. If not we can revisit it.

I was thinking bootstrap once per figwheel session, forcing refresh when you want to retry the bootstrap. I think mostly you won't need to bootstrap if we set things up properly, because posh will take care of telling the server what data is needed. So there shouldn't need to be a lot of tweaking of the bootstrap function eventually, and till then reloading is fine. I think. Open to thoughts.

@bamarco
Copy link
Collaborator

bamarco commented Jun 13, 2016

By "System Component rewrite" do you mean setting up the front end to also use stuartsierra.component? [Yes. Answered my own question.]

Yeah I figured it should be a one off. If that's the case there's probably a way to set it up in the dev/user.clj similar to the Chestnut method and just start figwheel from the run fn. Have a bootstrap function that gets called in dev/user.clj in dev mode and called from Component in production mode.

@metasoarous
Copy link
Owner Author

Yup :-) Take a look at the grand-refactor branch.

I'm totally open to improvements and streamlining on the interactive dev side. Just open an issue for it so we can discuss and then PR.

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

2 participants