replit / crosis Goto Github PK
View Code? Open in Web Editor NEWA JavaScript client that speaks Replit's container protocol
License: MIT License
A JavaScript client that speaks Replit's container protocol
License: MIT License
Uh, this doesn't really matter, and I'm sorry that I'm bothering you, but I just wanted to let you know that the description should be replit, not repl.it.
Thanks and sorry!
It's probably really easy to implement integration tests.
Line 1 in 4cc3b32
Right now when you send a request and the channel closes; whether it is due to client closing or calling channel.close
we throw an error for that promise. I think it would be cleaner if we just returned something instead.
Which means if you want to handle that instance you need to put channe.request
in a try catch, catch the error
This is common in our codebase, it's ugly and tedious!
let res
try {
res = channel.request({ ... })
} catch (e) {
if (/* assert if error is channel closed */) {
handleChannelClosed();
return;
}
throw e;
}
Not sure if this makes sense but I'm thinking this is better than throwing.
enum ChannelCloseReason {
ClientClosed, // this means you called `Client::close`
ClientDisconnect, // this means the websocket died unexpectedly
ChannelClosed, // this means you called `Channel::close`
}
type RequestResult =
| api.Command
| { channelClosed: ChannelCloseReason; closeStatus: null }
| { channelClosed: ChannelCloseReason.ChannelClosed; closeStatus: api.CloseChannelRes.Status };
interface Channel {
request(cmd: api.Command): Promise<RequestResult>;
}
The JavaScript version can be published as a standalone package into NPM. This library can list it as a peer dependency (with minimum version).
The separate repo can also have bindings to different languages and publishes them to their respective package managers. Right now we use JavaScript and Go
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.