OSC / ood-activejobs

[MOVED] Active Jobs provides details of scheduled jobs on an HPC cluster.
https://osc.github.io/Open-OnDemand/
MIT License
0 stars 1 forks source link

[DO NOT MERGE] Use ndjson instead of oboe.js #189

Open ericfranz opened 5 years ago

ericfranz commented 5 years ago

Fixes #179

This is a complete working switch to using ndjson to stream the data (verified on MSEdge 18) using the https://github.com/canjs/can-ndjson-stream library

One of the issues is there are multiple polyfills to support this in older browsers, this library uses TextEncoder which is not supported in MSEdge, and the polyfill for TextEncoder is archived project. Before merging, we may want to ask the canjs or donejs community (or post an issue directly) about this dependency issue.

Since this is part of the https://canjs.com/ project which is part of the https://donejs.com/ you would expect that there would be a solution to have this work in the browsers, since https://donejs.com claims to support all browsers.

Note: the one reason of moving to this is to remove the dependency off of http://oboejs.com/.

ericfranz commented 5 years ago

This PR looks good. Set to WIP till we decide on ES6

  1. Before merging in to master we need to decide how we want to support ES6 in Active Jobs and the ramifications. My understanding is currently this code will fail when building production assets due to uglifier config.
  2. For testing, be sure to setup an initializer with many copies (20?) of the Owens cluster in the OodAppkit.clusters array so that we can verify that a response that might take 20 seconds to complete starts displaying jobs to the user in the jobs table almost immediately.
ericfranz commented 5 years ago

@samirmansour its been a while since you worked on this. But now I'm thinking we should add polyfills to get this working in IE11 - if it works there, then it would work in older versions of Firefox Chrome and Edge that don't support fetch and other es6-isms...

https://github.com/github/fetch looks promising. Is that all that is needed here? Maybe...

ericfranz commented 5 years ago

content type needs to be "application/x-ndjson"