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

build: Use "standalone" output to build Next.js as a standalone app #14852

Closed
wants to merge 1 commit into from

Conversation

jckw
Copy link
Contributor

@jckw jckw commented May 2, 2024

What does this PR do?

This PR changes the Next.js output type of the @calcom/web app to "standalone", which is needed if calcom/docker#355 is to merge.

The "output" config property should not affect builds being run on Vercel, but will affect those built with Docker.

Please see the linked PR for a full explanation of why this is useful. The summary is:

  • "standalone" results in a 40% reduction in image size
  • "standalone" is the standard config property used in the Next.js example Dockerfile, so allows the calcom/docker repo to use a Dockerfile similar to that, thereby requiring less maintenance

Requirement/Documentation

Type of change

  • Chore (refactoring code, technical debt, workflow improvements)
  • This isn't really a breaking change unless someone is running "next build" outside of Vercel and their PaaS cannot handle "standalone" output or they are managing the build output themselves. This seems unlikely though.
    • The exception is Docker. This PR will break docker builds unless the linked PR is merged. But.. Docker builds have been broken for 2+ months anyway, so nbd.

How should this be tested?

  • Are there environment variables that should be set? No
  • What is expected (happy path) to have (input and output)? Everything works exactly as it does now
  • Any other important info that could help to test that PR

Test out this branch on whatever build process is used by Cal (presumably Vercel), and verify that it works and deploys. Unless there is any special config used by Cal, everything should work as normal on Vercel.

Mandatory Tasks

  • Make sure you have self-reviewed the code. A decent size PR without self-review might be rejected.

Checklist

  • I haven't checked if my PR needs changes to the documentation
  • I haven't added tests that prove my fix is effective or that my feature works

Copy link

vercel bot commented May 2, 2024

@jckw is attempting to deploy a commit to the cal Team on Vercel.

A member of the Team first needs to authorize it.

@graphite-app graphite-app bot requested a review from a team May 2, 2024 08:09
@graphite-app graphite-app bot added the community Created by Linear-GitHub Sync label May 2, 2024
Copy link
Contributor

github-actions bot commented May 2, 2024

Thank you for following the naming conventions! 🙏 Feel free to join our discord and post your PR link.

@jckw jckw changed the title Use "standalone" output to build Next.js as a standalone app build: Use "standalone" output to build Next.js as a standalone app May 2, 2024
Copy link

graphite-app bot commented May 2, 2024

Graphite Automations

"Add community label" took an action on this PR • (05/02/24)

1 label was added to this PR based on Keith Williams's automation.

"Add consumer team as reviewer" took an action on this PR • (05/02/24)

1 reviewer was added to this PR based on Keith Williams's automation.

Copy link
Contributor

github-actions bot commented May 2, 2024

📦 Next.js Bundle Analysis for @calcom/web

This analysis was generated by the Next.js Bundle Analysis action. 🤖

This PR introduced no changes to the JavaScript bundle! 🙌

@sean-brydon sean-brydon requested a review from a team May 2, 2024 10:36
@sean-brydon sean-brydon added the high-risk Requires approval by Foundation team label May 2, 2024
@keithwillcode keithwillcode added this to the v4.1 milestone May 8, 2024
@keithwillcode keithwillcode modified the milestones: v4.1, v4.2 May 15, 2024
Copy link
Contributor

This PR is being marked as stale due to inactivity.

@github-actions github-actions bot added the Stale label May 30, 2024
@Udit-takkar Udit-takkar removed the Stale label May 30, 2024
@PeerRich PeerRich added the Medium priority Created by Linear-GitHub Sync label Jun 3, 2024
Copy link
Contributor

@emrysal emrysal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Happy to give this a shot, if this does create issues (which will be caught by our checks) we should consider an environment variable like so:

output: process.env.BUILD_STANDALONE === "true" ? "standalone" : undefined,

@emrysal
Copy link
Contributor

emrysal commented Jun 11, 2024

Hi @jckw I'm unable to update this branch (critical to do so as the checks will not run properly otherwise) - will close and re-open a mirror.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community Created by Linear-GitHub Sync docker high-risk Requires approval by Foundation team Medium priority Created by Linear-GitHub Sync 💻 refactor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants