Code Monkey home page Code Monkey logo

Comments (5)

tyshgc avatar tyshgc commented on September 17, 2024 1

Hi! @ShafSpecs
I now understand that with the migration of remix-pwa@4 to Vite, the previous building process through the CLI has been transitioned, and the importance of using the latest tag. Thank you for your support!

from monorepo.

ShafSpecs avatar ShafSpecs commented on September 17, 2024 1

This issue appears to be solved. Closing

from monorepo.

tyshgc avatar tyshgc commented on September 17, 2024

Hello,

I have an update regarding the issue I previously posted. I decided to run the help command to further understand the available commands and their purposes:

Commands: 
  manifest [options] Generate a web manifest file
  sw|service-worker [options] Generate a service worker file
  help [command] display help for command

It became apparent that the correct command to create a service worker file is npx remix-pwa@latest sw , not npx remix-pwa@latest init as I initially thought. Additionally, it's crucial to include the @latest keyword in the command.

However, I discovered that using npx remix-pwa@latest sw directly generates a basic entry.worker.ts file, bypassing any setup wizard or interactive prompts.

The command executed was:

$ npx remix-pwa@latest sw
Generating TypeScript service worker file...

And this resulted in the following entry.worker.ts file being generated:

/// <reference lib="WebWorker" />

export {};

declare let self: ServiceWorkerGlobalScope;

self.addEventListener('install', event => {
  console.log('Service worker installed');

  event.waitUntil(self.skipWaiting());
});

self.addEventListener('activate', event => {
  console.log('Service worker activated');

  event.waitUntil(self.clients.claim());
});

This outcome clarifies the process for generating a service worker file, albeit without the guided options initially expected.

from monorepo.

ShafSpecs avatar ShafSpecs commented on September 17, 2024

Hello @tyshgc 👋, I am yet to publish the changelog to the documentation site but the CLI no longer scaffolds a PWA. Due to [email protected] migrating to vite, there doesn't seem to be anything to scaffold as everything is wrapped in a plugin. Because of that, the CLI now allows you to generate the various components of PWA - manifest, service worker. Without jeopardizing your Vite App

from monorepo.

ShafSpecs avatar ShafSpecs commented on September 17, 2024

Regarding the use of latest, that is crucial when you have multiple versions of remix-pwa available. You can remove the old versions by clearing out your npm cache (If you didn't install it globally), but I guess you have other packages you would love to keep in the cache that you use regularly, so the solution is to use the latest tag as npm randomly picks versions (in my own experience) without a tag present

from monorepo.

Related Issues (20)

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.