Giter VIP home page Giter VIP logo

Comments (8)

massi-ang avatar massi-ang commented on September 27, 2024 1

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.

xiazhvera avatar xiazhvera commented on September 27, 2024

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.

xiazhvera avatar xiazhvera commented on September 27, 2024

Thank you for sharing the intellisense solution!

from aws-crt-nodejs.

xiazhvera avatar xiazhvera commented on September 27, 2024

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.

massi-ang avatar massi-ang commented on September 27, 2024

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.

xiazhvera avatar xiazhvera commented on September 27, 2024

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.

massi-ang avatar massi-ang commented on September 27, 2024

Thank you.

from aws-crt-nodejs.

xiazhvera avatar xiazhvera commented on September 27, 2024

Closing issue here. Feel free to reopen it if you have further consideration related to the API.

from aws-crt-nodejs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.