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

Feat: Added Blockset command (STALE) #1589

Closed
wants to merge 3 commits into from
Closed

Feat: Added Blockset command (STALE) #1589

wants to merge 3 commits into from

Conversation

theodesp
Copy link
Member

@theodesp theodesp commented Sep 27, 2023

Tasks

  • I have signed a Contributor License Agreement (CLA) with WP Engine.
  • If a code change, I have written testing instructions that the whole team & outside contributors can understand.
  • I have written and included a comprehensive changeset to properly document the changes I've made.

Description

STALE PR. REVIEW #1585 INSTEAD

Related Issue(s):

Testing

Screenshots

Documentation Changes

Dependant PRs

@changeset-bot
Copy link

changeset-bot bot commented Sep 27, 2023

🦋 Changeset detected

Latest commit: 0e749c4

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@faustwp/cli Minor
@faustwp/wordpress-plugin Minor
@faustwp/experimental-app-router Major

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions
Copy link
Contributor

github-actions bot commented Sep 27, 2023

📦 Next.js Bundle Analysis for @faustwp/block-support-example

This analysis was generated by the Next.js Bundle Analysis action. 🤖

🎉 Global Bundle Size Decreased

Page Size (compressed)
global 188.5 KB (🟢 -54.49 KB)
Details

The global bundle is the javascript bundle that loads alongside every page. It is in its own category because its impact is much higher - an increase to its size means that every page on your website loads slower, and a decrease means every page loads faster.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

If you want further insight into what is behind the changes, give @next/bundle-analyzer a try!

One Page Changed Size

The following page changed size from the code in this PR compared to its base branch:

Page Size (compressed) First Load % of Budget (350 KB)
/preview 280 B 188.77 KB 53.93% (+/- <0.01%)
Details

Only the gzipped size is provided here based on an expert tip.

First Load is the size of the global bundle plus the bundle for the individual page. If a user were to show up to your website and land on a given page, the first load size represents the amount of javascript that user would need to download. If next/link is used, subsequent page loads would only need to download that page's bundle (the number in the "Size" column), since the global bundle has already been downloaded.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

The "Budget %" column shows what percentage of your performance budget the First Load total takes up. For example, if your budget was 100kb, and a given page's first load size was 10kb, it would be 10% of your budget. You can also see how much this has increased or decreased compared to the base branch of your PR. If this percentage has increased by 20% or more, there will be a red status indicator applied, indicating that special attention should be given to this. If you see "+/- <0.01%" it means that there was a change in bundle size, but it is a trivial enough amount that it can be ignored.

@theodesp theodesp marked this pull request as ready for review September 28, 2023 09:59
@theodesp theodesp requested a review from a team as a code owner September 28, 2023 09:59
@josephfusco
Copy link
Member

Hey @theodesp, I appreciate you stepping in to fix the CI/CD pipeline issues in #1585!

Would it be possible to extract the unrelated changes into a separate PR please into canary please? This way, we can keep the commit history clean and ensure that both our contributions are accurately represented.

I believe that #1565 should be reviewed prior to #1585 work in order to keep a separation of concerns, with the blockset command being one feature that utilizes that example.

@theodesp
Copy link
Member Author

theodesp commented Oct 4, 2023

Hey @theodesp, I appreciate you stepping in to fix the CI/CD pipeline issues in #1585!

Would it be possible to extract the unrelated changes into a separate PR please into canary please? This way, we can keep the commit history clean and ensure that both our contributions are accurately represented.

I believe that #1565 should be reviewed prior to #1585 work in order to keep a separation of concerns, with the blockset command being one feature that utilizes that example.

@josephfusco I've approved the Block Support Example PR feel free to merge. I will remove any references of this from #1585!

@theodesp theodesp force-pushed the MERL-1235 branch 2 times, most recently from 5e74d4f to 16d144b Compare October 4, 2023 13:56
@github-actions
Copy link
Contributor

github-actions bot commented Oct 5, 2023

📦 Next.js Bundle Analysis for @faustwp/block-support-example

This analysis was generated by the Next.js Bundle Analysis action. 🤖

🎉 Global Bundle Size Decreased

Page Size (compressed)
global 210.63 KB (🟢 -32.35 KB)
Details

