- 🟥 harmful -- breaking change
- 🔶 maybe harmful -- deprecation, or possible breaking change
- 🍏 harmlesss -- addition, fix, or enhancement
- 🍏 isColorSupported accepts env var
FORCE_COLOR
- 🍏 deathWithDignity now doesn't die on uncaught errors
- added option
dieOnUncaught
which you can settrue
if you are a severe person
- added option
- 🍏 fix efficiency issue in webSocketRemote
changes and improvements
- 🍏 added new export
RandomUserEmojis
- 🟥 revise arguments for
deadline(timeout, message, fn)
- 🟥 require
onClose
inwebSocketRemote
- 🟥 in webSocketRemote, rename
fns
toremote
// BAD old way const {fns: serverside} = await webSocketRemote<Serverside>(options) // GOOD new way const {remote: serverside} = await webSocketRemote<Serverside>(options)
logging and error handling has been revised and greatly improved.
- 🔶 simplified RemoteError constructor to just take a message like ordinary Error
- 🟥 replaced
onInvocation(request, response)
withonCall(request, remote)
- 🟥 replaced endpoint
onError
withonCallError
- 🟥 replace
PrettyLogger
withloggers
- now you just import
loggers
which is an instance ofLoggers
- it attempts to detect if the tty supports ansi colors
- the loggers instance has ready-made functions
onCall
,onCallError
, andonError
for renraku logging- these are now the defaults
- renraku now defaults to logging everything
- i realized the first thing a developer wants to do, is see that their api is working, and probably start troubleshooting
- it was just unacceptable to setup renraku and immediately see nothing and be confused and then have a chore to setup logging
- so now, you can disable logging by passing empty functions for onCall/onCallError/onError
- i suppose you could actually set those empty functions on the
logger
instance 🤔
- now you just import
- 🟥 WebSocketServer
acceptConnection
is now an async function - 🟥 replaced
expose
function with similar newendpoint
function// OLD -- this is outdated new HttpServer(expose(({headers}) => fns)) // NEW -- do it like this now new HttpServer(({headers}) => endpoint(fns))
- this new design is cleaner, and non-http apis like postMessage don't need to pretend and pass fake headers like before
- we also removed the concept of an
Api
type and theapi
helper function - if you were using
api
, you are now expected to roll-your-own, like this:// OLD const myApi = api(({headers}) => ({...myFunctions})) new HttpServer(expose(myApi)) // NEW import {ServerMetas} from "renraku" const myApi = ({headers}: ServerMetas) => ({...myFunctions}) new HttpServer(meta => endpoint(myApi(meta)))
- 🟥 rename
maxPayloadBytes
tomaxRequestBytes
- 🍏 new
PostMessenger
for bidirectional postmessage apis - 🍏 add
timeout
for HttpServer and also WebSocketServer, defaults to 10 seconds.
- 🟥 totally massive rewrite
- everything has changed, deal with it 😎
- you're gonna have to just read the new readme 💀
- undocumented small tweaks and renames
- (breaking) added required parameter
timeout
to websocket server and client
-
(breaking) mass renames
we removed all the
renraku
prefixes from various namesit's now recommended to
import * from "renraku"
, and rename things likerenrakuApi
torenraku.api
-
add an option for
renraku.mock
calledspike
, which allows you to intercept and manipulate outgoing calls. this is used for implementing logging or mock latency.
-
(breaking) complete renraku rewrite!
you have to redo your renraku implementation. sorry not sorry
- (breaking) remove mockRemote's withMeta and forceAuth with the newer more-capable
useMeta
anduseAuth
- (breaking) simplified signatures for policy, augment, apiContext
- (breaking) rename some interfaces like ToRemote to Remote, ToApiContext to ApiContext
- (breaking) rename _augment symbol to _meta
- rework readme tutorial accordingly
- start of changelog