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

fix: canvas recording patches #1082

Merged
merged 3 commits into from
Mar 15, 2024
Merged

fix: canvas recording patches #1082

merged 3 commits into from
Mar 15, 2024

Conversation

daibhin
Copy link
Contributor

@daibhin daibhin commented Mar 14, 2024

Changes

Closes PostHog/posthog-flutter#69

Main aim is to support session recording in Flutter!

Does so in two ways:

Before After
Screenshot 2024-03-14 at 17 06 25 Screenshot 2024-03-14 at 17 06 08

Checklist

  • Tests for new code (see advice on the tests we use)
  • Accounted for the impact of any changes across different browsers
  • Accounted for backwards compatibility of any changes (no breaking changes in posthog-js!)

Copy link

github-actions bot commented Mar 14, 2024

Size Change: +459 B (0%)

Total Size: 942 kB

Filename Size Change
dist/array.full.js 224 kB +153 B (0%)
dist/recorder-v2.js 106 kB +153 B (0%)
dist/recorder.js 106 kB +153 B (0%)
ℹ️ View Unchanged
Filename Size
dist/array.js 124 kB
dist/es.js 124 kB
dist/exception-autocapture.js 12.1 kB
dist/module.js 124 kB
dist/surveys-module-previews.js 62 kB
dist/surveys.js 58.3 kB

compressed-size-action

@daibhin daibhin mentioned this pull request Mar 14, 2024
3 tasks
@daibhin daibhin requested a review from a team March 14, 2024 17:57
Copy link
Member

@pauldambra pauldambra left a comment

Choose a reason for hiding this comment

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

nice

I ended up switching off auto-formatting and finding out how to save without formatting no matter what to avoid adding lots of whitespacee to the patch

but that's nitpicky

@marandaneto
Copy link
Member

nice

I ended up switching off auto-formatting and finding out how to save without formatting no matter what to avoid adding lots of whitespacee to the patch

but that's nitpicky

yeah that sounds like a good idea, its also easier to review/less chance of conflicts

@pauldambra
Copy link
Member

@daibhin I did CMD + shift + P in vs code, found "save without formatting", and then bound some keys to it.

For me I bound CMD + S since I don't work in vscode full time. But then we'll see the diff of just the lines you changed

pretty plz and thank you 😊

Comment on lines 1172 to +1176
+ // The browser throws if the canvas is 0 in size
+ // Uncaught (in promise) DOMException: Failed to execute 'createImageBitmap' on 'Window': The source image width is 0.
+ // Assuming the same happens with height
+ if (canvas.width === 0 || canvas.height === 0) return;
+
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Moved this up based on rrweb-io/rrweb@d860a4b

@daibhin
Copy link
Contributor Author

daibhin commented Mar 15, 2024

@pauldambra done! TIL disabling Prettier requires VS Code to be restarted to take effect

@daibhin daibhin requested a review from pauldambra March 15, 2024 14:24
Copy link
Member

@pauldambra pauldambra left a comment

Choose a reason for hiding this comment

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

🚢

way nicer diff 😍

@daibhin daibhin added the bump patch Bump patch version when this PR gets merged label Mar 15, 2024
@daibhin daibhin merged commit 7dbde87 into main Mar 15, 2024
13 checks passed
@daibhin daibhin deleted the dn-fix/canvas-patches branch March 15, 2024 15:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bump patch Bump patch version when this PR gets merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Flutter Session Recordings (Android/iOS)
3 participants