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

Deprecate trivial node type check helpers #1720

merged 1 commit into from Dec 29, 2022


Copy link

@bmish bmish commented Dec 29, 2022

This has come up a bunch recently and been an issue I have wanted to solve for a long time.

Trivial helpers in this file that only check a node's existence and/or type are deprecated in favor of inlining that check. We don't need a function for every type of node. We should inline these trivial checks and only check for node existence when it's actually a possibility a node might not exist.

And as written, these functions won't correctly narrow the type of the node, which we would need if we incorporate TypeScript: #1613

Removing these trivial functions would also help prepare for future TypeScript incorporation:

@bmish bmish added the Internal label Dec 29, 2022
@bmish bmish changed the title Deprecate trivial node type checks Deprecate trivial node type check helpers Dec 29, 2022
@bmish bmish requested a review from lin-ll December 29, 2022 19:31
Copy link

@lin-ll lin-ll left a comment

Choose a reason for hiding this comment

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

Looks great to me

@bmish bmish merged commit 78cbc5a into ember-cli:master Dec 29, 2022
8 checks passed
@bmish bmish deleted the deprecate-trivial-node-type-checks branch December 29, 2022 19:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet

Successfully merging this pull request may close these issues.

None yet

2 participants