2

I was considering making use of OboeJS for streaming of JSON loading. However, when I try to access the page, it asks for me to log in to the server using a Username and Password.

I am considering making use of OboeJS after reading this: Angularjs get request for a huge json file. A side question: is there any quick or easy way to tell / confirm if my server supports HTTP/JSON streaming?

Is it no longer available for public use?

If so, what are some possible alternatives? I am considering sending multiple sequential GET requests and updating the Angular frontend regularly.

Thank you!

Community
  • 1
  • 1
Tacocat
  • 1,134
  • 8
  • 23

1 Answers1

1

Oboe.js is still an awesome choice for this! :) We're just having trouble's with the nodejitsu hosting of the site. You can view some discussion about this, the state of our migration to GitHub Pages, and some alternative ways of reaching the documentation in the mean time, at https://github.com/jimhigson/oboe.js-website/issues/17

As for your second question, you should be able to get the benefits of using Oboe no matter what you're using on the server side (even static JSON). When you request data, it gets downloaded by the browser in chunks over time, effectively making it a stream. If your server has a built-in mechanism for streaming, it will just lower the time it takes for you to start receiving a response.

Hope that helps!

JuanCaicedo
  • 3,132
  • 2
  • 14
  • 36
  • "When you request data, it gets downloaded by the browser in chunks over time, effectively making it a stream." Could you elaborate more on this, please? I am not sure if I am functioning under a misunderstanding: Right now, my browser would still hang/take very long to render/load the page view when I pass it a huge JSON (say, more than 100MB in size). Ideally, I would rather that my page views loads progressively such that the user knows not to panic. OboeJS would allow me to do this, am I right? @JuanCaicedo – Tacocat Apr 06 '16 at 22:58
  • However, at the end of the day, after the entire data/page load is complete, the entire huge JSON of more than 100MB would still be stored in the browser JS heap, am I right? (Please correct me if I am wrong; I am fairly new to this entire thing!) From what I have read, there does not appear to be a limit on the amount of data that can be stored on the browser... (The ReactJS conference demonstration used bitcoin transactions as an example and loaded a few gigabytes of data with no issues on the browser, right... ?) However, is this good practice? :/ @JuanCaicedo – Tacocat Apr 06 '16 at 23:01
  • If it isn't good practice, what is? Caching? If you could kindly just point me towards a good direction to research/consider, I would be really grateful, @JuanCaicedo. Thank you! – Tacocat Apr 06 '16 at 23:02
  • It might be worth it to move this conversation to its own question, but what happens is that your browser makes a request, then downloads the response. It takes a while for it to get the whole response. Normally, you would have to wait for it to finish, but Oboe lets you interact with the response while it's still coming in. Oboe is unaware what the server is doing, because it just deals with a native XMLHttpRequest. – JuanCaicedo Apr 07 '16 at 00:50
  • For the memory question, I've heard a lot of people having trouble somewhere in the 100-200mb range. I would be very interested in that ReactJS talk if you can post a link :) Oboe provides a memory optimization inside its handlers called `this.drop` that might be helpful for you. As for is downloading that much memory to the browser a good idea? Hard to say. It causes a lot of technical difficulty, but it might fit your business needs. Not sure if caching would really solve your problem, that gives you data faster, but you still need the same amount of data. – JuanCaicedo Apr 07 '16 at 00:58
  • Here's the link: https://www.youtube.com/watch?v=2ii1lEkIv1s; I am actually using Angular (with Express framework). As such, I believe I will have to take a look at how `AngularJS` works with `OboeJS` first >_< Thanks for the answers; they confirm what I have read and deduced thus far. The one question I am still unsure about is the feasibility and 'goodness' of storing huge amounts of data on the browser, @JuanCaicedo – Tacocat Apr 07 '16 at 01:02
  • 1
    You might be interested in [angular-oboe](https://github.com/RonB/angular-oboe) and [ng-oboe](https://github.com/jedd-ahyoung/ng-oboe). As for express, `res` is a writable stream, so you can pipe to it. I have an example [here](https://github.com/JuanCaicedo/oboe-demo/blob/master/routes/index.js#L23) and [here](https://github.com/JuanCaicedo/better-json-through-streams/blob/master/routes/index.js) – JuanCaicedo Apr 07 '16 at 13:56
  • Wow, thanks for all of those links! I was just looking at `angular-oboe`. Didn't know about `ng-oboe`! It looks really useful! Thanks for the examples too! :)) @JuanCaicedo I am using `express` routing, rather than `angular` routing right now, so your examples will probably be very useful. Otherwise, I was thinking of converting to `angular` routing! – Tacocat Apr 08 '16 at 02:13
  • Sorry, I need a bit of help, @JuanCaicedo, if you could help me out a little. I am confused by how to use `Oboe` with `Express` even after looking through the example codes. Currently, I am able to get my JSON from a URL, e.g. `/data`. I wish to make use of `Oboe's` support of `request` streams to get this JSON and feed it to my `Express` view via `res.render`. How can I do this? Right now, what I have looks something like this: `request(requestOptions, function(error, response, body){res.render ('home',{list : body} )})`, and I am not sure how I can insert `Oboe`. – Tacocat Apr 08 '16 at 07:42
  • Are you using oboe on the client side or on the server side? – JuanCaicedo Apr 08 '16 at 17:16
  • Client side. @JuanCaicedo. If you could, please take a look at the new question I have posted, :) – Tacocat Apr 09 '16 at 06:31