Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(replay): Bump rrweb to 2.32.0-dev.0 #14996

Draft
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

billyvg
Copy link
Member

@billyvg billyvg commented Jan 13, 2025

  • Merged upstream PRs to change build system to [mostly] use vite.

Ref getsentry/rrweb#234

Copy link
Contributor

github-actions bot commented Jan 13, 2025

size-limit report 📦

Path Size % Change Change
@sentry/browser 22.82 KB - -
@sentry/browser - with treeshaking flags 21.5 KB - -
@sentry/browser (incl. Tracing) 35.5 KB - -
@sentry/browser (incl. Tracing, Replay) 72.63 KB +0.51% +372 B 🔺
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 63.13 KB +0.55% +351 B 🔺
@sentry/browser (incl. Tracing, Replay with Canvas) 77.29 KB +1.01% +784 B 🔺
@sentry/browser (incl. Tracing, Replay, Feedback) 88.88 KB +0.39% +352 B 🔺
@sentry/browser (incl. Feedback) 39.06 KB - -
@sentry/browser (incl. sendFeedback) 27.46 KB - -
@sentry/browser (incl. FeedbackAsync) 32.25 KB - -
@sentry/react 25.54 KB - -
@sentry/react (incl. Tracing) 38.26 KB - -
@sentry/vue 26.95 KB - -
@sentry/vue (incl. Tracing) 37.23 KB - -
@sentry/svelte 22.97 KB - -
CDN Bundle 24.14 KB - -
CDN Bundle (incl. Tracing) 35.84 KB - -
CDN Bundle (incl. Tracing, Replay) 70.83 KB +0.53% +376 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) 75.98 KB +0.51% +389 B 🔺
CDN Bundle - uncompressed 70.4 KB - -
CDN Bundle (incl. Tracing) - uncompressed 106.04 KB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 217.53 KB +0.31% +681 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 230.07 KB +0.29% +681 B 🔺
@sentry/nextjs (client) 38.38 KB - -
@sentry/sveltekit (client) 36.03 KB - -
@sentry/node 161.22 KB - -
@sentry/node - without tracing 97.04 KB +0.01% +1 B 🔺
@sentry/aws-serverless 126.91 KB +0.01% +1 B 🔺

View base workflow run

@billyvg
Copy link
Member Author

billyvg commented Jan 13, 2025

Suspicious?
image

edit I ran yarn size-limit --save-bundle (note it only works with a single entry in .size-limit.js) and diff'ed the two bundles. There was no different in the diff so not sure what happened

Copy link

codecov bot commented Jan 15, 2025

❌ 1 Tests Failed:

Tests completed Failed Passed Skipped
695 1 694 299
View the top 1 failed tests by shortest run time
tracing/request/fetch/test.ts should create spans for fetch requests
Stack Traces | 10.1s run time
test.ts:7:11 should create spans for fetch requests

To view more test analytics, go to the Test Analytics Dashboard
📢 Thoughts on this report? Let us know!

* Merged upstream PRs to change build system to [mostly] use vite.
@billyvg billyvg force-pushed the ref-replay-bump-rrweb-2.32.0-vite-change branch from c288baf to ab4ee38 Compare January 15, 2025 18:39
@billyvg
Copy link
Member Author

billyvg commented Jan 15, 2025

  • Had to tweak output of rrweb bundles to be es2020
  • There's a mysterious enum thats getting pulled in, that I can't seem to find the source of:
  var dc, pc;
  (lc.mirror = uc),
    (lc.takeFullSnapshot = function (t) {
      if (!cc) throw new Error('please take full snapshot after start recording');
      cc(t);
    }),
    ((pc = dc || (dc = {}))[(pc.NotStarted = 0)] = 'NotStarted'),
    (pc[(pc.Running = 1)] = 'Running'),
    (pc[(pc.Stopped = 2)] = 'Stopped');
  const hc = 3;
  function mc(t) {
    return t > 9999999999 ? t : 1e3 * t;
  }
  function fc(t) {
    return t > 9999999999 ? t / 1e3 : t;
  }
  function gc(t, e) {
    'sentry.transaction' !== e.category &&

It seems to correspond with this block of imports

  try {
    if (2 !== Array.from([1], t => 2 * t)[0]) {
      const t = document.createElement('iframe');
      document.body.appendChild(t),
        (Array.from = t.contentWindow?.Array.from || Array.from),
        document.body.removeChild(t);
    }
  } catch (t) {
    console.debug('Unable to override Array.from', t);
  }
  var vl;
  new (class {
    constructor() {
      Gu(this, 'idNodeMap', new Map()), Gu(this, 'nodeMetaMap', new WeakMap());
    }
    getId(t) {
      if (!t) return -1;
      const e = this.getMeta(t)?.id;
      return e ?? -1;
    }
    getNode(t) {
      return this.idNodeMap.get(t) || null;
    }
    getIds() {
      return Array.from(this.idNodeMap.keys());
    }
    getMeta(t) {
      return this.nodeMetaMap.get(t) || null;
    }
    removeNodeFromMap(t) {
      const e = this.getId(t);
      this.idNodeMap.delete(e), t.childNodes && t.childNodes.forEach(t => this.removeNodeFromMap(t));
    }
    has(t) {
      return this.idNodeMap.has(t);
    }
    hasNode(t) {
      return this.nodeMetaMap.has(t);
    }
    add(t, e) {
      const n = e.id;
      this.idNodeMap.set(n, t), this.nodeMetaMap.set(t, e);
    }
    replace(t, e) {
      const n = this.getNode(t);
      if (n) {
        const t = this.nodeMetaMap.get(n);
        t && this.nodeMetaMap.set(e, t);
      }
      this.idNodeMap.set(t, e);
    }
    reset() {
      (this.idNodeMap = new Map()), (this.nodeMetaMap = new WeakMap());
    }
  })(),
    (function (t) {
      (t[(t.NotStarted = 0)] = 'NotStarted'), (t[(t.Running = 1)] = 'Running'), (t[(t.Stopped = 2)] = 'Stopped');
    })(vl || (vl = {}));

@billyvg
Copy link
Member Author

billyvg commented Jan 15, 2025

  • the enum comes from xstate
  • The mirror + Array.from polyfill are side-effects inside of record/index.ts -- in replayCanvas, when we import CanvasManager, we also pull in these side-effects. Previously, our rrweb bundle preserved modules (esm), and we were able to import only CanvasManager. Now our esm build outputs to a single file (default to vite).

@billyvg
Copy link
Member Author

billyvg commented Jan 16, 2025

Tried to have a separate CanvasManager entrypoint, but this breaks the tests due to the umd bundle require() the canvas manager module.

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.

1 participant