whereby / browser-sdk

Browser SDK for Whereby Embedded
MIT License
24 stars 3 forks source link

Final tweaks before removing the beta tag #192

Closed havardholvik closed 8 months ago

havardholvik commented 8 months ago

Description

Some small adjustments before the 2.0.0 release:

NOTE! A follow-up PR will be required to also make some adjustments to the support/v1 branch so legacy builds are put in dist/cdn, as the deployment workflow changes will affect any release.

Testing

  1. Create a simple web page, something like
<html>
  <head>
    <script src="https://cdn.srv.whereby.com/embed/v1.js" type="module"></script>
  </head>

  <body>
    <whereby-embed id="room" room="<YOUR ROOM" />
    <script type="text/javascript">
      const room = document.getElementById("room");

      room.addEventListener("ready", () => console.log("READY!"));
      room.addEventListener("join", () => console.log("JOINED"));
    </script>
  </body>
</html>
  1. Start a webserver in the dir of the index.html (I use a global npm package http-server)
  2. Visit the root of your webpage, verify you see the embedded room and you are able to join
  3. Check out this branch, do yarn build
  4. Copy dist/cdn/v2-embed.js next to your index.html
  5. Update the index.html to use the v2-embed.js file
  6. Refresh, verify you get the embedded room
  7. Try joining, verify you see JOINED in the console
  8. In your index.html, remove type="module" in the script tag
  9. Refresh, verify you are still able to embed and join
  10. In the console, verify you have a whereby global variable with the SDK version