-
Notifications
You must be signed in to change notification settings - Fork 220
feat: move posthog-rrweb into the JS monorepo #2815
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -67,9 +67,9 @@ | |
| "@jest/globals": "^29.7.0", | ||
| "@playwright/test": "^1.52.0", | ||
| "@posthog-tooling/rollup-utils": "workspace:*", | ||
| "@posthog/rrweb-plugin-console-record": "^0.0.34", | ||
| "@posthog/rrweb-record": "^0.0.34", | ||
| "@posthog/rrweb-types": "^0.0.34", | ||
| "@posthog/rrweb-plugin-console-record": "workspace:*", | ||
| "@posthog/rrweb-record": "workspace:*", | ||
| "@posthog/rrweb-types": "workspace:*", | ||
|
Comment on lines
+70
to
+72
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This probably deserves a patch bump? |
||
| "@rollup/plugin-babel": "^6.0.4", | ||
| "@rollup/plugin-commonjs": "^28.0.6", | ||
| "@rollup/plugin-json": "^6.1.0", | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| module.exports = { | ||
| root: true, | ||
| extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended'], | ||
| parser: '@typescript-eslint/parser', | ||
| plugins: ['@typescript-eslint'], | ||
| env: { | ||
| browser: true, | ||
| es2020: true, | ||
| node: true, | ||
| }, | ||
| rules: { | ||
| // Disable prettier - rrweb formatting is normalized separately | ||
| 'prettier/prettier': 'off', | ||
| // Disable rules that conflict with rrweb's codebase | ||
| '@typescript-eslint/no-explicit-any': 'off', | ||
| '@typescript-eslint/no-unused-vars': 'off', | ||
| '@typescript-eslint/ban-ts-comment': 'off', | ||
| '@typescript-eslint/no-non-null-assertion': 'off', | ||
| '@typescript-eslint/no-empty-function': 'off', | ||
| '@typescript-eslint/no-this-alias': 'off', | ||
| '@typescript-eslint/no-unused-expressions': 'off', | ||
| '@typescript-eslint/no-require-imports': 'off', | ||
| 'no-prototype-builtins': 'off', | ||
| 'no-useless-escape': 'off', | ||
| 'no-empty': 'off', | ||
| 'prefer-const': 'off', | ||
| 'no-constant-condition': 'off', | ||
| 'no-extra-semi': 'off', | ||
| 'no-var': 'off', | ||
| 'no-global-assign': 'off', | ||
| // posthog-js specific rules that don't apply to rrweb | ||
| 'posthog-js/no-direct-array-check': 'off', | ||
| 'posthog-js/no-direct-boolean-check': 'off', | ||
| 'posthog-js/no-direct-document-check': 'off', | ||
| 'posthog-js/no-direct-function-check': 'off', | ||
| 'posthog-js/no-direct-navigator-check': 'off', | ||
| 'posthog-js/no-direct-null-check': 'off', | ||
| 'posthog-js/no-direct-number-check': 'off', | ||
| 'posthog-js/no-direct-object-check': 'off', | ||
| 'posthog-js/no-direct-string-check': 'off', | ||
| 'posthog-js/no-direct-undefined-check': 'off', | ||
| 'posthog-js/no-direct-window-check': 'off', | ||
| 'compat/compat': 'off', | ||
| }, | ||
| ignorePatterns: ['dist/', 'node_modules/', '*.js', '*.cjs', '*.mjs'], | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| # PostHog's copy of RRWeb | ||
|
|
||
| this is open because we believe in open source, | ||
| and we want to be able to contribute back to upstream rrweb and refer back to this when we do | ||
|
|
||
| # but please don't use it yourself | ||
|
|
||
| all changes will be only focussed on posthog and we won't make any effort to support anybody else using this | ||
|
|
||
| if you say "i started using this, you changed it, and now my thing broke" | ||
| we will say "we told you not to use it" | ||
|
|
||
| The upstream rrweb is here https://github.com/rrweb-io/rrweb | ||
|
|
||
| ## Is it an exact fork? | ||
|
|
||
| No, there are packages we don't need such as the svelte player and rr-video | ||
| So, we deleted them... | ||
|
|
||
| ## Hello internal PostHog folk | ||
|
|
||
| We build this and publish it to NPM so that we can use it in posthog-js | ||
|
|
||
| If you want to contribute a change back to upstream rrweb | ||
| then you need to open a person fork and contribute from there | ||
|
Comment on lines
+20
to
+25
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe explain why do we need to do this versus just using the upstream? mention they're slow to take upstreams, etc, etc. etc. |
||
|
|
||
| ### How to use it... | ||
|
|
||
| 1. `pnpm install` to, erm, install | ||
| 2. `pnpm build:all` to get a stable base built | ||
| 3. `pnpm dev` to get auto building of changed things while making changes | ||
| 4. `pnpm test` to run the tests | ||
| 5. `pnpm test:update` to update snapshots if necessary | ||
|
|
||
| # FAQ | ||
|
|
||
| - does this mean you're planning on stopping using RRWEB? | ||
| - no | ||
| - can I use this repo? | ||
| - unless you are contributing changes for posthog, no | ||
| - should I sponsor rrweb? | ||
| - absolutely, yes. we do, you should too, it's great | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| .turbo | ||
| dist | ||
| node_modules | ||
| yarn-error.log |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| # @rrweb/all | ||
|
|
||
| ## 2.0.0-alpha.18 | ||
|
|
||
| ### Patch Changes | ||
|
|
||
| - [#1593](https://github.com/rrweb-io/rrweb/pull/1593) [`5a78938`](https://github.com/rrweb-io/rrweb/commit/5a789385a341311ba327a768fe0e2f0f2f5002ee) Thanks [@daibhin](https://github.com/daibhin)! - `NodeType` enum was moved from rrweb-snapshot to @rrweb/types | ||
| The following types where moved from rrweb-snapshot to @rrweb/types: `documentNode`, `documentTypeNode`, `legacyAttributes`, `textNode`, `cdataNode`, `commentNode`, `elementNode`, `serializedNode`, `serializedNodeWithId`, `serializedElementNodeWithId`, `serializedTextNodeWithId`, `IMirror`, `INode`, `mediaAttributes`, `attributes` and `DataURLOptions` | ||
| - Updated dependencies [[`04ee6ed`](https://github.com/rrweb-io/rrweb/commit/04ee6eda57157f0e04f18f907d8f3e59ababc753), [`5fbb904`](https://github.com/rrweb-io/rrweb/commit/5fbb904edb653f3da17e6775ee438d81ef0bba83), [`5a78938`](https://github.com/rrweb-io/rrweb/commit/5a789385a341311ba327a768fe0e2f0f2f5002ee), [`53b83bb`](https://github.com/rrweb-io/rrweb/commit/53b83bb037f9cb30c93179548f436ed776f143ab)]: | ||
| - [email protected] | ||
| - @rrweb/[email protected] | ||
| - @rrweb/[email protected] | ||
|
|
||
| ## 2.0.0-alpha.17 | ||
|
|
||
| ### Patch Changes | ||
|
|
||
| - [`db20184`](https://github.com/rrweb-io/rrweb/commit/db201841accd2b5df3cd7c88779aa62ab158501c) Thanks [@Juice10](https://github.com/Juice10)! - Keep package version in sync with other packages | ||
|
|
||
| - Updated dependencies [[`db20184`](https://github.com/rrweb-io/rrweb/commit/db201841accd2b5df3cd7c88779aa62ab158501c), [`40bbc25`](https://github.com/rrweb-io/rrweb/commit/40bbc25fc287badc317a53f2d3f21b1c9f2b211b), [`68076b7`](https://github.com/rrweb-io/rrweb/commit/68076b724ff19d198d4f351a05063b85e1705a8c), [`8059d96`](https://github.com/rrweb-io/rrweb/commit/8059d9695146626b102b2059a3a9b932d5f598f6), [`335639a`](https://github.com/rrweb-io/rrweb/commit/335639af9b0ce7f70eb0f38ce113d877c7325158), [`be6bf52`](https://github.com/rrweb-io/rrweb/commit/be6bf52c248c35de1b3491e3a3440ff61f876414)]: | ||
| - @rrweb/[email protected] | ||
| - [email protected] | ||
| - @rrweb/[email protected] | ||
|
|
||
| ## 2.0.0-alpha.15 | ||
|
|
||
| ### Major Changes | ||
|
|
||
| - [#1497](https://github.com/rrweb-io/rrweb/pull/1497) [`2606a2a`](https://github.com/rrweb-io/rrweb/commit/2606a2a28f2a6d897b8ae4ea3ec40ef0eeacbfaf) Thanks [@Juice10](https://github.com/Juice10)! - Distributed files have new filenames, paths and extensions. **Important: If you reference distributed files or types directly, you might have to update your paths/filenames. E.g. you import from `rrweb/typings/...` or `rrdom/es`. However you run `import rrweb from '@posthog/rrweb'` you won't notice a difference with this change.** If you include rrweb files directly in a script tag, you might have to update that path to include a the `.umd.cjs` files instead. All `.js` files now use ES modules which can be used in modern browsers, node.js and bundlers that support ES modules. All npm packages now also ship `.cjs` and `.umd.cjs` files. The `.umd.cjs` files are CommonJS modules that bundle all files together to make it easy to ship one file to browser environments (similar to the previous `.js` files). The `.cjs` files are CommonJS modules that can be used in older Node.js environments. Types should be better defined in `package.json` and if you need specific types they might be exported from new packages (for example `PlayerMachineState` and `SpeedMachineState` are now exported from `@rrweb/replay`). Check the `package.json`'s `main` and `exports` field for the available files. | ||
|
|
||
| - [#1497](https://github.com/rrweb-io/rrweb/pull/1497) [`2606a2a`](https://github.com/rrweb-io/rrweb/commit/2606a2a28f2a6d897b8ae4ea3ec40ef0eeacbfaf) Thanks [@Juice10](https://github.com/Juice10)! - Remove the rrweb-all.js, rrweb-record.js, and rrweb-replay.js files from `rrweb` package. Now you can use `@rrweb/all`, `@rrweb/record`, and `@rrweb/replay` packages instead. Check out the README of each package for more information or check out [PR #1033](https://github.com/rrweb-io/rrweb/pull/1033) to see the changes. | ||
|
|
||
| ### Patch Changes | ||
|
|
||
| - Updated dependencies [[`7261c43`](https://github.com/rrweb-io/rrweb/commit/7261c43f60973e88325edf832e4d0e057fbff0ae), [`4014305`](https://github.com/rrweb-io/rrweb/commit/40143059446cee5c042c007b1c2e976f36e172f5), [`609b7fa`](https://github.com/rrweb-io/rrweb/commit/609b7fac79a552f746dc880a28927dee382cd082), [`82f6fec`](https://github.com/rrweb-io/rrweb/commit/82f6fecf36413ecbc994a510144487f1de20d1d5), [`2606a2a`](https://github.com/rrweb-io/rrweb/commit/2606a2a28f2a6d897b8ae4ea3ec40ef0eeacbfaf), [`2606a2a`](https://github.com/rrweb-io/rrweb/commit/2606a2a28f2a6d897b8ae4ea3ec40ef0eeacbfaf), [`5c27b76`](https://github.com/rrweb-io/rrweb/commit/5c27b763192bda9dd91806f95df7c1cd0ab083a6), [`d38893f`](https://github.com/rrweb-io/rrweb/commit/d38893f6338facf331fd1f6e63c121120b81177d), [`d7cf8dd`](https://github.com/rrweb-io/rrweb/commit/d7cf8dd07547f6fb22ef82e341a88357c4053bd3), [`2606a2a`](https://github.com/rrweb-io/rrweb/commit/2606a2a28f2a6d897b8ae4ea3ec40ef0eeacbfaf), [`e08706a`](https://github.com/rrweb-io/rrweb/commit/e08706ae60268b6eb05c6292ef948c71bd423ce3)]: | ||
| - [email protected] | ||
| - @rrweb/[email protected] | ||
| - @rrweb/[email protected] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not use changesets for it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think the release workflow will work well if we're not using changesets :thinking_face:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah! so, we don't need (i don't think) to release all these packages because we don't use them
we only ever import these in posthog for replay and for that we're using the main
rrwebpackage.so, we should get a subset of the total number of rrweb packages released and then be able to import those in the main posthog app
(i'm assuming this won't work the way i expect and will need a few tries to get right)
(TL;DR rrweb publishes tonnes of packages but we don't need to release them all i believe)