-
Notifications
You must be signed in to change notification settings - Fork 29
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
Update migration 11-12 guide #336
Open
piqusy
wants to merge
5
commits into
main
Choose a base branch
from
feature/fe-libs-11-12-migration-guide-update
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 4 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
b3968f7
Update migration 11-12 guide for changes in ES Lint and node cnofigs
piqusy f4c2ef4
Add a note on migration time
piqusy b8e9bc2
Update migration 11-12 guide - PR suggestions
piqusy ac17ceb
Fix boilperplate CLI example for manifest-cache
piqusy 95dd3ab
Change the .swcrc example with a link to the libs file
piqusy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -69,7 +69,7 @@ The `Manifest` class has been removed. If you are using this class in your proje | |
|
||
**Migration time: ~5min.** | ||
|
||
1. Run the `wp boilerplate manifest-cache` CLI command to add the cache functionality to your project. | ||
1. Run the `wp boilerplate create manifest-cache` CLI command to add the cache functionality to your project. | ||
|
||
2. Open the `functions.php` (or `<plugin-name>.php`) file and add the following code before the `Main` class initialization: | ||
- [for themes](https://github.com/infinum/eightshift-libs/blob/main/src/Init/theme/functions.php) | ||
|
@@ -218,3 +218,40 @@ const projectConfig = { | |
}, | ||
}; | ||
``` | ||
|
||
### Update ES Lint config | ||
|
||
**Migration time: ~10min.** | ||
|
||
Depending on the state the project is in, you might need to allocate some time for fixing errors and warnings after updating the coding standards. | ||
|
||
ESLint configuration has been updated in Frontend libs 12 and a new build config was added. | ||
|
||
To implement the changes, follow these steps: | ||
|
||
1. Delete the `.eslintrc.js` and `.eslintignore` files from the theme root (if they exist) | ||
|
||
2. Add `eslint.config.mjs` file to the theme root with the following content: | ||
```js | ||
import config from '@eightshift/frontend-libs/linters/eslint.config.mjs'; | ||
|
||
export default [{ | ||
ignores: ["public/**/*.js"], | ||
}, ...config]; | ||
``` | ||
|
||
3. Add a `.swcrc` file to theme root with the following content: | ||
```json | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. remove this part and replace it with the link from the libs |
||
{ | ||
"jsc": { | ||
"parser": { | ||
"syntax": "ecmascript", | ||
"jsx": true, | ||
"decorators": false, | ||
"dynamicImport": true | ||
} | ||
} | ||
} | ||
``` | ||
|
||
4. Make sure the project is using NodeJS version 20 (or newer) both in development and production environments. |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't add the exact code here as if something changes we need to update this guide. Add a link where they can see the code and copy it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you are referring to the Eightshift Frontend Libs config eslint.config.mjs file this example is different as it includes the ignore pattern which replaces the values from the
.eslintignore
deprecated fileThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
well if this needs to be added in the config we should add it. @goranalkovic-infinum please check if this needs to be added
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@iruzevic We should replace the files in the default setup (standard version), but it should also stay in the guide since you won't have those files on existing projects. Same is valid for
.swcrc