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

Use private fields for Variant class #94

Closed
wants to merge 6 commits into from
Closed

Conversation

cmdcolin
Copy link
Contributor

Private class fields are natively supported on nodejs v12+

Previously we were transpiling down to es5 to maintain nodejs compatibility, but es5 could not have private class fields transpiled down. But, in this PR, I propose --module commonjs instead of --target es5 for nodejs compatibility

There are a couple other small refactors but that is the main one

Possibly having less transpilation could improve some performance under node in e.g. vcf-bench. Not an urgent PR, just an idea

@codecov
Copy link

codecov bot commented Aug 22, 2022

Codecov Report

Merging #94 (2e742a8) into master (8d5c951) will increase coverage by 0.38%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master      #94      +/-   ##
==========================================
+ Coverage   96.33%   96.71%   +0.38%     
==========================================
  Files           3        3              
  Lines         218      213       -5     
  Branches       87       81       -6     
==========================================
- Hits          210      206       -4     
+ Misses          8        7       -1     
Impacted Files Coverage Δ
src/parse.ts 97.66% <100.00%> (+0.50%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@cmdcolin
Copy link
Contributor Author

cmdcolin commented Sep 6, 2022

not a super big speedup but about a 20% faster (~13 vs ~16 seconds on my machine) compared to master branch on the vcf-bench https://github.com/brentp/vcf-bench

@cmdcolin
Copy link
Contributor Author

one other improvement of this PR is a bit better typescript typing on the Variant object type, currently it's an "any"

@garrettjstevens
Copy link
Contributor

For reference the suggested compiler options for Node 12 are:

{
  "compilerOptions": {
    "lib": ["ES2019"],
    "module": "commonjs",
    "target": "ES2019"
  }
}

From here: https://github.com/microsoft/TypeScript/wiki/Node-Target-Mapping

@cmdcolin
Copy link
Contributor Author

updated :) i leave out module because i use it in the package.json --module field

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