Skip to content

feat(nextjs): Add scripts to allow deploying a branch to vercel #3624

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

Merged
merged 1 commit into from
May 31, 2021

Conversation

lobsterkatie
Copy link
Member

@lobsterkatie lobsterkatie commented May 31, 2021

While building the nextjs SDK, multiple times we've run into the problem of having something work locally which then fails or breaks entirely when deployed to Vercel. Testing on Vercel is hard, though, because up until now if we wanted to test an SDK change, we've had to publish a beta to npm. Not only is this a lot of work just to be able to test a small change (especially if we're debugging and have to make a lot of small changes in a row), it's also not something most of us have the power to do.

This fixes that problem by adding scripts to the repo which, when used in a test app, allow you to use a repo branch rather than a published package as the SDK in your app, by simply mimicking what we do on our own machines: cloning the repo, building the SDK, and then using that built copy in the test app.

More specifically, this PR adds four files to the repo:

  1. A script to prepare the branch for testing on Vercel
  2. A script to link the test app to the branch
  3. A script to run on Vercel, which clones and builds the SDK
  4. Instructions on how to use all of the above

On Vercel, it adds the built SDK as a file dependency (rather than linking it) to avoid any of the relative path problems which have come up when testing locally, and also because that way, yarn manages the SDK's dependencies alongside the project's.

@lobsterkatie lobsterkatie requested a review from kamilogorek as a code owner May 31, 2021 06:01
@github-actions
Copy link
Contributor

size-limit report

Path Size
@sentry/browser - CDN Bundle (gzipped) 20.77 KB (+0.01% 🔺)
@sentry/browser - Webpack 22 KB (0%)
@sentry/react - Webpack 22.03 KB (0%)
@sentry/browser + @sentry/tracing - CDN Bundle (gzipped) 28.17 KB (0%)

@HazAT HazAT changed the base branch from master to kmclb-next-js-performance May 31, 2021 08:15
@HazAT HazAT changed the base branch from kmclb-next-js-performance to master May 31, 2021 08:16
Copy link
Member

@HazAT HazAT left a comment

Choose a reason for hiding this comment

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

💯

@HazAT HazAT merged commit 752856c into master May 31, 2021
@HazAT HazAT deleted the kmclb-deploy-branch-on-vercel branch May 31, 2021 08:16

`yarn vercel:project <path/to/testapp>`.

This will copy a script into a `.sentry` folder at the root level of your test app,and create a second one. (The first
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
This will copy a script into a `.sentry` folder at the root level of your test app,and create a second one. (The first
This will copy a script into a `.sentry` folder at the root level of your test app, and create a second one. (The first

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants