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

Social Previews: Remove i18n-calypso dependency by removing search preview header #44608

Merged
merged 2 commits into from Aug 4, 2020

Conversation

frontdevde
Copy link
Contributor

Changes proposed in this Pull Request

Testing instructions

Before After
Screenshot 2020-08-03 at 13 28 11 Screenshot 2020-08-03 at 13 28 29

Check if all tests pass:

  • run yarn run jest -c=test/packages/jest.config.js packages/social-previews/test/index.js

Fixes #44489

@matticbot
Copy link
Contributor

@matticbot
Copy link
Contributor

matticbot commented Aug 3, 2020

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

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

name                                         parsed_size           gzip_size
async-load-components-web-preview-component        -97 B  (-0.0%)      -25 B  (-0.0%)

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.

Copy link
Contributor

@getdave getdave left a comment

Choose a reason for hiding this comment

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

Thanks for tackling this and taking on the NPM version bump.

I tried testing this by checking out the PR and booting Calypso. I then went to the "Preview" modal in a post and looked at the Google Search result. Unfortunately I saw this even after refreshing and trying again a few times.

Screen Shot 2020-08-03 at 13 12 25

I think this is because these fixes are made in the package not in the Calypso components. That is correct because until this PR is merged then we are still using the old components in Calypso.

To avoid this problem and make this PR easier to test could we first ship the PR to get WP.com Calypso to use the NPM package components? Then we can easily test this PR.

@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 Aug 3, 2020
@frontdevde
Copy link
Contributor Author

I think this is because these fixes are made in the package not in the Calypso components.

Yes, these changes are intentionally only applied to the social-previews package as other products incl. Calypso will consume this package going forward. And yes, I don't mind shipping #44604 first. :)

@getdave getdave force-pushed the update/social-previews-remove-i18n-dependency branch from 730ff28 to 177ff1e Compare August 3, 2020 15:16
Copy link
Contributor

@getdave getdave left a comment

Choose a reason for hiding this comment

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

Screen Shot 2020-08-03 at 16 15 52

Now that WP.com modal is consuming the NPM package's components I've gone ahead and rebased the branch and everything is looking as it should.

I'd say we're good to 🚢 and publish the new version to NPM.

- Mark CSS and SCSS files as `sideEffects` to ensure they are not discarded during build processes tree-shaking.


#### v1.0.0 (2019-07-22)
#### v1.0.0 (2020-07-22)
Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for spotting this!

@frontdevde frontdevde merged commit 8eaa885 into master Aug 4, 2020
@frontdevde frontdevde deleted the update/social-previews-remove-i18n-dependency branch August 4, 2020 07:12
@matticbot matticbot removed the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Aug 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Social Previews: Remove the need for translation dependency
3 participants