-
Notifications
You must be signed in to change notification settings - Fork 0
refact: reduce blocking rendering #91
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
Conversation
WalkthroughThe changes involve modifications to the HTML templates in the Beaver theme, focusing on optimizing the loading strategies for CSS and resource management. A DNS prefetch link was removed, and the handling of critical and non-critical CSS was updated to improve page load performance. Non-critical styles are now loaded asynchronously using preload links, ensuring that critical styles are prioritized while still providing styles for users with JavaScript disabled. Additionally, new scripts for setup and deployment have been introduced to streamline the development process. Changes
Possibly related PRs
Poem
Recent review detailsConfiguration used: .coderabbit.yaml Files selected for processing (1)
Files skipped from review as they are similar to previous changes (1)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
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.
Actionable comments posted: 0
Outside diff range, codebase verification and nitpick comments (1)
bin/surge/cleanup (1)
1-31: LGTM, but consider adding comments.The cleanup script is well-structured and follows best practices for error handling. The use of an allowed files list ensures that only necessary files are kept.
However, consider adding comments to explain the purpose of each section of the script. This will improve the maintainability and readability of the code.
Apply this diff to add comments to the script:
#!/bin/bash +# Enable strict error handling set -eo pipefail # Directory to clean up TARGET_DIR="public/blog" # Allowed files list ALLOWED_FILES=( "4-lines-speed-up-your-rails-test-suite-on-circleci" "page" "tags" "index.html" "index.xml" "og-blog.jpg" ) +# Convert the allowed files array to a string for easier comparison ALLOWED_FILES_STRING=$(printf "|%s" "${ALLOWED_FILES[@]}") ALLOWED_FILES_STRING=${ALLOWED_FILES_STRING:1} +# Iterate over all files in the target directory for file in "$TARGET_DIR"/*; do + # Get the base name of the file basefile=$(basename -s $TARGET_DIR "$file") + # Check if the file is in the allowed list if [[ ! "$ALLOWED_FILES_STRING" =~ (^|\||[[:space:]])"$basefile"($|\||[[:space:]]) ]]; then + # Remove the file if it's not in the allowed list rm -rf "$file" fi done
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files ignored due to path filters (1)
bun.lockbis excluded by!**/bun.lockb
Files selected for processing (5)
- Brewfile (1 hunks)
- bin/setup (1 hunks)
- bin/surge/cleanup (1 hunks)
- bin/surge/deploy (1 hunks)
- package.json (1 hunks)
Additional comments not posted (5)
Brewfile (1)
1-5: LGTM!The
Brewfilecorrectly specifies the dependencies and their installation options:
oven-sh/buntap is added to installbunfrom a custom repository.bunis installed withlinkandforceoptions to ensure it's properly linked and overwrites any existing installation.hugois installed using the default options.The code changes are approved.
bin/surge/deploy (1)
1-11: LGTM!The
bin/surge/deployscript correctly implements the deployment steps:
- Sets the
SURGE_APPenvironment variable with a default value of"jt-site".- Runs the
hugocommand with appropriate flags to build the site for production.- Runs the
bin/surge/cleanupscript to clean up any previous deployments.- Deploys the
publicdirectory to Surge using theSURGE_APPvariable for the domain name.The code changes are approved.
bin/setup (1)
1-8: LGTM!The
bin/setupscript correctly implements the project setup steps:
- Checks if Homebrew is installed and runs
brew bundleto install the dependencies specified in theBrewfile.- If Homebrew is not installed, it prompts the user to manually install the dependencies listed in the
Brewfile.- Runs
bun installto install the JavaScript dependencies using Bun.The code changes are approved.
package.json (2)
13-13: LGTM!The
autoprefixerdependency update is approved.
16-16: LGTM, but verify thesurgeusage.The addition of the
surgedependency is approved.However, ensure that this dependency is being used correctly and that all necessary configuration files and deployment scripts have been updated to utilize it effectively.
Run the following script to verify the
surgeusage:#!/bin/bash # Description: Verify the usage of the `surge` dependency. # Test 1: Search for import statements. Expect: At least one occurrence. rg --type js $'require\(.*surge.*\)|import.*surge' # Test 2: Search for configuration files. Expect: At least one occurrence. fd --type f --regex '.*surge.*\.(js|json|yml|yaml)' # Test 3: Search for deployment scripts. Expect: At least one occurrence. rg --type sh $'surge'
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.
Actionable comments posted: 0
Outside diff range, codebase verification and nitpick comments (2)
.github/workflows/hugo.yml (2)
45-45: Remove the unnecessary empty line.The empty line at line 45 can be removed to improve readability.
Apply this diff to remove the empty line:
-
50-50: LGTM, but remove the unnecessary empty lines.Setting up Bun and installing dependencies using Bun is a good addition to the workflow. It can improve the performance and compatibility of the build process.
However, the empty lines at lines 50 and 54 can be removed to improve readability.
Apply this diff to remove the empty lines:
-Also applies to: 54-54, 55-56
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
Files selected for processing (1)
- .github/workflows/hugo.yml (2 hunks)
dgorodnichy
left a comment
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.
LGTM
|
@pftg , Conflicts. |
af526ca to
f6eba19
Compare
AucT
left a comment
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.
ok
Remove swipper.css from blocking other resources and added surge deploy scripts.
Now you can use
bin/setupto setup macos dev env andbin/surge/deployto deploy to surge some version.Summary by CodeRabbit
Summary by CodeRabbit
New Features
Bug Fixes
Documentation