The global bundle is the javascript bundle that loads alongside every page. It is in its own category because its impact is much higher - an increase to its size means that every page on your website loads slower, and a decrease means every page loads faster.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

If you want further insight into what is behind the changes, give @next/bundle-analyzer a try!

One Page Changed Size

The following page changed size from the code in this PR compared to its base branch:

Page Size (compressed) First Load % of Budget (350 KB)
/preview 280 B 210.91 KB 60.26% (+/- <0.01%)
Details

Only the gzipped size is provided here based on an expert tip.

First Load is the size of the global bundle plus the bundle for the individual page. If a user were to show up to your website and land on a given page, the first load size represents the amount of javascript that user would need to download. If next/link is used, subsequent page loads would only need to download that page's bundle (the number in the "Size" column), since the global bundle has already been downloaded.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

The "Budget %" column shows what percentage of your performance budget the First Load total takes up. For example, if your budget was 100kb, and a given page's first load size was 10kb, it would be 10% of your budget. You can also see how much this has increased or decreased compared to the base branch of your PR. If this percentage has increased by 20% or more, there will be a red status indicator applied, indicating that special attention should be given to this. If you see "+/- <0.01%" it means that there was a change in bundle size, but it is a trivial enough amount that it can be ignored.

1 similar comment
@github-actions
Copy link
Contributor

github-actions bot commented Oct 5, 2023

📦 Next.js Bundle Analysis for @faustwp/block-support-example

This analysis was generated by the Next.js Bundle Analysis action. 🤖

🎉 Global Bundle Size Decreased

Page Size (compressed)
global 210.63 KB (🟢 -32.35 KB)
Details

The global bundle is the javascript bundle that loads alongside every page. It is in its own category because its impact is much higher - an increase to its size means that every page on your website loads slower, and a decrease means every page loads faster.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

If you want further insight into what is behind the changes, give @next/bundle-analyzer a try!

One Page Changed Size

The following page changed size from the code in this PR compared to its base branch:

Page Size (compressed) First Load % of Budget (350 KB)
/preview 280 B 210.91 KB 60.26% (+/- <0.01%)
Details

Only the gzipped size is provided here based on an expert tip.

First Load is the size of the global bundle plus the bundle for the individual page. If a user were to show up to your website and land on a given page, the first load size represents the amount of javascript that user would need to download. If next/link is used, subsequent page loads would only need to download that page's bundle (the number in the "Size" column), since the global bundle has already been downloaded.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

The "Budget %" column shows what percentage of your performance budget the First Load total takes up. For example, if your budget was 100kb, and a given page's first load size was 10kb, it would be 10% of your budget. You can also see how much this has increased or decreased compared to the base branch of your PR. If this percentage has increased by 20% or more, there will be a red status indicator applied, indicating that special attention should be given to this. If you see "+/- <0.01%" it means that there was a change in bundle size, but it is a trivial enough amount that it can be ignored.

@blakewilson
Copy link
Contributor

@theodesp What is the best way to test this?

@theodesp
Copy link
Member Author

theodesp commented Oct 5, 2023

  • Run npm run blockset -w @faustwp/block-support-example from the root of the monorepo.
  • Observe that wp-content/uploads/faustwp/blocks/ in your WordPress site now contains block-a & block-b.
  • Delete block-a from the Next.js application
  • Run npm run blockset -w @faustwp/block-support-example again
  • Observe that wp-content/uploads/faustwp/blocks/ now only contains block-b.

I've updated the testing instructions.

@github-actions
Copy link
Contributor

github-actions bot commented Oct 5, 2023

📦 Next.js Bundle Analysis for @faustwp/block-support-example

This analysis was generated by the Next.js Bundle Analysis action. 🤖

🎉 Global Bundle Size Decreased

Page Size (compressed)
global 210.63 KB (🟢 -32.35 KB)
Details

The global bundle is the javascript bundle that loads alongside every page. It is in its own category because its impact is much higher - an increase to its size means that every page on your website loads slower, and a decrease means every page loads faster.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

If you want further insight into what is behind the changes, give @next/bundle-analyzer a try!

One Page Changed Size

The following page changed size from the code in this PR compared to its base branch:

Page Size (compressed) First Load % of Budget (350 KB)
/preview 280 B 210.91 KB 60.26% (+/- <0.01%)
Details

Only the gzipped size is provided here based on an expert tip.

