{"id":19362695,"url":"https://github.com/smartdevicelink/sdl_javascript_suite","last_synced_at":"2025-04-23T12:33:07.253Z","repository":{"id":37476383,"uuid":"191231656","full_name":"smartdevicelink/sdl_javascript_suite","owner":"smartdevicelink","description":"SmartDeviceLink library for applications developed in JavaScript","archived":false,"fork":false,"pushed_at":"2023-09-25T20:40:21.000Z","size":172972,"stargazers_count":15,"open_issues_count":22,"forks_count":12,"subscribers_count":6,"default_branch":"develop","last_synced_at":"2025-04-02T15:21:18.606Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/smartdevicelink.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-06-10T19:20:07.000Z","updated_at":"2023-01-31T11:10:20.000Z","dependencies_parsed_at":"2024-11-10T07:30:17.768Z","dependency_job_id":"4aa8f54a-affa-4e77-bb04-bf14ceb49db1","html_url":"https://github.com/smartdevicelink/sdl_javascript_suite","commit_stats":null,"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smartdevicelink%2Fsdl_javascript_suite","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smartdevicelink%2Fsdl_javascript_suite/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smartdevicelink%2Fsdl_javascript_suite/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smartdevicelink%2Fsdl_javascript_suite/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/smartdevicelink","download_url":"https://codeload.github.com/smartdevicelink/sdl_javascript_suite/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250435247,"owners_count":21430245,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-10T07:29:56.275Z","updated_at":"2025-04-23T12:33:02.243Z","avatar_url":"https://github.com/smartdevicelink.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# sdl_javascript_suite\nSmartDeviceLink library for applications developed in JavaScript\n\nBackground details for creation of repository can be found in the SDL Evolution Proposal [SDL 0235 - SDL JavaScript library](https://github.com/smartdevicelink/sdl_evolution/issues/742).  Initial implementation details can be found below.\n\n## Proposed solution\n\nThe solution is to create a common JavaScript library that offers a public proxy object to send and receive RPCs. The library also requires implementations of all the other layers required to package and frame the data and send it over a defined transport.\n\n### SDL library layers\n\nLooking into the existing libraries, developed in Java and Objective-C, they contain the following superset of layers:\n\n1. The **High Level Interface** is a work-in-progress developer friendly API with the purpose to provide a programming interface similar to mobile frameworks.\n2. The **Manager layer** is the current programming interface that abstracts the heavy load of dealing with application lifecycle, screen, dealing with RPCs and many more.\n3. The **Proxy layer** also known as RPC layer, is the lower level interface with the purpose of managing the connection to the remote endpoint and sending and receiving RPCs. The [RPC specification](https://github.com/smartdevicelink/rpc_spec) of the mobile API is implemented in this layer.\n4. The **SDL Session layer** is responsible for the lifecycle of service sessions for e.g. RPC/Bulk, video and audio. It packages application data and sends it to the protocol layer.\n5. The **SDL protocol layer** is responsible for organizing the sending and receiving of frames as per the [Protocol specification](https://github.com/smartdevicelink/protocol_spec)\n6. The **transport layer** is the root level of SmartDeviceLink and therefore the most critical layer as it is responsible for the foundation of data transmission.\n\nIt is not realistic to develop a new SDL library that can provide the same set of features as the Android and iOS library all at once. Therefore it is important to focus on a \"milestone 1\" which includes the following fundamental elements:\n\n#### Included tasks in this proposal\n\n**1. Proxy layer**\n\nProvide a Proxy class and implementations of all RPCs according to the [RPC specification v5.1](https://github.com/smartdevicelink/rpc_spec/tree/5.1.0). As this specification is XML structured it makes sense to develop a code generator to export all the RPCs, structs and enums to usable code.\n\n**2. SDL Session layer and Protocol layer**\n\nIn the first milestone the JavaScript library should support the RPC and Bulk service types for communication. Media and projection applications may not be supported in the first release.\n\nAn open source BSON libray developed in JavaScript should be used by the SDL JavaScript library. If there is no suitable 3rd party BSON library available, a new BSON library will be created according to the specification of [bsonspec.org](http://bsonspec.org/#/specification).\n\n**3. Transport layer**\n\nThe first release should come with a base/abstract definition of the transport layer. Based on this definition a WebSocket Server transport described in [Cloud App Transport Adapter](https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0158-cloud-app-transport-adapter.md) should be implemented with this proposal. Additionally a TCP socket client transport should be implemented for development purposes. Both transports should be implemented for Node.js runtime.\n\n#### Manager layer\n\nThe first managers that should be introduced in future proposals should be a lifecycle manager and the file manager. Other managers (screen manager etc.) should be added in future releases.\n\nThis proposal does not include a manager layer. Managers will be introduced via new proposals.\n\n### Promise based development\n\nJust as the other existing libraries, the JavaScript library requires possibilities to perform async operations. JavaScript is very well capable of serving this task especially with using the Promise pattern.\n\nThere are many sources describing the Promise pattern with JavaScript and how it is used already in the native API and other libraries and frameworks. See [Mozilla: Promise](https://developer.mozilla.org/de/docs/Web/JavaScript/Reference/Global_Objects/Promise) and [You Don't Know JS - Promises](https://github.com/getify/You-Dont-Know-JS/blob/master/async%20%26%20performance/ch3.md)\n\n### Project management\n\nThe JavaScript library will be open source and stored in a new smartdevicelink repository on GitHub called sdl_javascript_suite. The project maintainers will be responsible for maintaining and reviewing the code and the project.\n\nThe development should be done in JavaScript (not TypeScript) following ECMA-Script 2017. All the base source code should be developed using [JavaScript standard built-in objects](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects).\n\nThe transport related source code for Node.js can use Node specific libraries needed (like socket.io). This code should be stored in a separate folder from the base source code in the repository.\n\n### Building the Project\nNodeJS, npm, and Python3 are required:\n\n```js\ngit submodule init\ngit submodule update\nnpm install\nnpm run build\n```\n\nThe output will be in the `dist` folder. There is a vanilla JS and a NodeJS build, which can be placed into the corresponding example apps in the `examples` folder to test out the library.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmartdevicelink%2Fsdl_javascript_suite","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsmartdevicelink%2Fsdl_javascript_suite","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmartdevicelink%2Fsdl_javascript_suite/lists"}