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

Merged
merged 2 commits into from
Jan 8, 2025
Merged

Update typescript to 5.7 #2382

merged 2 commits into from
Jan 8, 2025

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

🦋 Changeset detected

Latest commit: df4b7e4

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
solid-js Patch
test-integration Patch

Not sure what this means? Click here to learn what changesets are.

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

@coveralls
Copy link

coveralls commented Dec 16, 2024

Pull Request Test Coverage Report for Build 12679170092

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 48 of 52 (92.31%) changed or added relevant lines in 9 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage decreased (-0.02%) to 85.607%

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.65%
Totals Coverage Status
Change from base Build 11846786421: -0.02%
Covered Lines: 2287
Relevant Lines: 2607

💛 - Coveralls

@ryansolid ryansolid merged commit fff8aed into solidjs:main Jan 8, 2025
1 check passed
@ryansolid
Copy link
Member

Thanks

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