Skip to content

Commit

Permalink
revert: fix: avoid using localstorage polyfill to support SSR
Browse files Browse the repository at this point in the history
The actual issue is that most libraries need a way to identify the
server-side environment and a lot of libraries do this by checking
Node.js specific global or environment variables (like `process`). Instead of
maintaining a custom implementation for `lib0/broadcastchannel`, we
should fix the issue by providing the correct environment for libraries
that expact Node.js compatiblity via a Node.js compatiblity mode.
  • Loading branch information
eliias committed Feb 3, 2023
1 parent b473dc9 commit e4b6277
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 66 deletions.
6 changes: 6 additions & 0 deletions packages/yrb-actioncable/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# yrb-actioncable

## 0.1.5

### Patch Changes

- Revert replacement of lib0/broadcastchannel with custom implementation.

## 0.1.4

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/yrb-actioncable/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "0.1.4",
"version": "0.1.5",
"license": "MIT",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
Expand Down
64 changes: 0 additions & 64 deletions packages/yrb-actioncable/src/broadcastchannel.ts

This file was deleted.

2 changes: 1 addition & 1 deletion packages/yrb-actioncable/src/websocket-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import {
} from 'y-protocols/awareness';
import { readAuthMessage } from 'y-protocols/auth';

import { publish, subscribe, unsubscribe } from './broadcastchannel';
import { publish, subscribe, unsubscribe } from 'lib0/broadcastchannel';

type MessageHandler = (
encoder: Encoder,
Expand Down

0 comments on commit e4b6277

Please sign in to comment.