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

🐛 [RUMF-1267] remove last circular dependencies #1577

Merged
merged 6 commits into from
May 31, 2022

Conversation

BenoitZugmeyer
Copy link
Member

Motivation

Following #1559 and #1567, this PR removes some more circular dependencies, as well as taking the opportunity to clean recorder types a bit.

Those two last depency loops did not have been caught because of an issue with import/no-cycle rule
. They have been caught by importing the RUM SDK into a small rollup project.

Changes

  • Remove dependency loop related to eventBridge
  • Remove dependency loop related to recorder types
  • Reorganize and rename some recorder types

Testing

  • Local
  • Staging
  • Unit
  • End to end

I have gone over the contributing documentation.

@BenoitZugmeyer BenoitZugmeyer requested review from a team as code owners May 30, 2022 17:06
This commit reorganize recorder types moving most of the
src/domain/record/types in src/types. I wanted to do this for a long
time, because I'm always confused when looking for a specific type of
the recorder. Now everything is at the same level.
* It is a bit unusual to have *Param types. Those suffixes have been
  removed
* MouseInteractions and MediaInteractions enums have been renamed to
  MouseInteractionType and MediaInteractionType to be a bit more
  conventional.
* ViewportResizeDimention have been renamed to ViewportResizeDimension
@BenoitZugmeyer BenoitZugmeyer force-pushed the benoit/remove-circular-dependencies-3 branch from 7cd426d to 2b97076 Compare May 30, 2022 17:07
@codecov-commenter
Copy link

codecov-commenter commented May 30, 2022

Codecov Report

Merging #1577 (6e6ac03) into main (56d5b2f) will increase coverage by 0.00%.
The diff coverage is 85.71%.

@@           Coverage Diff           @@
##             main    #1577   +/-   ##
=======================================
  Coverage   90.75%   90.75%           
=======================================
  Files         119      119           
  Lines        4468     4469    +1     
  Branches     1001     1001           
=======================================
+ Hits         4055     4056    +1     
  Misses        413      413           
Impacted Files Coverage Δ
packages/core/src/transport/eventBridge.ts 100.00% <ø> (ø)
packages/rum/src/domain/record/mutationBatch.ts 100.00% <ø> (ø)
packages/rum/src/domain/record/mutationObserver.ts 96.37% <ø> (ø)
packages/rum/src/domain/record/record.ts 75.00% <ø> (ø)
packages/rum/src/domain/record/serialize.ts 90.96% <ø> (ø)
packages/rum/test/htmlAst.ts 91.66% <ø> (ø)
packages/rum/test/utils.ts 84.74% <ø> (ø)
packages/rum/src/domain/record/observer.ts 68.62% <50.00%> (ø)
packages/rum/src/types/record.ts 100.00% <100.00%> (ø)
packages/rum/src/types/serializedNode.ts 100.00% <100.00%> (ø)

📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more

@@ -0,0 +1,236 @@
import type { TimeStamp } from '@datadog/browser-core'
Copy link
Contributor

Choose a reason for hiding this comment

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

I like the split of the types but now that I'm looking at it, it feels a bit weird to have domain/record/types.ts and /types/record.ts.
Either we collocate the types to the module or use a types folder. My personal preference is to collocate the type with the module but it's not a strong opinion.
Wdyt

Copy link
Member Author

Choose a reason for hiding this comment

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

Agreed, let's collocate types to the module where they are used

@BenoitZugmeyer BenoitZugmeyer force-pushed the benoit/remove-circular-dependencies-3 branch from bf2085f to 6e6ac03 Compare May 31, 2022 08:28
@BenoitZugmeyer BenoitZugmeyer merged commit 44fce6d into main May 31, 2022
@BenoitZugmeyer BenoitZugmeyer deleted the benoit/remove-circular-dependencies-3 branch May 31, 2022 09:55
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