★ wanayoo — archive 1999 https://github.com/msgpack/msgpack-javascript/pull/136Nouvelle recherche | Portail wanayoo
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

[suggestion] chore: add annotation typescript usage in README #136

Merged
merged 1 commit into from Oct 4, 2020

Conversation

@bananaumai
Copy link
Contributor

@bananaumai bananaumai commented Oct 4, 2020 •

About

recommend enabling strict mode for avoiding type checking failure when using this library in TypeScript project.

Background

As I mentioned in #135 , I found the circumstance where the type checking for encode/decode function call fails.

That specifically happens when user defined context type is given to the ExtensionCodec.

const extensionCodec = new ExtensionCodec<UserDefinedContext>();

Solution

Set compilerOptions.strictNullChecks to true in tsconfig.json.

Acknowledgement

I'm not so familiar with TypeScript and still don't understand why this issue happens. (I'll follow up this phenomenon for my interest later)

* recommend enabling `strict` mode for avoiding type checking failure
@codecov-commenter
Copy link

@codecov-commenter codecov-commenter commented Oct 4, 2020 •

Codecov Report

Merging #136 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #136   +/-   ##
=======================================
  Coverage   98.29%   98.29%           
=======================================
  Files          15       15           
  Lines         936      936           
  Branches      205      205           
=======================================
  Hits          920      920           
  Misses         16       16           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6ed7993...0709254. Read the comment docs.

@gfx
Copy link
Member

@gfx gfx commented Oct 4, 2020

Nice catch!

I'm not sure why strictNullChecks to compile, neither. Hopefully, this library works without strictNullChecks, but this explanation should help users for the time being.

@gfx gfx merged commit 9626ff5 into msgpack:master Oct 4, 2020
2 checks passed
2 checks passed
codecov/project 98.29% (target 90.00%)
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@bananaumai bananaumai deleted the bananaumai:add-readme-annotation-for-ts branch Oct 5, 2020
bananaumai added a commit to bananaumai/msgpack-javascript that referenced this pull request Oct 10, 2020
This commit intends to fix the issue reported on msgpack#136
bananaumai added a commit to bananaumai/msgpack-javascript that referenced this pull request Oct 10, 2020
This commit intends to fix the issue reported on msgpack#136
bananaumai added a commit to bananaumai/msgpack-javascript that referenced this pull request Oct 10, 2020
This commit intends to fix the issue reported on msgpack#136
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.