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

🚚 move recorder modules #846

Merged
merged 6 commits into from
May 14, 2021
Merged

Conversation

BenoitZugmeyer
Copy link
Member

@BenoitZugmeyer BenoitZugmeyer commented May 14, 2021

Motivation

As a follow up of #842 , I wanted to move "recorder" source files a bit to have a clearer module hierarchy.

Changes

Proposed new hierarchy (not showing spec files):

packages/rum-recorder/src
├── boot
│   ├── recorder.entry.ts
│   ├── recorder.ts
│   └── rumRecorderPublicApi.ts
├── domain
│   ├── record
│   │   ├── index.ts
│   │   ├── mutationBatch.ts
│   │   ├── mutationObserver.ts
│   │   ├── observer.ts
│   │   ├── privacy.ts
│   │   ├── record.ts
│   │   ├── serializationUtils.ts
│   │   ├── serialize.ts
│   │   ├── types.ts
│   │   └── utils.ts
│   └── segmentCollection
│       ├── deflateWorker.d.ts
│       ├── deflateWorker.js
│       ├── index.ts
│       ├── segment.ts
│       └── segmentCollection.ts
├── transport
│   └── send.ts
├── constants.ts
├── index.ts
├── internal.ts
└── types.ts

Testing

CI


I have gone over the contributing documentation.

@BenoitZugmeyer BenoitZugmeyer requested a review from a team as a code owner May 14, 2021 09:14
@@ -63,7 +62,7 @@ describe('recorder', () => {
)
})

describe('snapshot', () => {
describe('full snapshot', () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

is full snapshot equivalent to document serialization?
if yes, what about renaming these references as well?

Copy link
Member Author

Choose a reason for hiding this comment

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

A full snapshot is a FullSnapshot record, which contain the serialized document and the document scroll offset. I think we should keep the same naming to keep consistency between player and recorder.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should not hesitate to tweak the naming on player and recorder side if it makes more sense to us.
You have a better grasp on that so I'll let you decide what is making the more sense.

Copy link
Member Author

Choose a reason for hiding this comment

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

I would agree that we could improve the protocol namings, but I would not do this incrementally by renaming only FullSnapshot and keeping IncrementalSnapshot for example. I think it would be worth to discuss more about this with an RFC when we feel the need for it.

@codecov-commenter
Copy link

Codecov Report

Merging #846 (a4de72f) into main (b03432c) will decrease coverage by 0.08%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #846      +/-   ##
==========================================
- Coverage   88.13%   88.05%   -0.09%     
==========================================
  Files          81       80       -1     
  Lines        3666     3666              
  Branches      821      821              
==========================================
- Hits         3231     3228       -3     
- Misses        435      438       +3     
Impacted Files Coverage Δ
packages/rum-recorder/src/boot/recorder.ts 100.00% <ø> (ø)
...es/rum-recorder/src/domain/record/mutationBatch.ts 90.90% <ø> (ø)
...rum-recorder/src/domain/record/mutationObserver.ts 99.15% <ø> (ø)
...ackages/rum-recorder/src/domain/record/observer.ts 76.33% <ø> (ø)
packages/rum-recorder/src/domain/record/privacy.ts 100.00% <ø> (ø)
packages/rum-recorder/src/domain/record/record.ts 63.04% <ø> (ø)
...m-recorder/src/domain/record/serializationUtils.ts 100.00% <ø> (ø)
...ckages/rum-recorder/src/domain/record/serialize.ts 80.91% <ø> (ø)
packages/rum-recorder/src/domain/record/utils.ts 83.33% <ø> (ø)
...m-recorder/src/domain/segmentCollection/segment.ts 97.29% <ø> (ø)
... and 7 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b03432c...a4de72f. Read the comment docs.

@BenoitZugmeyer BenoitZugmeyer merged commit dae60da into main May 14, 2021
@BenoitZugmeyer BenoitZugmeyer deleted the benoit/move-recorder-modules branch May 14, 2021 13:33
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