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

Build in commonjs_strict mode #269

Merged
merged 1 commit into from
Aug 13, 2020

Conversation

ChALkeR
Copy link
Contributor

@ChALkeR ChALkeR commented Aug 11, 2020

package statements removed from protocols, since in strict mode the whole namespace is exported instead of the package, and keeping the packages would have required changes in all js files that import protocols.

Had to rename one ConsensusService -> MirrorConsensusService, as there were two different entities named ConsensusService.

This mostly solves #267, apart from #268. I.e. with this patch, the only thing that remains polluting the global scope is:

> proto
{
  google: {
    protobuf: {
      BoolValue: [Function],
      BytesValue: [Function],
      DoubleValue: [Function],
      FloatValue: [Function],
      Int32Value: [Function],
      Int64Value: [Function],
      StringValue: [Function],
      UInt32Value: [Function],
      UInt64Value: [Function]
    }
  }
}

which comes fromgoogle/protobuf/wrappers.proto (see #268).

package statements removed from protocols, since in strict mode
the whole namespace is exported instead of the package, and keeping the
packages would have required changes in all js files that import protocols.

Had to rename one ConsensusService -> MirrorConsensusService, as there were
two different entities named ConsensusService.

Signed-off-by: Сковорода Никита Андреевич <chalkerx@gmail.com>
@mehcode
Copy link
Contributor

mehcode commented Aug 13, 2020

Thanks for the change here. I completely agree that commonjs_strict is the right way to do this. I was unaware it existed myself.

@mehcode mehcode merged commit 3115f82 into hashgraph:master Aug 13, 2020
@mehcode
Copy link
Contributor

mehcode commented Aug 13, 2020

Interestingly enough, this did break everything.

UNIMPLEMENTED: Method not found: CryptoService/cryptoGetBalance

All transactions report UNIMPLEMENTED now.

@ChALkeR
Copy link
Contributor Author

ChALkeR commented Aug 13, 2020

Hm. This is interesting, as this was loaded correctly and test:unit passed. I'll check what's going on there.

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