Giter Site home page Giter Site logo

mayeedwin / vscode-pwa Goto Github PK

View Code? Open in Web Editor NEW
14.0 2.0 2.0 33.46 MB

Progressive Web App code snippets in vs code

Home Page: http://bit.ly/vscode-pwa

License: Apache License 2.0

JavaScript 59.74% HTML 40.26%
vs-code vscode-extension vscode-snippets pwa mayeedwin

vscode-pwa's Introduction

Build Progressive Web Apps in VS Code on the go and like a pro. We have Workbox Support fully stacked too.

Advanced Progressive Web Apps Features

Workbox is a set of libraries to help you write and manage service workers and caching with the CacheStorage API.

Get started : How to use Workbox here

Requirements

   "vscode": "^1.8.0"

Installation

Install vscode-pwa. It's available in Visual Studio Marketplace! OR

Launch VS Code Quick Open ( Ctrl + P ), paste the following command and press enter.

   ext install mayeedwin.vscode-pwa

Setting up the App Manifest and registering the Service Worker

Write the Service Worker and App Manifest really quick and like a pro!

Command Purpose and where to type
register.service.worker register service worker in your landing page say index.html
add.web.manifest link app.webmanifest to your pages in the head tag
theme.color add theme color in your pages head tag
app.manifest add manifest meta data in your empty app.webmanifest file

Simple basic Service Worker

Command Purpose and where to type
basic.service.worker create simple service worker for simple static sites

Commands to type in your editor for Workbox CDN

NOTE : Use and refer to workbox developer docs while using the following commands for e.g the most used and critical one, workbox routing

Command Purpose and where to type
workbox.cdn import workbox cdn version
workbox.registerRoute set caching routes
workbox.assets cache assets i.e styles, js, workers, in your service worker
workbox.images cache images, in your service worker
workbox.external cache external resources from external orgins e.g fonts, in your service worker
workbox.debug workbox config for debug or production builds, in your service worker
workbox.window add faster new service worker installs and refresh, in your landing page

Setting up Workbox pre-cache

Command Purpose and where to type
workbox.precache workbox precache config code snippet in your say sw-config.js file

Commands to type in your editor for Workbox packages, using a bundler

Excerpt : When using a bundler to create your service worker, you install the Workbox packages you want to use from npm, and then you use import statements to directly reference the Workbox modules you want to use.

Read more here

Command Purpose and where to type
workbox.packages import all workbox npm modules
workbox.analytics add offline google analytics

Adding Project Fugu APIs

API / Feature Command Where to type
Web Share Target API web.share.basic in your app manifest
Web Share Target API - Accepting application changes web.share.app in your app manifest
Web Share Target API - Accepting files web.share.files in your app manifest
Web Share Target API - Accepting text web.share.text in your app manifest
App Screeshots Preview before PWA Installation pwa.screenshots in your app manifest

Demo with PWA VS Code in play (With the old version)

Load preview in your browser here

Known Issues

All good to go with ^ v0.5-beta!

Release Notes

This beta version allows you to import Workbox and use cache strategies like a pro already!

Latest release of vscode-pwa beta!

Enjoy ๐Ÿ˜Š ๐Ÿฅ and thanks for checking it out. Let's connect on twitter @mayeedwin1 : )

vscode-pwa's People

Contributors

mayeedwin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

vscode-pwa's Issues

add assets loading with Workbox

Is your feature request related to a problem? Please describe.
Precaching Media files e.g video

Describe the solution you'd like
A code snippet guide on how to manage assets in PWAs for best performance

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.