Registry / realtime / racer-highway

racer-highway

JSON →
library10.0.2jsnpmunverified

WebSocket and browserchannel transport plugin for Racer (and DerbyJS). Current stable version is 10.0.2. Release cadence is irregular; major versions drop support for older Racer versions and features. Provides real-time synchronization between server and client via WebSocket. Key differentiator: it is the standard transport layer for DerbyJS/Racer apps, supporting session handling and custom hooks. Since v10, it dropped browserchannel support and only uses pure WebSockets. It works with Racer >= 0.9 and requires Browserify for client-side bundling.

npm install racer-highway
INSTALL
IMPORT
SIG · RACER-HIGHWAY
R
racer-highway
realtimejavascriptv10.0.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
const highway = require('racer-highway');
import highway from 'racer-highway';
CommonJS require is the correct way; ESM import may not work because package does not export ESM.
handlers
const handlers = highway(store);
const handlers = highway(store, options); // missing options object
Returns an object with upgrade and maybe other handlers. Options are optional but often needed for session.
bundler
const racerClientBundle = require('racer-highway/lib/bundle');
const racerClientBundle = require('racer-highway/bundle');
Path must include '/lib/bundle'.

Sets up an Express server with Racer store and racer-highway for WebSocket upgrade handling.

const http = require('http'); const express = require('express'); const session = require('express-session'); const Racer = require('racer'); const highway = require('racer-highway'); const app = express(); const server = http.createServer(app); const store = Racer.createStore({}); // Use express session middleware app.use(session({ secret: 'mySecret', resave: false, saveUninitialized: true })); const handlers = highway(store, { session: true }); server.on('upgrade', handlers.upgrade); app.get('/', (req, res) => { res.send('Hello Racer!'); }); server.listen(3000, () => console.log('Server listening on port 3000'));
Debug
Known issues
breakingBrowserchannel support dropped in v10.0.0. If you need browserchannel, use v8.1.0 or v9.0.0.
fix
Downgrade to v9.0.0 or v8.1.0, or migrate to pure WebSocket.
affects: >=10.0.0
breakingracer-highway v8.0.0+ requires racer >= 0.9; v7.0.0+ requires racer >= 0.8.
fix
Update racer to version >=0.9.
affects: >=8.0.0
deprecatedUsing require('racer-highway') in browser context is not supported. Must bundle with Browserify.
fix
Use require('racer-highway/lib/bundle') to get the bundler function, or rely on store.bundle(...).
affects: all
gotchaSession support must be enabled explicitly by passing { session: true } or a session middleware reference.
fix
Pass { session: sessionMiddleware } as second argument to highway().
affects: all
Errors
Common errors & fixes
TypeError: highway is not a function
Incorrect import: using ESM import or wrong path.
fix
Use const highway = require('racer-highway');
Error: No upgrade handler registered
Missing server.on('upgrade', handlers.upgrade).
fix
Add server.on('upgrade', handlers.upgrade); after calling highway(store).
Error: Racer version mismatch: racer-highway requires racer >= 0.9 (current: 0.8.x)
Outdated racer version.
fix
Upgrade racer to >=0.9.
Upgrade
Version history
10.0.2latest on npm
Audit
Dependencies
racerrequiredpeer dependency: racer-highway is a transport plugin for Racer
Agent activity
37 hits · last 30 days
node
30
OpenAI (training)
1
Resources
racer-highway — npm install racer-highway · libregistry