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

Support Node V8 #124

Closed
vekexasia opened this issue Mar 12, 2018 · 1 comment
Closed

Support Node V8 #124

vekexasia opened this issue Mar 12, 2018 · 1 comment
Assignees
Projects

Comments

@vekexasia
Copy link
Contributor

Node V8 leverages several benefits against V6. For example async/await and class supports.

What we'll achieve

  • Possibly more speed
  • Less dependency on transpilation dependencies
  • Cleaner transpiled code
  • ...

What needs to be done:
Some tests are currently written using rewire and tests are failing cause rewire is trying to change a const variable. A solution was provided by rewire which involves transpiling the code using babel to rewrite const into let. After a little bit of investigation, the heavy lifting is done in lib/moduleEnv but only .js and .coffee extensions are registered leaving typescript untouched.

We should investigate and rewrite tests so that we don't leverage the use of rewire

@vekexasia vekexasia added this to To do in 1.1.0 via automation Mar 12, 2018
@mcanever
Copy link
Contributor

mcanever commented Mar 15, 2018

Unit tests to fix:

  • AppManager.spec.ts
  • apis
    • accountsAPI.spec.ts
    • blocksAPI.spec.ts
    • transactions.spec.ts
  • helpers
    • cache.spec.ts
    • config.spec.ts
    • database.spec.ts
    • ed.spec.ts
    • request-limiter.spec.ts
    • decorators
      • schemavalidators.spec.ts
  • logic
    • account.spec.ts
    • appState.spec.ts
    • block.spec.ts
    • peer.spec.ts
    • round.spec.ts
    • transaction.spec.ts
    • transactions
      • createmultisig.spec.ts
      • delegate.spec.ts
  • modules
    • cache.spec.ts
    • delegates.spec.ts
    • forge.spec.ts
    • transactions.spec.ts
    • transport.spec.ts

mcanever added a commit that referenced this issue Mar 16, 2018
- Set TypeScript target to es2017 (native async/await)
- Handled some weird TypeError appeared after switch to es2017 in:
  - modules/blocks/chain
  - modules/blocks/verify
- Added proxyquire do devDependencies
- Changed node_js to 8 in TravisCI configuration
- Migrated to proxyquire unit tests for
  - helpers/cache
  - helpers/config
  - helpers/ed
mcanever added a commit that referenced this issue Mar 17, 2018
- Move helpers/database Migrator class to its own file for testability
- Migrated a few new tests to proxyquire:
  - helpers/database
  - helpers/request-limiter
  - helpers/decorators/schemavalidators
mcanever added a commit that referenced this issue Mar 18, 2018
- Migrated more tests to proxyquire:
  - logic/account
  - logic/appState
  - logic/block
  - logic/peer
  - logic/round
  - logic/transaction
mcanever added a commit that referenced this issue Mar 21, 2018
- Migrated more tests to proxyquire:
  - apis/transactions
  - logic/transactions/createmultisic
  - logic/transactions/delegate
  - modules/cache
  - modules/delegates
  - modules/forge
  - modules/loader
  - modules/transactions
  - modules/transport
mcanever added a commit that referenced this issue Mar 22, 2018
- Migrated more tests to proxyquire:
  - AppManager
  - apis/accountsAPI
  - apis/blocksAPI

- fix ByteBuffer stub in tests/unit/logic/transactions/createmultisig
- Remove remaining references to rewire on logic/account.spec.ts
- Remove remaining references to rewire on modules/forge.spec.ts
- Remove remaining references to rewire on modules/loader.spec.ts
- Remove remaining references to rewire on modules/transactions.spec.ts
- Removed rewire from devDependecies
- Re-enabled tests in .travis.yml
mcanever added a commit that referenced this issue Mar 25, 2018
Fixed a couple issues that were preventing correct transpilation.
Fixed one test in transportAPI.spec.ts: stub was enqueued a response
instead of specifying that it needed to resolve.
@vekexasia vekexasia moved this from To do to In progress in 1.1.0 Apr 14, 2018
@vekexasia vekexasia moved this from In progress to Done in 1.1.0 Jul 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
1.1.0
  
Done
Development

No branches or pull requests

2 participants