Skip to content

Conversation

EastSun5566
Copy link
Contributor

@EastSun5566 EastSun5566 commented Oct 3, 2024

Create a separate client build to prevent server code from being imported into the browser:

dist/
├── client
│   ├── index.cjs
│   ├── index.d.cts
│   ├── index.d.ts
│   └── index.js
├── index.cjs
├── index.d.cts
├── index.d.ts
└── index.js

2 directories, 8 files
Screenshot 2024-10-03 at 6 17 50 PM

Usage can be like that:

Server-side:

import { createYSocketIOServer, createWorker } from '@hackmd/y-socketio-redis'

Client-side:

import { SocketIOProvider } from '@hackmd/y-socketio-redis/client'

@EastSun5566 EastSun5566 self-assigned this Oct 3, 2024
@stanley2058 stanley2058 merged commit 84bf526 into main Oct 3, 2024
1 check passed
@stanley2058 stanley2058 deleted the fix/make-client-own-build branch October 3, 2024 10:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants