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 to redirect v6-canary bundles urls to local dev bundles #3021

Merged
merged 2 commits into from
Sep 20, 2024

Conversation

thomas-lebeau
Copy link
Collaborator

Motivation

Enable local dev bundle to be loaded properly even when the browser_sdk_next_major_version is enabled

Changes

Tweak the redirect rules to account for the v6-canary bundles loaded when the next major feature flags is enabled

Testing

  • Local
  • Staging
  • Unit
  • End to end

I have gone over the contributing documentation.

@thomas-lebeau thomas-lebeau marked this pull request as ready for review September 19, 2024 11:42
@thomas-lebeau thomas-lebeau requested a review from a team as a code owner September 19, 2024 11:42
@@ -62,11 +62,11 @@ function buildRules(
const devRumUrl = useRumSlim ? DEV_RUM_SLIM_URL : DEV_RUM_URL
logger.log('add redirect to dev bundles rules')
rules.push(
createRedirectRule(/^https:\/\/.*\/datadog-rum(-v\d|-canary|-staging)?\.js$/, { url: devRumUrl }),
createRedirectRule(/^https:\/\/.*\/datadog-rum-slim(-v\d|-canary|-staging)?\.js$/, {
createRedirectRule(/^https:\/\/.*\/datadog-rum(-v\d|-canary|-staging|-v\d-canary)?\.js$/, { url: devRumUrl }),
Copy link
Member

Choose a reason for hiding this comment

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

💬 suggestion: ‏I think we should simplify the regex to make it future proof: datatdog-rum(-\w+)?\.js . It's pretty low-risk.

Copy link
Contributor

Choose a reason for hiding this comment

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

💭 Though I think there is an upside of having the explicit rules: it can serve as docs for the versions we have and always updated.

Copy link
Member

Choose a reason for hiding this comment

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

We have better documentation here though (although a bit outdated): https://datadoghq.atlassian.net/wiki/spaces/RUMP/pages/2523531139/SDK+distribution#CDN

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

fixed, Mainly for simplification as I'm not totally convinced that it's futureproof, especially with the split bundles initiative, but we will fix it in due time.

I'll update the doc too, thanks

@@ -62,11 +62,11 @@ function buildRules(
const devRumUrl = useRumSlim ? DEV_RUM_SLIM_URL : DEV_RUM_URL
logger.log('add redirect to dev bundles rules')
rules.push(
createRedirectRule(/^https:\/\/.*\/datadog-rum(-v\d|-canary|-staging)?\.js$/, { url: devRumUrl }),
createRedirectRule(/^https:\/\/.*\/datadog-rum-slim(-v\d|-canary|-staging)?\.js$/, {
createRedirectRule(/^https:\/\/.*\/datadog-rum(-v\d|-canary|-staging|-v\d-canary)?\.js$/, { url: devRumUrl }),
Copy link
Contributor

Choose a reason for hiding this comment

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

💭 Though I think there is an upside of having the explicit rules: it can serve as docs for the versions we have and always updated.

Copy link

Bundles Sizes Evolution

📦 Bundle Name Base Size Local Size 𝚫 𝚫% Status
Rum 161.85 KiB 161.85 KiB 0 B 0.00%
Logs 56.03 KiB 56.03 KiB 0 B 0.00%
Rum Slim 110.42 KiB 110.42 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.003 0.002 -0.001
addaction 0.082 0.040 -0.042
addtiming 0.002 0.001 -0.001
adderror 0.105 0.049 -0.056
startstopsessionreplayrecording 1.803 1.458 -0.346
startview 1.983 1.209 -0.774
logmessage 0.031 0.022 -0.009
🧠 Memory Performance
Action Name Base Consumption Memory (bytes) Local Consumption Memory (bytes) 𝚫 (bytes)
addglobalcontext 7.75 KiB 7.39 KiB -369 B
addaction 39.24 KiB 38.52 KiB -743 B
addtiming 6.68 KiB 7.87 KiB 1.18 KiB
adderror 43.20 KiB 44.15 KiB 976 B
startstopsessionreplayrecording 4.24 KiB 4.08 KiB -160 B
startview 356.04 KiB 363.76 KiB 7.71 KiB
logmessage 41.05 KiB 40.54 KiB -521 B

🔗 RealWorld

@thomas-lebeau thomas-lebeau merged commit ba864be into main Sep 20, 2024
19 checks passed
@thomas-lebeau thomas-lebeau deleted the thomas.lebeau/extension-v6-canary branch September 20, 2024 11:24
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