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 @automattic/component and @automattic/i18n-utils packages #90267

Merged
merged 6 commits into from
May 7, 2024

Conversation

chihsuan
Copy link
Member

@chihsuan chihsuan commented May 3, 2024

I'm trying to upgrade @automattic/tour-kit to 1.1.3 in WooCommerce (woocommerce/woocommerce#47129) but encountering several issues due to @automattic/components and its dependencies.

../woocommerce-admin build:project:bundle: ERROR in ../../node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected][email protected][email protected]/node_modules/@automattic/components/dist/esm/jetpack-upsell-card/index.js 10:0-78
../woocommerce-admin build:project:bundle: Module not found: Error: Can't resolve '../../assets/jetpack-product-icon-videopress.svg' in '/home/runner/work/woocommerce/woocommerce/node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected][email protected][email protected]/node_modules/@automattic/components/dist/esm/jetpack-upsell-card'
../woocommerce-admin build:project:bundle:  @ 
../woocommerce-admin build:project:bundle: ERROR in ../../node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected][email protected][email protected]/node_modules/@automattic/components/src/icons/eye.tsx 5:1
../woocommerce-admin build:project:bundle: Module parse failed: Unexpected token (5:1)
../woocommerce-admin build:project:bundle: You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
../woocommerce-admin build:project:bundle: | // TODO: replace with an icon when available.
../woocommerce-admin build:project:bundle: | const eye = (
../woocommerce-admin build:project:bundle: > 	<SVG xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">

Proposed Changes

This PR addresses the following issues:

  • Adds the missing dependencies to the @automattic/i18n-utils package.
  • Fix import path in packages/components/src/post-stats-card/index.tsx. It should use relative paths instead of absolute paths so build versions of the components package can be used in other packages without issues.
  • Fix components assets. It used Symbolic link to assets. This caused the issue when building the components package. I update the files to use the actual assets instead of symbolic link and move them to src/ path.

Testing Instructions

  • This PR doesn't introduce any new features, so just review the code changes and ensure they are correct.

Pre-merge Checklist

  • Has the general commit checklist been followed? (PCYsg-hS-p2)
  • https://wpcalypso.wordpress.com/devdocs/docs/testing/index.md 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 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)?

@chihsuan chihsuan marked this pull request as ready for review May 3, 2024 08:48
@chihsuan chihsuan requested a review from a team as a code owner May 3, 2024 08:48
@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 May 3, 2024
@chihsuan chihsuan self-assigned this May 3, 2024
@chihsuan chihsuan requested review from a team, psealock and moon0326 May 3, 2024 08:50
@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

  • odyssey-stats
  • wpcom-block-editor

To test WordPress.com changes, run install-plugin.sh $pluginSlug fix/component on your sandbox.

@matticbot
Copy link
Contributor

Here is how your PR affects size of JS and CSS bundles shipped to the user's browser:

Sections (~46 bytes removed 📉 [gzipped])

name                               parsed_size           gzip_size
jetpack-cloud-features-comparison       -120 B  (-0.0%)      -46 B  (-0.0%)

Sections contain code specific for a given set of routes. Is downloaded and parsed only when a particular route is navigated to.

Async-loaded Components (~109 bytes removed 📉 [gzipped])

name                                                      parsed_size           gzip_size
async-load-calypso-my-sites-stats-jetpack-upsell-section       -814 B  (-6.1%)     -109 B  (-2.4%)

React components that are loaded lazily, when a certain part of UI is displayed for the first time.

Legend

What is parsed and gzip size?

Parsed Size: Uncompressed size of the JS and CSS files. This much code needs to be parsed and stored in memory.
Gzip Size: Compressed size of the JS and CSS files. This much data needs to be downloaded over network.

Generated by performance advisor bot at iscalypsofastyet.com.

@chihsuan chihsuan requested a review from jsnmoon May 3, 2024 09:18
Copy link
Contributor

@moon0326 moon0326 left a comment

Choose a reason for hiding this comment

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

LGTM and tested well 👍 🚀

I tried a clean install and everything built well.

I'm getting the following error, but I think this is unrelated.
Screen Shot 2024-05-06 at 8 54 21 AM

Copy link
Contributor

@psealock psealock left a comment

Choose a reason for hiding this comment

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

Code changes look good 🚢

@chihsuan chihsuan merged commit df70026 into trunk May 7, 2024
13 checks passed
@chihsuan chihsuan deleted the fix/component branch May 7, 2024 01:30
@github-actions github-actions bot removed the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label May 7, 2024
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.

4 participants