PWABuilder
The simplest way to create progressive web apps across platforms and devices. Start here. This repo is home to several projects in the PWABuilder family of tools.
Top Related Projects
Bubblewrap is a Command Line Interface (CLI) that helps developers to create a Project for an Android application that launches an existing Progressive Web App (PWAs) using a Trusted Web Activity.
Build cross-platform Native Progressive Web Apps for iOS, Android, and the Web ⚡️
📦 Workbox: JavaScript libraries for Progressive Web Apps
This is the repo for Vue 2. For Vue 3, go to https://github.com/vuejs/core
Deliver web apps with confidence 🚀
Quick Overview
PWABuilder is an open-source project that helps developers create Progressive Web Apps (PWAs) and package them for various app stores. It provides a web-based tool and CLI for generating, testing, and packaging PWAs, making it easier for developers to create cross-platform applications using web technologies.
Pros
- Simplifies the process of creating and packaging PWAs for multiple platforms
- Offers both a web-based interface and a CLI for flexibility in development workflows
- Provides tools for testing and improving PWA quality
- Supports packaging for major app stores, including Google Play, Microsoft Store, and Apple App Store
Cons
- May have limitations for highly complex or specialized PWA requirements
- Dependency on third-party services and platforms for some features
- Learning curve for developers new to PWA concepts and best practices
- Limited customization options for advanced use cases
Code Examples
- Using the PWABuilder CLI to create a new PWA project:
npm init pwa
- Generating app packages using the PWABuilder CLI:
pwa-builder package -p windows,android,ios
- Customizing the manifest file using the PWABuilder API:
import { Manifest } from '@pwabuilder/manifest-creator';
const manifest = new Manifest({
name: 'My PWA',
short_name: 'PWA',
start_url: '/',
display: 'standalone',
background_color: '#ffffff',
theme_color: '#000000'
});
console.log(manifest.generate());
Getting Started
To get started with PWABuilder, follow these steps:
-
Install the PWABuilder CLI:
npm install -g @pwabuilder/cli
-
Create a new PWA project:
npm init pwa
-
Follow the prompts to configure your PWA.
-
Test your PWA using the built-in tools:
pwa-builder test
-
Package your PWA for different platforms:
pwa-builder package -p windows,android,ios
For more detailed instructions and advanced usage, refer to the official PWABuilder documentation.
Competitor Comparisons
Bubblewrap is a Command Line Interface (CLI) that helps developers to create a Project for an Android application that launches an existing Progressive Web App (PWAs) using a Trusted Web Activity.
Pros of Bubblewrap
- Focused specifically on Android app generation from PWAs
- Developed and maintained by Google, ensuring compatibility with Chrome and Android
- Provides low-level control over the generated Android app
Cons of Bubblewrap
- Limited to Android platform only
- Requires more technical knowledge to use effectively
- Less user-friendly interface compared to PWABuilder
Code Comparison
PWABuilder (JavaScript):
const generator = new AndroidPackageGenerator();
await generator.generatePackage({
name: 'My PWA',
packageId: 'com.example.mypwa',
url: 'https://example.com'
});
Bubblewrap (Command-line):
bubblewrap init --manifest https://example.com/manifest.json
bubblewrap build
Both projects aim to simplify the process of creating mobile apps from Progressive Web Apps (PWAs). PWABuilder offers a more comprehensive solution, supporting multiple platforms and providing a user-friendly interface. It's suitable for developers of varying skill levels.
Bubblewrap, on the other hand, focuses solely on Android app generation. It offers more granular control over the output but requires a higher level of technical expertise. Being developed by Google, it ensures excellent compatibility with Android and Chrome.
The choice between these tools depends on the developer's specific needs, target platforms, and level of expertise in mobile app development.
Build cross-platform Native Progressive Web Apps for iOS, Android, and the Web ⚡️
Pros of Capacitor
- Cross-platform development for iOS, Android, and web
- Extensive plugin ecosystem for native functionality
- Seamless integration with popular web frameworks
Cons of Capacitor
- Steeper learning curve for developers new to mobile development
- Larger app size compared to pure PWAs
- May require more frequent updates to maintain compatibility
Code Comparison
PWABuilder (manifest generation):
{
"name": "My PWA",
"short_name": "PWA",
"start_url": "/",
"display": "standalone",
"background_color": "#ffffff",
"theme_color": "#000000"
}
Capacitor (config file):
{
"ios": {
"contentInset": "always"
},
"android": {
"backgroundColor": "#ffffff"
},
"plugins": {
"SplashScreen": {
"launchShowDuration": 3000
}
}
}
PWABuilder focuses on simplifying the process of creating Progressive Web Apps, providing tools for manifest generation, service worker implementation, and app packaging. It's ideal for developers looking to quickly convert web apps into PWAs.
Capacitor, on the other hand, offers a more comprehensive solution for building cross-platform apps using web technologies. It provides a bridge between web and native platforms, allowing developers to access native device features while maintaining a single codebase.
While PWABuilder is more specialized for PWA creation, Capacitor offers greater flexibility for developers who need native functionality and want to target multiple platforms with a single codebase.
📦 Workbox: JavaScript libraries for Progressive Web Apps
Pros of Workbox
- More comprehensive set of service worker libraries and tools
- Better integration with existing web development workflows
- Stronger focus on performance optimization and caching strategies
Cons of Workbox
- Steeper learning curve for beginners
- Requires more manual configuration and setup
- Less emphasis on cross-platform app generation
Code Comparison
PWABuilder (manifest generation):
const manifest = {
name: "My PWA",
short_name: "PWA",
start_url: "/",
display: "standalone",
background_color: "#ffffff",
theme_color: "#000000",
icons: [
// ... icon definitions
]
};
Workbox (service worker setup):
importScripts('https://storage.googleapis.com/workbox-cdn/releases/6.1.5/workbox-sw.js');
workbox.routing.registerRoute(
({request}) => request.destination === 'image',
new workbox.strategies.CacheFirst()
);
PWABuilder focuses on simplifying the PWA creation process, offering a more user-friendly approach to generating manifests and service workers. It also provides tools for packaging PWAs for different app stores.
Workbox, on the other hand, offers a more flexible and powerful set of tools for creating advanced service workers and implementing sophisticated caching strategies. It's better suited for developers who need fine-grained control over their PWA's offline functionality and performance optimization.
This is the repo for Vue 2. For Vue 3, go to https://github.com/vuejs/core
Pros of Vue
- More versatile framework for building various web applications
- Larger community and ecosystem with extensive third-party libraries
- Comprehensive documentation and learning resources
Cons of Vue
- Steeper learning curve for beginners compared to PWABuilder
- Requires more setup and configuration for PWA-specific features
- Less focused on PWA development out-of-the-box
Code Comparison
Vue component example:
<template>
<div>{{ message }}</div>
</template>
<script>
export default {
data() {
return {
message: 'Hello, Vue!'
}
}
}
</script>
PWABuilder manifest generation:
import { generateManifest } from '@pwabuilder/manifest-generator';
const manifest = generateManifest({
name: 'My PWA',
short_name: 'PWA',
start_url: '/'
});
Vue is a comprehensive JavaScript framework for building user interfaces, while PWABuilder focuses specifically on creating Progressive Web Apps. Vue offers more flexibility for general web development, but PWABuilder provides specialized tools for PWA creation. The code examples demonstrate Vue's component-based structure versus PWABuilder's utility for generating PWA manifests. Developers should choose based on their project requirements and familiarity with each tool.
Deliver web apps with confidence 🚀
Pros of Angular
- Comprehensive framework for building large-scale web applications
- Robust ecosystem with extensive documentation and community support
- Powerful CLI for scaffolding, development, and deployment
Cons of Angular
- Steeper learning curve compared to PWABuilder
- More complex setup and configuration for smaller projects
- Heavier bundle size, which may impact initial load times
Code Comparison
Angular (component example):
@Component({
selector: 'app-root',
template: '<h1>{{ title }}</h1>'
})
export class AppComponent {
title = 'My Angular App';
}
PWABuilder (manifest generation):
const manifest = await pwabuilder.generateManifest({
name: 'My PWA',
short_name: 'PWA',
start_url: '/'
});
Key Differences
- Angular is a full-fledged framework for building web applications, while PWABuilder focuses specifically on creating Progressive Web Apps (PWAs).
- Angular provides a complete solution for front-end development, including routing, state management, and dependency injection. PWABuilder offers tools and services to convert existing web apps into PWAs.
- Angular requires more setup and configuration, whereas PWABuilder aims for simplicity and quick PWA creation.
Use Cases
- Choose Angular for complex, large-scale web applications that require a comprehensive framework.
- Opt for PWABuilder when you want to quickly convert an existing web app into a PWA or create a simple PWA with minimal setup.
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual CopilotREADME
PWABuilder
The simplest way to create progressive web apps across platforms and devices.
This repo is home to several projects in the PWABuilder family of tools.
Tools
Tools | Overview | Source | Docs | Contribute |
---|---|---|---|---|
PWABuilder.com | The best way to package PWAs for various stores. | /apps/pwabuilder | PWABuilder docs | Wiki |
PWA Studio | PWA Studio makes VSCode the BEST developer environment for building Progressive Web Apps. | /apps/pwabuilder-vscode | PWA Studio docs | Wiki |
PWA Starter | Our opinionated and production tested progressive web app (PWA) template for creating new projects. | Repo | PWA Starter docs | Wiki |
Docs
Docs | Source | Contribute |
---|---|---|
docs.pwabuilder.com | /docs | Wiki |
blog.pwabuilder.com | /apps/blog | /apps/blog |
Components
Components | Overview | Source | Docs | Contribute |
---|---|---|---|---|
<pwa-install> | Web component for great PWA install experience | pwa-install | pwa-install | Wiki |
Recommended Development setup
You will need the following things properly installed on your computer.
You should also be familiar with TypeScript which we use for this project. This helps give you more guidance as you code from intellisense when using VSCode.
We recommend the following tools for your dev setup:
- Editor: VSCode
- Terminal: Windows Terminal or hyper
Additionally, when you open the project in VS Code, you'll be prompted to install recommended extensions.
Development
Navigate to the folder of the project you plan to work on (example /apps/pwabuilder), and follow the README for how to get started.
Running npm install
in the project folder will automatically install and build all dependencies.
About this monorepo
This monorepo does not use a root package.json like other monorepos you might be used to. Instead, projects live in their separate folders and are mostly independent of each other.
However, when there are dependencies between projects, our tooling should automatically handle linking and dependency building when you run npm install
in the project root.
For example /apps/pwabuilder
has a dependency on library/site-analytics
. This dependency is defined in the pwabuilder package.json like so:
//package.json
"dependencies": {
"@pwabuilder/site-analytics": "file:../../libraries/site-analytics",
...
Running npm install
in the pwabuilder folder will also run npm install
and npm run build
for the site-analytics
project. In most cases, and unless working on a dependency, a developer will not have to worry about how these projects are linked.
For automatic linking of projects to work, ensure each project has a preinstall
script like so:
// package.json
"scripts": {
"preinstall": "node ../../scripts/setupDeps.js",
...
License
All files on the PWABuilder repository are subject to the MIT license. Please read the License file at the root of the project.
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.
Top Related Projects
Bubblewrap is a Command Line Interface (CLI) that helps developers to create a Project for an Android application that launches an existing Progressive Web App (PWAs) using a Trusted Web Activity.
Build cross-platform Native Progressive Web Apps for iOS, Android, and the Web ⚡️
📦 Workbox: JavaScript libraries for Progressive Web Apps
This is the repo for Vue 2. For Vue 3, go to https://github.com/vuejs/core
Deliver web apps with confidence 🚀
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual Copilot