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

Update typescript to 5.7 #2382

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Update typescript to 5.7 #2382

wants to merge 1 commit into from

Conversation

thetarnav
Copy link
Contributor

Since version 5.7 typescript doesn't like comparing strings for truthiness

image

And inlining "_SOLID_DEV_" as any as boolean doesn't seem to do the trick.

So I've added a constant and use it in place of strings which silences the errors.

const IS_DEV = "_SOLID_DEV_" as string | boolean

The output looks almost identical to using strings directly - most code paths behind a dev check get removed in prod entries. Some uncleaned if statements remain, but as they did with strings before.

const IS_DEV = false;
// ...
if (IS_DEV); // the block gets removed but if remains
else {
	// ...
}

The variable is not exported outside of the module, just internally between files to not redeclare it in every file.

Other option would be to use @ts-expect-error everywhere but that just seem a bit noisy.


Also had to add some additional assertions ! to variable declarations for refs, as they are "being used before assigned" from ts point of view.

Copy link

changeset-bot bot commented Dec 16, 2024

⚠️ No Changeset found

Latest commit: e0e823a

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coveralls
Copy link

Pull Request Test Coverage Report for Build 12359126389

Details

  • 48 of 52 (92.31%) changed or added relevant lines in 9 files are covered.
  • 2 unchanged lines in 2 files lost coverage.
  • Overall coverage increased (+0.1%) to 85.756%

Changes Missing Coverage Covered Lines Changed/Added Lines %
packages/solid/src/reactive/array.ts 1 2 50.0%
packages/solid/src/render/component.ts 2 3 66.67%
packages/solid/src/reactive/signal.ts 23 25 92.0%
Files with Coverage Reduction New Missed Lines %
packages/solid/src/reactive/signal.ts 1 81.66%
packages/solid/src/reactive/scheduler.ts 1 80.95%
Totals Coverage Status
Change from base Build 11846786421: 0.1%
Covered Lines: 2290
Relevant Lines: 2607

💛 - Coveralls

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