cloudflare / cloudflare/realtimekit-ui

Reduce or optimize bundle size

Open
#167 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
64
Forks
22
Avg merge
1d 18h
Merged PRs (30d)
5

Description

I get that this is a complicated endevour, but still having 4-5 MB for this when bundling minified, seems quite a lot.

Our entire app was 1.5MB before with our own webrtc static for user to user sessions and all the other parts of our app, and we decided to use realtimekit for its ease of use for room like sessions, and boom the bundle is 3 times our entire app with everything else.

Is it really using all of the javascript it comes with? or vite and rollup failing to treeshake it.

We are still using it, because it was so easy to setup. But would appreciate if we could reduce the bundle size or be able to treeshake more easily.

We are using

```
"@cloudflare/realtimekit": "^1.5.1",
"@cloudflare/realtimekit-react-ui": "^1.2.0",
```

Contributor guide

Open the contributing guide

Research direction

Start by reproducing a minified production build with Vite and Rollup, then inspect the bundle contributions from @cloudflare/realtimekit and @cloudflare/realtimekit-react-ui. Compare the result with and without the packages and determine whether unused code is being tree-shaken. Done means a documented reduction in bundle size or a clearly identified limitation and reproduction.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, rollup, typescript, vite
Domain
frontend, performance
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.