Skip to content

Conversation

@EzraBrooks
Copy link
Collaborator

Public API Changes

Added new endpoint for CDN users.

Description

Amazing how little I cared about CDN usage until someone (at my own company, no less) actually asked about it 😉

TL;DR the "import map" allows us to provide an all-in-one script for CDN users even without bundling our dependencies into our library. It tells their runtime to go grab all the dependencies from the CDN as well.

This PR makes it possible to reference roslib and all its dependencies like so:

<head>
  <script src="https://unpkg.com/[email protected]/importmap.js"></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>

package.json Outdated
"test": "vitest",
"prepublishOnly": "npm run test",
"prepare": "npm run build",
"//": "The manual resolution for eventemitter3 is because the package metadata is incorrect in EventEmitter3's package.json",
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

apparently eventemitter3 is now just as unmaintained as eventemitter2 was when I moved us to 3 :(

@EzraBrooks

This comment was marked as resolved.

@EzraBrooks EzraBrooks force-pushed the generate-importmap-for-cdn-users branch from 0e84792 to 0251e66 Compare November 18, 2025 20:04
@EzraBrooks

This comment has been minimized.

@EzraBrooks
Copy link
Collaborator Author

See #1102 for evidence of it working.

@EzraBrooks EzraBrooks merged commit baa09fd into develop Nov 19, 2025
14 checks passed
@EzraBrooks EzraBrooks deleted the generate-importmap-for-cdn-users branch November 19, 2025 17:22
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.

3 participants