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

fix: correct interface properties and methods #213

Merged
merged 5 commits into from
Nov 29, 2021

Conversation

kitsonk
Copy link
Contributor

@kitsonk kitsonk commented Nov 28, 2021

A couple of tweaks of the interface properties and methods in the documents to properly represent them.

Copy link
Member

@lucacasonato lucacasonato left a comment

Choose a reason for hiding this comment

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

LGTM!

Comment on lines +19 to +21
pub(crate) fn is_false(b: &bool) -> bool {
!b
}
Copy link
Member

Choose a reason for hiding this comment

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

Oof 🙈

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is there a better way?

Just trying to strip out "useless" fields from the JSON serialization, as with large doc structures, it becomes a "problem". lib.dom.d.ts for example is 9.9mb serialized. 😱

Copy link
Member

Choose a reason for hiding this comment

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

I feel like we should use this and stuff like skip_serializing_if = "Option::is_none" liberally one day.

Copy link
Member

Choose a reason for hiding this comment

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

Is there a better way?

No, I think this is right. Still pretty funny though 😅

@kitsonk kitsonk changed the title fix: properly interface properties fix: correct interface properties and methods Nov 28, 2021
@@ -9,6 +9,7 @@ use crate::js_doc::JsDoc;
use crate::node::DeclarationKind;
use crate::params::ts_fn_param_to_param_def;
use crate::swc_util::get_location;
use crate::swc_util::is_false;
Copy link
Member

Choose a reason for hiding this comment

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

No big deal, but this isn't really related to swc.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There was no other good place to put it and I wasn't going to just create another module for it.

Copy link
Member

@dsherret dsherret left a comment

Choose a reason for hiding this comment

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

LGTM

@kitsonk kitsonk merged commit cc14e65 into denoland:main Nov 29, 2021
@kitsonk kitsonk deleted the fix_interfaces branch November 29, 2021 22: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

3 participants