Skip to content

refactor(deploy): improve types to avoid extraneous runtime check #7220

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 3 commits into from
Apr 23, 2025

Conversation

serhalp
Copy link
Collaborator

@serhalp serhalp commented Apr 17, 2025

Summary

By improving these types and avoiding some reassignments we can let TS understand it better and avoid an extraneous runtime check.

Reviewer: this isn't easy to explain, because this code is quite messy. I suggest carefully reading through the logic in the main version before trying to grok my diff.

Follow-up to https://github.com/netlify/cli/pull/7194/files#r2039642849

Verified

This commit was signed with the committer’s verified signature.
serhalp Philippe Serhal
This code is messy, but by improving the typess and avoiding some reassignments we can let
TS understand it better and avoid an extraneous runtime check.
Copy link

github-actions bot commented Apr 17, 2025

📊 Benchmark results

Comparing with 2aa2e44

  • Dependency count: 1,156 (no change)
  • Package size: 281 MB ⬇️ 0.00% decrease vs. 2aa2e44
  • Number of ts-expect-error directives: 428 (no change)

@serhalp serhalp marked this pull request as ready for review April 17, 2025 13:47
@serhalp serhalp requested a review from a team as a code owner April 17, 2025 13:47
Copy link
Contributor

@ndhoule ndhoule left a comment

Choose a reason for hiding this comment

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

Nice! Small suggestion that would have caught this/would prevent regression.

serhalp added 2 commits April 23, 2025 14:07

Verified

This commit was signed with the committer’s verified signature.
serhalp Philippe Serhal

Verified

This commit was signed with the committer’s verified signature.
serhalp Philippe Serhal
@serhalp serhalp enabled auto-merge (squash) April 23, 2025 18:09
@serhalp serhalp merged commit 4938182 into main Apr 23, 2025
52 checks passed
@serhalp serhalp deleted the refactor/avoid-unnecessary-runtime-check-deploy branch April 23, 2025 18:25
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.

None yet

2 participants