First Load is the size of the global bundle plus the bundle for the individual page. If a user were to show up to your website and land on a given page, the first load size represents the amount of javascript that user would need to download. If next/link is used, subsequent page loads would only need to download that page's bundle (the number in the "Size" column), since the global bundle has already been downloaded.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

The "Budget %" column shows what percentage of your performance budget the First Load total takes up. For example, if your budget was 100kb, and a given page's first load size was 10kb, it would be 10% of your budget. You can also see how much this has increased or decreased compared to the base branch of your PR. If this percentage has increased by 20% or more, there will be a red status indicator applied, indicating that special attention should be given to this. If you see "+/- <0.01%" it means that there was a change in bundle size, but it is a trivial enough amount that it can be ignored.

@github-actions
Copy link
Contributor

github-actions bot commented Oct 5, 2023

📦 Next.js Bundle Analysis for @faustwp/getting-started-example

This analysis was generated by the Next.js Bundle Analysis action. 🤖

⚠️ Global Bundle Size Increased

Page Size (compressed)
global 243.83 KB (🟡 +871 B)
Details

The global bundle is the javascript bundle that loads alongside every page. It is in its own category because its impact is much higher - an increase to its size means that every page on your website loads slower, and a decrease means every page loads faster.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

If you want further insight into what is behind the changes, give @next/bundle-analyzer a try!

@TeresaGobble
Copy link
Contributor

TeresaGobble commented Oct 10, 2023

Hello @theodesp, thank you for your work on this! It's a tricky piece of the puzzle and your expertise on it is appreciated. 😊

I'm having trouble getting the first step of testing to work for me. When I run the npm run blockset -w @faustwp/block-support-example from the root of the monorepo in the MERL-1235 branch, I receive the following error:

image

(Here is the same error in a code block for convenience:)

teresa.gobble@teresa-gobble faustjs % npm run blockset -w @faustwp/block-support-example

> @faustwp/[email protected] blockset
> faust blockset

debug - Faust is running in debug mode
debug - Discoverd GraphQL endpoint at https://faustexample.wpengine.com/index.php?graphql
error - Invalid project directory provided, no such directory: /Users/teresa.gobble/Documents/GitHub/faustjs/examples/next/block-support/blockset
npm ERR! Lifecycle script `blockset` failed with error: 
npm ERR! Error: command failed 
npm ERR!   in workspace: @faustwp/[email protected] 
npm ERR!   at location: /Users/teresa.gobble/Documents/GitHub/faustjs/examples/next/block-support 
teresa.gobble@teresa-gobble faustjs % 

I have already run npm i and npm run build at the root level of the monorepo and at block-support, but I am not seeing a blockset file or folder populate inside the block-support folder. I also don't see the two blocks generated under my test repo's site inwp-content/uploads/faustwp/blocks/ as the next step in the testing instructions says I would. Am I potentially missing a step?

@TeresaGobble
Copy link
Contributor

Related to jest testing: when I run the install and build commands in the MERL-1235 branch at the root, I receive the following error:

image

(Here is the same error in a code block for convenience:)

Jest (faustjs)

[info] auto config:

found:
  rootPath: /Users/teresa.gobble/Documents/GitHub/faustjs
  jestCommandLine: "/Users/teresa.gobble/Documents/GitHub/faustjs/node_modules/.bin/jest"

No tests found related to files changed since last commit.

> Test run started at 10/9/2023, 7:53:38 PM <



> Test run finished at 10/9/2023, 7:53:38 PM <

Assertion failed: (napi_call_function(env, recv, callback, 3, args, &recv) == napi_ok), function fse_dispatch_event, file fsevents.c, line 151.

[error] Jest process "watch-tests" ended unexpectedly

[info] jest test run failed, please see: https://github.com/jest-community/vscode-jest/blob/master/README.md#troubleshooting

> Test run exited at 10/9/2023, 7:53:48 PM <`

I haven't seen this error before- am I missing something here that needs to happen as a part of my testing workflow?

@TeresaGobble
Copy link
Contributor

TeresaGobble commented Oct 10, 2023

(Forgot to tag you, @theodesp ! Doing so in a new comment just in case the edit doesn't notify you.)

@theodesp theodesp changed the title Feat: Added Blockset command Feat: Added Blockset command (STALE) Oct 10, 2023
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.

4 participants