Coder Social home page Coder Social logo

vsanse / plugin_sf_pwa Goto Github PK

View Code? Open in Web Editor NEW
1.0 3.0 1.0 902 KB

Salesforce Demandware cartridge to enable PWA support on your storefront

Home Page: https://vsanse.github.io/plugin_sf_pwa/

JavaScript 100.00%
pwa sfcc sfcc-instance demandware offline offline-page service-worker plugin-sg-pwa cartridge isml

plugin_sf_pwa's Introduction

What is all the buzz about

What is PWA? Why PWA?.... Before answering that let's have a look at how a user interacts with the digital world. As per study users usually spend 13% of their time on the web and 87% of that on Native apps due to their capabilities like push notification that brings the user back. So does that mean to abandon the web completely? Well... not exactly whereas the user spends most of the time on native apps but when it comes to reachability web surpasses native apps. On an average user installs ZERO apps per month where visits hundreds of websites at the same time. So if your app is not in users' top choice you can forget about it. This gap between native apps' capability and the web's reachability is covered by PWA.

PWA collects the goodness of web reachability as once user visits your website he will be shown app install banner hence instead of dedicating an entire page for letting user know where to install your app, you can go on with your business and let browser handle app installs, on the other hand, PWA gets the goodness of native apps from its capabilities like push notification, offline experience and interact with device capabilities like camera, etc. More at https://developers.google.com/web/progressive-web-apps

How e-Commerce is benefited

As per a case study: Lancome rebuilt their website as PWA after seeing an increase in abandoned carts and loss in user traffic. After PWA result was:

  • Overall

    • 84% decrease in time until the page is interactive
    • 17% increase in conversions
    • 15% decrease in bounce rate
    • 51% increase in mobile sessions
  • iOS

    • 53% increase in mobile sessions on iOS
    • 10% decrease in bounce rates on iOS
  • Push

    • 8% of consumers who tap on a push notification make a purchase
    • 18% open rate from Push Notifications
    • 12% increase in conversion rates on recovered carts via Push Notifications

The full case study at Lancôme rebuilds their mobile website as a PWA

Prerequisite

Cartridge Download

  1. Get the latest version from Releases

  2. ⭐ Star the repo 😜

Steps to add PWA support

  1. add "plugin_sf_pwa " cartridge to the site path

    Administration > Manage Sites > [Your Site ] > Settings > Cartridges

  2. Change yourSiteId folder name in meta folder to your site id name and import metadata

  3. Include pwa/register template in head tag of your site e.g: htmlHead.isml

    <isinclude template="pwa/register"/>
    
  4. [Optional] Add new property file named pwa.properties to your site cartridge to update manifest.json file with your site name, theme, icons and To updated offline fallback page for your site.

Generating and adding PWA icons

  1. We will be generating our PWA icons using tool "pwa-asset-generator" so let's install it first
    npm install --global pwa-asset-generator
    
  2. Now let's generate icons in the "icons" folder: for better experience make sure your logo file is png or svg.
     pwa-asset-generator [Your logo file] icons --opaque false
    
  3. Now copy generated icons folder to "[Your site Cartridge]/static/default/images/"

Features

  1. Extend Manifest

    Feeling adventurous? Want to add more cool functionalities to your PWA?

    • To add more configurations to your manifest.json:
      1. In your site cartridge's pwa.properties file add the line
        pwa.app.manifest.extended=true
        
      2. Create file manifest_extended.isml under pwa folder in templates of your site cartridge
  2. Handling default app install behaviour

    From version v1.3 you can prevent default mini-infobar from appearing by using

    pwa.app.preventadd2hs=true	
    

    If you decide to use above property, be sure to provide some indication to the user that your Progressive Web App is installable.

  3. window.add2hs to rescue

    From version v1.3 window object will have event add2hs which can be used to prompt user to install PWA using window.add2hs.prompt(). You can setup some button or banner to indicate user that your PWA is installable on click of which you can trigger window.add2hs.prompt() to prompt user to install PWA.

For support and feedback:

Contact at Linkedin:

Vishal Sanserwal

plugin_sf_pwa's People

Contributors

vsanse avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

plugin_sf_pwa's Issues

Is Fetch Override Handled by the Plugin Automatically?

Hi!

I have a question about this project and the fetch override feature. Great work on this by the way it's solid and I love the extendable service worker.

I'm wondering how the Fetch override feature works. From my understanding, it would be up to the developer, to implement their own fetch overriding logic. The plugin doesn't transform Ajax requests into Fetch requests, is that correct?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.