fix: exclude atoms web wrappers from build#15216
Merged
ThyMinimalDev merged 5 commits intomainfrom May 28, 2024
Merged
Conversation
Contributor
|
Thank you for following the naming conventions! 🙏 Feel free to join our discord and post your PR link. |
Graphite Automations"Add consumer team as reviewer" took an action on this PR • (05/28/24)1 reviewer was added to this PR based on Keith Williams's automation. "Add platform team as reviewer" took an action on this PR • (05/28/24)1 reviewer was added to this PR based on Keith Williams's automation. |
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 3 Ignored Deployments
|
ThyMinimalDev
approved these changes
May 28, 2024
p6l-richard
pushed a commit
to p6l-richard/cal.com-fork
that referenced
this pull request
Jul 22, 2024
* fix: exclude atoms web wrappers from build * refactor: tsconfig web wrapper regex * refactor: wrappers follow schema Component(Web|Platform)Wrapper.tsx * fix: tsconfig regex for web wrapper
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Platform customer (coho) reported that when wrapping their React app built using vite with
CalProviderthe app crashes because somehowprocess.env.__NEXT_ROUTER_BASEPATHis expected.screen-capture.5.webm
Solution
I confirmed with the customer that they are importing atoms from
import { CalProvider } from "@calcom/atoms";and not fromimport { CalProvider } from "@calcom/atoms/monorepo";, so my only explanation is that when importing from the atoms package somehow code related to Web wrappers is touched - Web wrappers like "WebAvailabilitySettingsWrapper" have next router imports "import { useRouter } from "next/navigation";".And the thins is that Web wrappers are included into the dist folder and published as atoms also increasing the package size.
So I
tsconfig.jsonto exclude all files ending with "WebWrapper.tsx".Atoms build: Before
Atoms build: After
Final notes
Even if this does not solve customer issue it will reduce package size. I tested examples app and cal web app locally and availability settings and booker work.