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

Adds a prepare script to @datadog/browser-rum-react #3182

Merged
merged 4 commits into from
Nov 29, 2024

Conversation

arcanis
Copy link
Member

@arcanis arcanis commented Nov 28, 2024

Motivation

The standard prepack script is called by Yarn when a repository is installed as a dependency. Its purpose is to let the package describe how its sources should be compiled when yarn pack is called. Since the script was missing, Yarn was packing the original TypeScript source files rather than the JavaScript ones.

Changes

Adds a prepack script that calls npm run build. The reason it's npm run (rather than yarn run, despite the repository being installed with Yarn) is that the build script currently relies on hoisting to have most of its binaries available. Running yarn run won't make those binaries available (because they aren't dependencies of @datadog/browser-rum-react), but npm run (because it just puts as many bins as possible in node_modules/.bin). Since Lerna works, it suggests that they are using npm run even on Yarn-installed projects.

Testing

  • Local
  • Staging
  • Unit
  • End to end

I have gone over the contributing documentation.

@arcanis arcanis requested a review from a team as a code owner November 28, 2024 13:08
Copy link

cit-pr-commenter bot commented Nov 28, 2024

Bundles Sizes Evolution

📦 Bundle Name Base Size Local Size 𝚫 𝚫% Status
Rum 161.96 KiB 161.96 KiB 0 B 0.00%
Logs 55.84 KiB 55.84 KiB 0 B 0.00%
Rum Slim 110.80 KiB 110.80 KiB 0 B 0.00%
Worker 25.21 KiB 25.21 KiB 0 B 0.00%
🚀 CPU Performance
Action Name Base Average Cpu Time (ms) Local Average Cpu Time (ms) 𝚫
addglobalcontext 0.002 0.001 -0.000
addaction 0.040 0.039 -0.001
addtiming 0.001 0.001 0.000
adderror 0.040 0.036 -0.005
startstopsessionreplayrecording 1.143 1.063 -0.081
startview 1.082 1.395 0.313
logmessage 0.021 0.022 0.001
🧠 Memory Performance
Action Name Base Consumption Memory (bytes) Local Consumption Memory (bytes) 𝚫 (bytes)
addglobalcontext 7.99 KiB 7.38 KiB -627 B
addaction 39.20 KiB 39.44 KiB 245 B
addtiming 8.07 KiB 7.35 KiB -735 B
adderror 45.58 KiB 44.03 KiB -1591 B
startstopsessionreplayrecording 4.47 KiB 4.78 KiB 323 B
startview 420.06 KiB 426.23 KiB 6.17 KiB
logmessage 41.67 KiB 40.43 KiB -1269 B

🔗 RealWorld

@BenoitZugmeyer BenoitZugmeyer merged commit 0dfe314 into main Nov 29, 2024
19 checks passed
@BenoitZugmeyer BenoitZugmeyer deleted the mael/rum-react-prepare branch November 29, 2024 13:40
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.

2 participants