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

chore(deps): Deduplicate yarn.lock #14968

Merged
merged 13 commits into from
Jan 20, 2025

Conversation

nwalters512
Copy link
Contributor

I'm splitting this out of #14967 since it was getting a little out of hand in that other PR.

Tests are currently failing, seemingly related to ampproject/remapping#193. It seems like this may only have been fixed in vitest v2? So that might be a blocker for these changes.

There's another strange failure in the packages/browser test:

        FAIL  test/eventbuilder.test.ts > extractMessage > should extract message from a WebAssembly.Exception object
       AssertionError: expected 'No error message' to be 'wasm exception' // Object.is equality
       
       - Expected
       + Received
       
       - wasm exception
       + No error message
       
        ❯ test/eventbuilder.test.ts:188:21
           186| 
           187|     const message = extractMessage(wasmException);
           188|     expect(message).toBe('wasm exception');
              |                     ^
           189|   });
           190| 

However, this also fails for me on the develop branch, so this may not be related to these changes.

@nwalters512 nwalters512 marked this pull request as ready for review January 13, 2025 16:16
@nwalters512
Copy link
Contributor Author

nwalters512 commented Jan 13, 2025

@mydea I'm unable to reproduce the integration test failures (https://github.com/getsentry/sentry-javascript/actions/runs/12751414906/job/35538905465?pr=14968) locally. I'm frankly not sure why integration tests seem to be performing type checking in the first place. Can you offer any guidance here? Maybe this is related to dependency caching in CI? Thanks!

Edit: I see now that it's testing against TS 3.8, and that I need to run node ./scripts/use-ts-3_8.js locally to reproduce this.

@nwalters512
Copy link
Contributor Author

It looks like the type errors are occurring because @types/express-serve-static-core uses modern TypeScript features that aren't supported by TypeScript 3.8, e.g.:

https://github.com/DefinitelyTyped/DefinitelyTyped/blob/c55a1e4fd5c048683bfd7c55340c78193124d11b/types/express-serve-static-core/index.d.ts#L105

Support for this was only introduced in TypeScript 4.1: https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-1.html

This was introduced to those types 4 years ago: DefinitelyTyped/DefinitelyTyped#51262

And as of 2 years ago, TypeScript <=4.0 is no longer supported by DefinitelyTyped: DefinitelyTyped/DefinitelyTyped#62240

Why is Sentry testing against TypeScript 3.8? This version hasn't been supported for a long time, and @types/* packages are no longer guaranteed to be compatible with it.

@nwalters512
Copy link
Contributor Author

In 30b8213 I updated the TypeScript 3.8 script to use resolutions in package.json to pin the Express types to older versions, which worked for me locally.

@AbhiPrasad AbhiPrasad self-requested a review January 14, 2025 04:32
@AbhiPrasad
Copy link
Member

Marking myself as a reviewer, will take a look ASAP!

Why is Sentry testing against TypeScript 3.8? This version hasn't been supported for a long time, and @types/* packages are no longer guaranteed to be compatible with it.

Because we want to be as a compatible with many users as possible. We said we would support 3.8+ with our 8.x major version, so we need to test to make sure we support it. We often hold support for things much longer than typical LTS for most JS libraries: https://develop.sentry.dev/sdk/philosophy/#compatibility-is-king

@AbhiPrasad AbhiPrasad self-assigned this Jan 14, 2025
@nwalters512
Copy link
Contributor Author

I'm not sure why things are failing after getting up to date with develop 😢 I'll poke at this tomorrow.

@nwalters512
Copy link
Contributor Author

Looks like the failing tests were fixed in #15001.

@nwalters512
Copy link
Contributor Author

If y'all want to check for a maximally-deduped lockfile in CI (I'd strongly advise this), you can add a npx yarn-deduplicate --check step to CI. Let me know if this is desired and I can add it.

Once you're using Yarn v4, this is built in via yarn dedupe/yarn dedupe --check.

AbhiPrasad pushed a commit that referenced this pull request Jan 17, 2025
Backport of #14971 to v8. This is a prerequisite for an eventual
backport of #14968, which will itself will make applying/backporting
#14967 much easier.

I ran `yarn build` and `yarn test` locally. Building succeeded, and all
but 2 test suites passed. The two that failed also failed for me on `v8`
(without any of my changes), so I'm assuming it's something to do with
my environment.
@AbhiPrasad AbhiPrasad merged commit 82adfbb into getsentry:develop Jan 20, 2025
133 checks passed
@nwalters512 nwalters512 deleted the yarn-deduplicate branch January 21, 2025 18:24
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.

2 participants