Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: separate client build #5

Merged
merged 2 commits into from
Oct 3, 2024
Merged

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