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

checking the pwa installation capabilities #34

Merged
merged 6 commits into from
Sep 22, 2024
Merged

checking the pwa installation capabilities #34

merged 6 commits into from
Sep 22, 2024

Conversation

gokulk16
Copy link
Owner

@gokulk16 gokulk16 commented Aug 24, 2024

Summary by Sourcery

Add PWA support by implementing a service worker and web app manifest, enhancing the user experience with a splash screen and icons, and updating the build process to handle new PWA-related files.

New Features:

  • Introduce Progressive Web App (PWA) capabilities by adding a web app manifest and service worker for offline support.

Enhancements:

  • Add a splash screen and icons for different sizes to improve the PWA installation experience.

Build:

  • Update the build process to include copying the manifest.json and sw.js files to the distribution directory using a custom esbuild plugin.
  • icon for PWA
  • images for the install screen
  • Manifest name, description
  • splash screen while loading to be different
  • Offline capability
  • Test coverage to be equal
  • History to be a sticky screen setting in the bottom
  • Auto-zoom and focus and change dimensions while in mobile screen

Copy link

sourcery-ai bot commented Aug 24, 2024

Reviewer's Guide by Sourcery

This pull request implements Progressive Web App (PWA) capabilities for the application. It introduces a service worker for offline functionality and caching, adds a web app manifest for better integration with mobile devices, and updates the build process to handle these new PWA-related files.

File-Level Changes

Change Details Files
Implement service worker registration
  • Add a new function 'registerSW' to handle service worker registration
  • Call 'registerSW' in the init function
  • Add error handling for service worker registration
js/editor.js
Add web app manifest and PWA compatibility script
  • Link the manifest.json file in the HTML
  • Add PWACompat script for better cross-browser support
html/index.html
Update build process for PWA files
  • Add copyFilePlugin to copy manifest.json and sw.js to the dist folder
  • Implement copyFilePlugin function in a new file
esbuild.js
esbuild-helper/copy-file-plugin.js
Create web app manifest
  • Define app name, icons, theme color, and display mode
  • Specify various icon sizes for different devices
manifest.json
Implement service worker for offline capabilities
  • Define cache name and URLs to cache
  • Implement install event to cache specified URLs
  • Implement fetch event to serve cached assets when offline
sw.js

Tips
  • Trigger a new Sourcery review by commenting @sourcery-ai review on the pull request.
  • Continue your discussion with Sourcery by replying directly to review comments.
  • You can change your review settings at any time by accessing your dashboard:
    • Enable or disable the Sourcery-generated pull request summary or reviewer's guide;
    • Change the review language;
  • You can always contact us if you have any questions or feedback.

Copy link

netlify bot commented Aug 24, 2024

Deploy Preview for typetocalculate ready!

Name Link
🔨 Latest commit d4ecfa6
🔍 Latest deploy log https://app.netlify.com/sites/typetocalculate/deploys/66efe7372916f10008044d29
😎 Deploy Preview https://deploy-preview-34--typetocalculate.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @gokulk16 - I've reviewed your changes - here's some feedback:

Overall Comments:

  • Consider adding larger icon sizes (192x192, 512x512) in the manifest.json file to ensure compatibility with various devices and app stores.
  • The error handling in the service worker registration could be more informative. Consider logging more details about the error to aid in debugging.
  • There's a typo in the copyFilePlugin function parameter: 'fileDestPAth' should be 'fileDestPath'.
Here's what I looked at during the review
  • 🟡 General issues: 2 issues found
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.

js/editor.js Outdated Show resolved Hide resolved
esbuild-helper/copy-file-plugin.js Outdated Show resolved Hide resolved
Copy link

github-actions bot commented Sep 22, 2024

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 61.34%
⬇️ -2.99%
700 / 1141
🔵 Statements 61.34%
⬇️ -2.99%
700 / 1141
🔵 Functions 62.68%
⬇️ -1.38%
42 / 67
🔵 Branches 73.68%
⬇️ -1.51%
98 / 133
File Coverage
File Stmts % Branch % Funcs % Lines Uncovered Lines
Changed Files
sw.js 0% 0% 0% 0% 1-30
esbuild-helper/copy-file-plugin.js 0% 0% 0% 0% 1-16
js/editor.js 58.43% 77.52% 60% 58.43% 38, 41-42, 48-54, 56-59, 73-78, 86-90, 120-123, 129-130, 161-162, 192-196, 199-208, 210-250, 252-279, 281-287, 290-315, 321-325, 330-331, 334-343, 387-390, 414, 425-430, 443-445, 452-482, 503-504, 537-553, 590-591, 617-621, 623-628, 630-634, 654-656, 658-682, 696-697, 700-704, 706-717, 719-726, 728-730, 732-738, 740-743, 768-779
Generated in workflow #57

@gokulk16
Copy link
Owner Author

@sourcery-ai review

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @gokulk16 - I've reviewed your changes - here's some feedback:

Overall Comments:

  • Consider enhancing the offline capabilities. The current implementation caches some assets, but it may not provide full offline functionality as mentioned in the PR description.
  • The service worker registration and the urlsToCache array might benefit from more robust error handling and testing. Consider using more specific patterns instead of wildcards in urlsToCache.
  • Review the error handling strategy. Using console.error in multiple places might not be suitable for production code. Consider implementing a more comprehensive logging or error reporting mechanism.
Here's what I looked at during the review
  • 🟡 General issues: 3 issues found
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.

js/editor.js Show resolved Hide resolved
sw.js Outdated Show resolved Hide resolved
esbuild-helper/copy-file-plugin.js Show resolved Hide resolved
@gokulk16 gokulk16 merged commit 8918dc5 into main Sep 22, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant