builder icon indicating copy to clipboard operation
builder copied to clipboard

High bundle - Builder io React

Open dkrefta opened this issue 2 years ago • 9 comments

Workaround to solve the high bundle size of the builder ?! it is impacting directly on js bundle size of the application Describe the bug A clear and concise description of what the bug is. image image

To Reproduce Steps to reproduce the behavior:

  1. install @builder.io/react

import { builder, BuilderComponent } from '@builder.io/react' import '@builder.io/widgets' 4. check the size of the bundle = 273k + 161k 5.

Expected behavior A clear and concise description of what you expected to happen. has a better bundle size

Screenshots If applicable, add screenshots to help explain your problem.

Additional context Add any other context about the problem here.

dkrefta avatar Aug 04 '22 02:08 dkrefta

hey @dkrefta - we have a v2 of our react SDK coming very soon that is drastically smaller, @samijaber can update here with more

steve8708 avatar Aug 12 '22 00:08 steve8708

@steve8708 thanks very much for the update

dkrefta avatar Aug 12 '22 01:08 dkrefta

Our v2 React SDK is now out in Beta: https://github.com/BuilderIO/builder/blob/main/packages/sdks/output/react/README.md

example of how to use it: https://github.com/BuilderIO/builder/tree/main/examples/react-v2

samijaber avatar Aug 15 '22 21:08 samijaber

@samijaber safe for production?

dkrefta avatar Aug 17 '22 23:08 dkrefta

I tried out the beta today, but was unable to get it to work.

Using it in production is all about your risk tolerance, @dkrefta.

Hope this is helpful.

charkour avatar Aug 18 '22 03:08 charkour

@charkour please raise any issues you encounter with the @builder.io/sdk-react beta SDK, and tag me! Would love to unblock you

samijaber avatar Aug 18 '22 16:08 samijaber

@samijaber safe for production?

@dkrefta it is still in beta, and does not have every single feature that the stable v1 React SDK has. But it should be able to handle a vast majority of Builder features and designs without issues. 🙂

samijaber avatar Aug 18 '22 16:08 samijaber

@samijaber, I was able to get the SDK to work. It simply doesn't work with server-side rendering. I've made an issue here: #1217. Thank you for the help!

I appreciate the steps forward your team is making.

charkour avatar Aug 18 '22 21:08 charkour

@samijaber exactly, it's always a risk to use in production any beta release, but I will do some tests and see what we got of improvements by the builder io, thanks very much

dkrefta avatar Aug 18 '22 22:08 dkrefta

We are still in the process of fully documenting our gen2 React SDK, but it is worth noting that it is now in v1!

https://github.com/BuilderIO/builder/blob/main/packages/sdks/output/react/CHANGELOG.md

its total bundle size is 25kb, with zero dependencies:

  • https://bundlejs.com/?q=%40builder.io%2Fsdk-react
  • https://bundlephobia.com/package/@builder.io/[email protected]

I will mark this issue as closed. If you have any problems with the gen2 SDK, please let the Builder team know using support channels/forum and we will make sure they are resolved

samijaber avatar Feb 22 '24 20:02 samijaber