Closed jasonbahl closed 2 weeks ago
Latest commit: 24f96acada6c09f1d493cf57a1c3aee932b116a8
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
Click here to learn what changesets are, and how to add one.
Click here if you're a maintainer who wants to add a changeset to this PR
@jasonbahl a few ci/cd errors there before we can merge.
packages/faustwp-core
❌ An unexpected error occurred. For more details, check console
Error: The process '/opt/hostedtoolcache/node/20.17.0/x64/bin/npm' failed with exit code 1
St.:grey_question: |
Category | Percentage | Covered / Total |
---|---|---|---|
🟢 | Statements | 84.98% | 1041/1225 |
🟡 | Branches | 66.77% (+0.07% 🔼) |
651/975 |
🟢 | Functions | 85.06% | 148/174 |
🟢 | Lines | 84.61% (-0.08% 🔻) |
1006/1189 |
Report generated by 🧪jest coverage report action from 4ec11be7777a4a129c71c1257005d914bc729575
This analysis was generated by the Next.js Bundle Analysis action. 🤖
Page | Size (compressed) |
---|---|
global |
250.06 KB (🟢 -475 B) |
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!
The following pages changed size from the code in this PR compared to its base branch:
Page | Size (compressed) | First Load | % of Budget (350 KB ) |
---|---|---|---|
/ |
289 B |
250.34 KB | 71.53% (🟢 -0.01%) |
/_error |
193 B |
250.24 KB | 71.50% (+/- <0.01%) |
/example |
852 B |
250.89 KB | 71.68% (+/- <0.01%) |
/preview |
280 B |
250.33 KB | 71.52% (+/- <0.01%) |
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.
Description
This separates out the workspaces to help reduce the clutter created when running
npm install
.The
/examples
directory are not intended to be workspace packages, so the dependencies declared in each example should be isolated to that example and not included when installing dependencies for the packages.Fix Workflows
Related Issue(s):
1786
1929
Testing
I symlinked my local copy of
acf.wpgraphql.com
to this local copy of@faustwp/blocks
, then ran my site and it was able to build.In addition to the package.json changes in this PR, we still need to symlink react from the package we're npm linking in our project.
So, in
acf.wpgraphql.com
I didnpm link @faustwp/blocks
and then withinfaustjs/packages/blocks
I had tonpm link /path/to/acf.wpgraphql.com/node_modules/react
for local development to work without the multiple versions of react errorsee: https://legacy.reactjs.org/warnings/invalid-hook-call-warning.html#duplicate-react
Screenshots
Here you can see that in my
acf.wpgraphql.com
project I have usednpm link @faustwp/blocks
:npm list | grep faust
Then in
faustjs/packages/blocks
I have react linked back to myacf.wpgraphql.com
project via running:npm link /Users/jason.bahl/Sites/libs/acf.wpgraphql.com/node_modules/react
npm list | grep react
Now I can successfully run
npm run dev
withinacf.wpgraphql.com
and it builds and runs without any errors.Before
Before this PR, we cannot npm link react back to the
acf.wpgraphql.com
project because of conflicts caused by the examples dependencies and the packages dependencies..After
After this PR, following the
npm link
steps above, we are able to successfully link react frompackages/blocks
back to the project (acf.wpgraphql.com
in this case) run the project locally without issue. We can also do things like add console.log statements to thecomponents/WordPressBlockViewer.tsx
component and see it output with "fast refresh"Documentation Changes
@todo
Update LOCAL_DEVELOPMENT.md