cal.com icon indicating copy to clipboard operation
cal.com copied to clipboard

Replace React in client production build with Preact

Open zomars opened this issue 1 year ago • 3 comments

What does this PR do?

take 2 of #1292

Type of change

  • [x] Breaking change (fix or feature that would cause existing functionality to not work as expected)

How should this be tested?

  • [ ] yarn build and yarn start
  • [ ] yarn test-e2e

Checklist

  • I haven't performed a self-review of my own code and corrected any misspellings
  • I haven't checked if my changes generate no new warnings
  • I haven't added tests that prove my fix is effective or that my feature works
  • I haven't checked if new and existing unit tests pass locally with my changes

zomars avatar Aug 09 '22 14:08 zomars

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
cal ❌ Failed (Inspect) Sep 8, 2022 at 4:12PM (UTC)
cal-com ❌ Failed (Inspect) Sep 8, 2022 at 4:12PM (UTC)
nightly-cal ❌ Failed (Inspect) Sep 8, 2022 at 4:12PM (UTC)
1 Ignored Deployment
Name Status Preview Updated
swagger ⬜️ Ignored (Inspect) Sep 8, 2022 at 4:12PM (UTC)

vercel[bot] avatar Aug 09 '22 14:08 vercel[bot]

Socket Security Report

Dependency issues detected. If you merge this pull request, you will not be alerted to the instances of these issues again.

📜 New install scripts detected

A dependency change in this PR is introducing new install scripts to your install step.

Package Script field Location
[email protected] (added) postinstall apps/web/package.json via [email protected]
Socket.dev scan summary
Issue Status
Did you mean? ✅ no new possible package typos
Install scripts ⚠️ 1 new install script detected
Telemetry ✅ no new telemetry
Troll package ✅ no new troll packages
Malware ✅ no new malware
Native code ✅ no new native modules

Powered by socket.dev

socket-security[bot] avatar Aug 09 '22 14:08 socket-security[bot]

@zomars are there any more benefits of preact other than reduced bundle size ?

Udit-takkar avatar Aug 09 '22 18:08 Udit-takkar

@zomars are there any more benefits of preact other than reduced bundle size ?

Other than reducing client side bundle size I'm not pretty sure. But every KB we can save without sacrificing functionality and performance is a win if you ask me.

zomars avatar Aug 11 '22 16:08 zomars

@zomars do you still want to implement this change? Preact is a pretty strong alternative (https://preactjs.com/guide/v8/differences-to-react/) but my main concern is versioning. As Cal keeps the Next.js version up to date, they may bump the React version under the hood and I'm thinking this will be a cause of concern around keeping the Preact version inline. Do you think the space saving is worth it? IMO it is not.

zlwaterfield avatar Sep 05 '22 18:09 zlwaterfield

I wouldn't worry too much about versioning as this change is easily reversible. Even Next.js maintainers use this technique all the time.

zomars avatar Sep 05 '22 19:09 zomars

@zomars PR has been updated in case anyone wanna try it out. It worked for me

alannnc avatar Sep 06 '22 19:09 alannnc

how much do we save? anyone has benchmarks?

PeerRich avatar Sep 07 '22 11:09 PeerRich

Closing since the gain/effort to debug tests is not worth right now.

zomars avatar Sep 08 '22 16:09 zomars