Skip to content

Commit

Permalink
VBLOCKS-1301 Support node versions 16 and above. (twilio#169)
Browse files Browse the repository at this point in the history
* VBLOCKS-1301 Support node versions 16 and above.
* VBLOCKS-1301 Removing --legacy-peer-deps flag from circleci jobs.
* VBLOCKS-1301 Updating package "twilio" to 3.84.1, which does not depend on express. Hence, no need to add the "types" config to the TypeScript compiler.
  • Loading branch information
manjeshbhargav authored Jun 7, 2023
1 parent e375c4b commit acfca74
Show file tree
Hide file tree
Showing 10 changed files with 1,180 additions and 13,458 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ commands:
key: dependency-cache-{{ checksum "package.json" }}
- run:
name: Installing dependencies
command: node -v && npm install --legacy-peer-deps
command: node -v && npm install
- save_cache:
key: dependency-cache-{{ checksum "package.json" }}
paths:
Expand Down
2 changes: 1 addition & 1 deletion .circleci/images/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ services:
- /opt/app/node_modules
integrationTests: # runs integration tets. Expects that sources are mounted.
<<: *runtimeDefaults
command: bash -c "npm install --legacy-peer-deps && npm run build && ls -la /root && ls -la /root/.npm && npm run test:network"
command: bash -c "npm install && npm run build && ls -la /root && ls -la /root/.npm && npm run test:network"
bash: # runs bash shell inside container. helpful for debugging
<<: *runtimeDefaults
command: bash
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
Changes
-------

- The SDK now builds on NodeJS versions 16 and above without the `--legacy-peer-deps` flag.
- Removed usage of NodeJS modules from the SDK and some dependencies. With this change, the SDK should now work with some of the latest frameworks that use the latest versions of bundlers such as Vite and Webpack.
- Removed unnecessary files from the generated npm package.
- Links to source maps are now included in the generated npm package.
Expand Down
3 changes: 1 addition & 2 deletions lib/twilio/errors/generated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
/**
* @packageDocumentation
* @module Voice
* @publicapi
* @internal
* @internalapi
*/

/**
Expand Down
9 changes: 5 additions & 4 deletions lib/twilio/statsMonitor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ class StatsMonitor extends EventEmitter {
/**
* The setInterval id for fetching samples.
*/
private _sampleInterval: NodeJS.Timer;
private _sampleInterval?: NodeJS.Timer;

/**
* Keeps track of supplemental sample values.
Expand Down Expand Up @@ -232,9 +232,10 @@ class StatsMonitor extends EventEmitter {
* @returns The current {@link StatsMonitor}.
*/
disable(): this {
clearInterval(this._sampleInterval);
delete this._sampleInterval;

if (this._sampleInterval) {
clearInterval(this._sampleInterval);
delete this._sampleInterval;
}
return this;
}

Expand Down
Loading

0 comments on commit acfca74

Please sign in to comment.