npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@wearejh/m2-pwa-engine

v0.39.1

Published

> TODO: description

Downloads

571

Readme

@wearejh/m2-pwa-engine

The core Progressive Web Application (PWA) engine for Magento 2, providing the foundational infrastructure and services needed to build modern, performant e-commerce experiences.

Overview

The m2-pwa-engine package serves as the backbone of the Magento 2 PWA ecosystem, offering essential utilities, state management, routing, and integration capabilities that power e-commerce applications. It provides a standardized foundation that other PWA packages can build upon.

Key Features

  • Redux Store Management: Lazy access to the Redux store with proper typing
  • Apollo GraphQL Integration: Client configuration and provider setup for Magento GraphQL API
  • Routing Infrastructure: Core routing utilities and components
  • Environment Configuration: Multi-environment support (development, staging, production)
  • Service Worker Support: PWA capabilities and offline functionality
  • TypeScript Support: Full TypeScript definitions and type safety

Architecture

graph TD
    A[m2-pwa-engine] --> B[Redux Store]
    A --> C[Apollo Client]
    A --> D[Router]
    A --> E[Environment Config]
    
    B --> F[State Management]
    C --> G[GraphQL API]
    D --> H[Navigation]
    E --> I[Multi-env Support]
    
    F --> J[Cart Module]
    F --> K[User Module]
    F --> L[Checkout Module]
    
    G --> M[Magento GraphQL]
    H --> N[Page Components]
    I --> O[staging/staging3/production]
    
    style A fill:#e1f5fe
    style B fill:#f3e5f5
    style C fill:#e8f5e8
    style D fill:#fff3e0
    style E fill:#fce4ec

Core Concepts

State Management

The engine provides a centralized Redux store with lazy initialization, allowing modules to register their reducers and access shared application state efficiently.

GraphQL Integration

Built-in Apollo Client configuration enables seamless communication with Magento's GraphQL API, handling authentication, caching, and error management.

Environment Support

The package includes configuration for multiple deployment environments:

  • Development
  • Staging (staging3 support added in v0.31.2)
  • Production

Modular Architecture

Designed to work with companion packages:

Installation

npm install @wearejh/m2-pwa-engine

Usage

The engine is typically initialized early in your application lifecycle:

import { initializeEngine } from '@wearejh/m2-pwa-engine';

// Initialize the PWA engine with your configuration
const engine = initializeEngine({
  apiUrl: 'https://your-magento-instance.com/graphql',
  environment: 'production'
});

Dependencies

This package works in conjunction with the broader Magento 2 PWA ecosystem and requires:

  • React for UI components
  • Redux for state management
  • Apollo Client for GraphQL communication
  • Compatible Magento 2 backend with GraphQL support

Contributing

This package is part of the larger mage-mono repository. Changes should be made following the established patterns and with consideration for backward compatibility across the PWA