Comments (5)
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.
This issue appears to be solved. Closing
from monorepo.
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.
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.
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)
- sw: Asset cache in precache handler not initialised correctly HOT 3
- Getting started not working properly HOT 4
- Running `remix vite:dev` throws rollup plugin error HOT 1
- Trying to build project throws error on [vite-plugin-remix-pwa:virtual-entry-sw] HOT 5
- Cannot initialize app in v4 HOT 1
- Incorrect sourmap on build due to plugin vite-plugin-remix-pwa:loader HOT 8
- Implementing push notifications HOT 4
- "@remix-pwa/push": "^1.0.2" is missing HOT 2
- how to setup Offline Page using remix-pwa HOT 3
- Server is crashing, no service worker being built, redeclaration of variable. HOT 1
- Uncaught SyntaxError: Unexpected token 'export' (at entry.worker.js:5666:1) HOT 7
- __workerManifest.assets is missing entry for manifest-{version}.js HOT 1
- Todo: Migrate to Biome
- Can't call `npx remix-pwa sw` HOT 4
- Question: remix-pwa inside electron HOT 1
- How to handle nonce on entry.worker.js?
- `process is not defined` when using `workerAction`
- why are you talking about `CustomLogger`in the doc about `Offline`
- Module '"@remix-pwa/dev"' has no exported member 'WorkerDataFunctionArgs'. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from monorepo.