Skip to content

Conversation

@EzraBrooks
Copy link
Collaborator

@EzraBrooks EzraBrooks commented Nov 17, 2025

fixes #1098

more removing ancient dependencies (that aren't exposed in our API) as I run through real-world usage of roslibjs 2.0 and encounter hurdles.

@EzraBrooks
Copy link
Collaborator Author

EzraBrooks commented Nov 18, 2025

I can confirm that this passes the PNG compression test locally that is currently disabled in CI due to #1061

Base automatically changed from switch-from-cbor-js-to-cbor2 to develop November 18, 2025 18:30
@EzraBrooks EzraBrooks force-pushed the use-standard-browser-uint8array branch from 2aa81e1 to 4e74a7d Compare November 18, 2025 18:31
@EzraBrooks EzraBrooks marked this pull request as ready for review November 18, 2025 18:31
@EzraBrooks EzraBrooks enabled auto-merge (squash) November 18, 2025 18:31
@EzraBrooks
Copy link
Collaborator Author

After this PR, we are back to being able to run in the browser from a CDN like so:

<head>
  <script type="importmap">
    {
      "imports": {
        "roslib": "https://unpkg.com/roslib@2.0.0/dist/RosLib.js",
        "bson": "https://unpkg.com/bson@7.0.0/lib/bson.mjs",
        "cbor2": "https://unpkg.com/cbor2@2.0.1/lib/index.js",
        "@cto.af/wtf8": "https://unpkg.com/@cto.af/wtf8@0.0.4/lib/index.js",
        "eventemitter3": "https://unpkg.com/eventemitter3@5.0.1/dist/eventemitter3.esm.js",
        "fast-png": "https://unpkg.com/fast-png@7.0.1/lib/index.js",
        "uuid": "https://unpkg.com/uuid@13.0.0/dist/index.js",
        "iobuffer": "https://unpkg.com/iobuffer@6.0.1/lib/iobuffer.js",
        "pako": "https://unpkg.com/pako@2.1.0/dist/pako.esm.mjs"
      }
    }
  </script>
  <script type="module">
    import { Ros } from "roslib";

    const ros = new Ros({
      url: "ws://localhost:9090",
    });

    ros.on("connection", () => {
      console.log("Connected to ROS!");
    });
  </script>
</head>

@EzraBrooks
Copy link
Collaborator Author

We can consider auto-generating that import map via jspm in the future so people can just point to that from a CDN as well.

@EzraBrooks EzraBrooks merged commit 762ec81 into develop Nov 18, 2025
14 checks passed
@EzraBrooks EzraBrooks deleted the use-standard-browser-uint8array branch November 18, 2025 19:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

buffer polyfill is not ESM-compatible and is unnecessary

3 participants