Comments (8)
For the intellisense issue, one solution is to explicitly import the specific library, in case I know that the code is for the browser or node respectively. Eg:
import { mqtt, iot } from "aws-crt/dist.browser/browser";
provides the right intellisense suggestions.
from aws-crt-nodejs.
As the browser and the node library have different features/functionalities, it is impossible to make them the same. There will always be some gap between the two APIs. However, we will try our best to unify them.
We've added the task on our road map. Thank you to bring this up!
from aws-crt-nodejs.
Thank you for sharing the intellisense solution!
from aws-crt-nodejs.
Hi @massi-ang,
after reviewing the difference in the APIs. We figured there some missing API we can fix. As an example: new_websocket_builder was missing in browser library. Other than that, there is little we can do because of the difference behind browser and node connection.
Is there any specific interface you would like us to improve?
Let me know if you have any suggestions.
from aws-crt-nodejs.
Hi,
I understand that the native implementation supports some configurations that are not available in the browser implementation, but the common subset of the methods between the two implementations should have the same signatures.
from aws-crt-nodejs.
The main difference between Node library and Browser library is the way they setup the websocket. To satisfied the async design on browser side, we have to change how the websocket setup, which causes the API difference.
Besides the websocket configurations, there is also some mismatch on parameters. For example, with_socket_options
will take different SocketOptions as they are implemented differently on Node side and browser side. We do not have a way to unify them for now.
As for now, we will add new_builder_for_websocket
for API compatibility with the native version.
Here is a table of the current mismatched APIs:
Node | Browser | Status | Note |
---|---|---|---|
new_mtls_builder_from_path | -- | Invalid | Browser not support |
new_websocket_builder | new_builder_for_websocket | Mismatch | This function in Native directly calls new_with_websockets. |
new_mtls_windows_cert_store_path_builder | -- | Invalid | Browser not support |
new_mtls_pkcs11_builder | -- | Invalid | Browser not support |
with_certificate_authority_from_path | -- | Invalid | Browser not support |
with_certificate_authority | -- | Invalid | Browser not support |
with_protocol_operation_timeout_ms | -- | Invalid | Browser not support (Mqtt.js does not have a operation timeout settings for mqtt3) |
with_will | with_will | Different parameters | |
with_socket_options | with_socket_options | Different parameters | |
-- | with_websocket_headers | Invalid | The Node library implement the websocket configs in a different way. |
-- | with_credential_provider | Invalid | The Node library implements the credential provider in a different way. |
from aws-crt-nodejs.
Thank you.
from aws-crt-nodejs.
Closing issue here. Feel free to reopen it if you have further consideration related to the API.
from aws-crt-nodejs.
Related Issues (20)
- Lambda@Edge SigV4Asymmetric signing issue in Typescript for S3 Multi Region Access point MRAP HOT 4
- MqttConnection should refresh STS credentials for WSS connections on reconnect
- aws-crt mqtt library not working with Webpack 5 HOT 1
- Buffer constructor is deprecated (node) HOT 1
- Migrate browser samples to use aws-sdk v3
- Webpack build warning HOT 4
- Segmentation Fault immediately on require inside Worker threads on Linux HOT 6
- Improve error messages that are returned when an exception is thrown while attempting to subscribe in JS HOT 1
- upgrade axios to 1.x HOT 6
- Add Esbuild support HOT 15
- 'AWS Signer SigV4A Headers' unit test failing HOT 9
- yarn install for aws-crt-nodejs: CMake Error: CMAKE_C_COMPILER not set HOT 11
- Node binaries not loading from binding.js when hoisted to root of node_modules HOT 6
- IoT unsigned custom authentication builder broken HOT 10
- Support `aws-c-s3` HOT 1
- Default provider chain does not support SSO profile-defined credentials HOT 2
- upgrade axios to ^1.6.4 HOT 1
- IoT MQTT5 MqttConnectCustomAuthConfig has invalid typing for custom authorizer + browser HOT 14
- linux-arm64-musl pre built missing HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aws-crt-nodejs.