Skip to content

Stats - Generate sourcemaps for the odyssey app #102831

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

Open
wants to merge 2 commits into
base: trunk
Choose a base branch
from

Conversation

Nikschavan
Copy link
Contributor

@Nikschavan Nikschavan commented Apr 24, 2025

Related to #

Proposed Changes

  • Generate the source maps for the Odyssey app dev builds
  • Note: This PR is to have a discussion,n and if the team agrees then we could merge with any required changes

Why are these changes being made?

  • Make it easier to debug Odyssey builds

Testing Instructions

  • Use Option 3 from the testing instructions - PCYsg-Pp7-p2
  • Check the sourcemaps are working when testing Odyssey stats, ie. CSS in the dev inspector should be displayed from the source SCSS files etc.

Pre-merge Checklist

  • Has the general commit checklist been followed? (PCYsg-hS-p2)
  • Have you written new tests for your changes?
  • Have you tested the feature in Simple (P9HQHe-k8-p2), Atomic (P9HQHe-jW-p2), and self-hosted Jetpack sites (PCYsg-g6b-p2)?
  • Have you checked for TypeScript, React or other console errors?
  • Have you used memoizing on expensive computations? More info in Memoizing with create-selector and Using memoizing selectors and Our Approach to Data
  • Have we added the "[Status] String Freeze" label as soon as any new strings were ready for translation (p4TIVU-5Jq-p2)?
    • For UI changes, have we tested the change in various languages (for example, ES, PT, FR, or DE)? The length of text and words vary significantly between languages.
  • For changes affecting Jetpack: Have we added the "[Status] Needs Privacy Updates" label if this pull request changes what data or activity we track or use (p4TIVU-aUh-p2)?

@@ -22,6 +22,7 @@ const shouldEmitStats = process.env.EMIT_STATS && process.env.EMIT_STATS !== 'fa
const isDevelopment = process.env.NODE_ENV !== 'production';
const outBasePath = process.env.STATS_PACKAGE_PATH ? process.env.STATS_PACKAGE_PATH : __dirname;
const outputPath = path.join( outBasePath, 'dist' );
const sourceMap = isDevelopment ? 'source-map' : false;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

For now, enabling this for development mode only, but I believe this could be enabled by default

@matticbot
Copy link
Contributor

This PR modifies the release build for the following Calypso Apps:

For info about this notification, see here: PCYsg-OT6-p2

  • help-center
  • notifications
  • wpcom-block-editor

To test WordPress.com changes, run install-plugin.sh $pluginSlug add/odyssey-sourcemaps on your sandbox.

@matticbot
Copy link
Contributor

This PR does not affect the size of JS and CSS bundles shipped to the user's browser.

Generated by performance advisor bot at iscalypsofastyet.com.

@Nikschavan Nikschavan requested a review from kangzj April 24, 2025 13:43
@matticbot matticbot added the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Apr 24, 2025
@Nikschavan Nikschavan requested a review from Copilot April 24, 2025 13:43
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR aims to generate sourcemaps for the Odyssey app development builds, which will ease the debugging process.

  • Introduces a conditional configuration for sourcemap generation based on the environment (development vs production).
  • Updates the webpack configuration to use the new sourcemap setting.
Comments suppressed due to low confidence (1)

apps/odyssey-stats/webpack.config.js:25

  • [nitpick] Consider renaming 'sourceMap' to 'devtoolConfig' or a similar name to clarify that it represents a webpack configuration value for the devtool option.
const sourceMap = isDevelopment ? 'source-map' : false;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants