Coding Shorts: Using the Vite PWA Plug-in

  Рет қаралды 24,086

Shawn Wildermuth

Shawn Wildermuth

Күн бұрын

While most SPA frameworks have their own PWA plugins, the Vite development tool also has one. What I like about it is that you have the same plugin whether you're using Vue, React, SvelteKit, or Pure JavaScript. Since it's at the Vite level, it is easier to manage. Let's take a look:
00:00 - Introduction
00:54 - The Project
02:51 - Installing the Plugin
04:05 - The PWA Files
05:12 - Customizing the Manifest
07:27 - Testing Offline
09:00 - Adding a Runtime Cache in the workbox
12:39 - Wrapping Up
Source code: github.com/shawnwildermuth/co...
If you like this video, you might like other videos in my Instructional Videos:
- • Instructional Videos
You can hire me too! You can reach me at my new website:
- shawn.wildermuth.com

Пікірлер: 66
@theAutomaTom
@theAutomaTom 17 күн бұрын
Thanks for this part of the chat! I would love to hear more about how the Asp project must be acting as the pwa's server. It's got me a little stumped, and the plugin's deploy docs don't include .Net. You are the best! 👉👉💯
@alexanderx7959
@alexanderx7959 Жыл бұрын
wanna say it's pretty usefull review! no huge explanations of obvious things, which are so popular nowadays, just essentials that experienced developer have to know to get how it works in general. keep going man! thumbs up!
@josephcobbinah5412
@josephcobbinah5412 Жыл бұрын
This is brilliant!!! Will be writing my first PWA with React and Vite. You have a new subscriber!!!
@atrex4943
@atrex4943 9 ай бұрын
I'm surprised I haven't come across your channel before but it's a godsend. I'm about to start a contract at work to build a POS and one of the requirements is that it has to be a PWA for offline mode. This saved me loads of time wading through all of the project scaffolding and documentation to get started. Thank you.
@kanucu252
@kanucu252 8 ай бұрын
Been learning about PWA's for the past 2 weeks, and you made it simple as it can be. Thanks alot!
@swildermuth
@swildermuth 7 ай бұрын
Glad it helped!
@eswilhite
@eswilhite Жыл бұрын
Spinning up a new app that has offline-first as it's primary requirement. This is a big help! We are using SolidJS (app needs to work well on lower end mobile so the rendering performance is necessary) and Vite. I found Vite PWA today but got lost in the config. Timely video, thanks!
@kamruzzaman6252
@kamruzzaman6252 8 ай бұрын
Thanks a lot . This is a great guide!
@mongoosethe
@mongoosethe 8 ай бұрын
This is a great guide! Thank you. Subscribed.
@weamadel156
@weamadel156 5 ай бұрын
That was so helpful, thank you so much.
@siyedyoussef3202
@siyedyoussef3202 Жыл бұрын
Great video and very helpful 👍
@swildermuth
@swildermuth Жыл бұрын
Glad to hear it!
@Miscafer
@Miscafer 8 ай бұрын
Thanks so much!, your tutorial works for me a lot.
@swildermuth
@swildermuth 7 ай бұрын
You're welcome!
@polocholocho
@polocholocho 7 ай бұрын
you're great Sir. Thanks
@jean-baptistebalmont5629
@jean-baptistebalmont5629 Жыл бұрын
very efficient demo thanks a lot swildermuth
@swildermuth
@swildermuth Жыл бұрын
You are welcome!
@1046sacm
@1046sacm 7 ай бұрын
Amazing content, new follower.
@shubham0324
@shubham0324 Жыл бұрын
Thank you! Where GPT and Bing AI, couldn't help, this video saved my day❤
@swildermuth
@swildermuth Жыл бұрын
Glad it helped!
@kamichikora6035
@kamichikora6035 10 ай бұрын
Some damn great stufff
@swildermuth
@swildermuth 10 ай бұрын
Thanks!
@jasonhamm7174
@jasonhamm7174 Жыл бұрын
great video :)
@johnycache
@johnycache 23 күн бұрын
Subscribed. Great stuff. Thanks. It's good to know this is available. Have you built something with it that was released as an app? (working on android and ios?)
@hoomehrstk4977
@hoomehrstk4977 5 ай бұрын
Tnx for share this... I use it
@hulmee
@hulmee Жыл бұрын
This was very helpful thank you Code U do a video on vite-electron-plugin ?
@iiErr0R
@iiErr0R 6 ай бұрын
THANKS!!!
@onedev7316
@onedev7316 Жыл бұрын
Thank you very much excellent content as always. As you asked for it can you please do a coding short for user impersonation using JWT/Identity. 😃 Thanks
@swildermuth
@swildermuth Жыл бұрын
Noted
@onedev7316
@onedev7316 Жыл бұрын
@@swildermuth Thank you so much
@manishbasnet6662
@manishbasnet6662 Жыл бұрын
big fan from nepal sir
@swildermuth
@swildermuth Жыл бұрын
Awesome, love your country (was in Katmandu a few years ago).
@pablom8854
@pablom8854 6 ай бұрын
Thnaks for this! btw what does the as const does??
@swildermuth
@swildermuth 6 ай бұрын
it prevents it from being changed.
@JohnDoe-sz5jh
@JohnDoe-sz5jh 8 ай бұрын
I have an application I'm working on that requires this very thing. I was tryiung to make reactPWA work with React 18 (in Vite) and Material UI v5. Thanks! Much appreciated!
@swildermuth
@swildermuth 8 ай бұрын
Good luck!
@usamarasheed7222
@usamarasheed7222 8 ай бұрын
i am doing the project with same react 18 and mui but i can't solve this issue yet I am getting error at sw.js with cors origin issue can you please share the code
@ranulagihara1113
@ranulagihara1113 7 ай бұрын
Nice explanations, but I have a question ? think we have admin and user functionalities in a same app, can we disable PWA feature for admins ?
@swildermuth
@swildermuth 7 ай бұрын
Honest I am not sure. Probably not in the Vite PWA plugin, but if you used the actual framework PWA solution you might have more flexibility.
@baptisteauscher2063
@baptisteauscher2063 8 ай бұрын
Great video, thank you, however, i can't make it work. Everything works just fine until i try to add a runtime cache in the workbox. I write something very similar to you and none of my data that is fetched on the distant api is cached (i don't see it in the Application/Cache Storage and my web app doesn't work when i turn on the offline mode). Is there something to do when the data is fetched to cache it ? It is weird because i don't get any errors ... [edit] it finally worked even though i didn’t do anything, i am not really sure why but i guess chrome needed some time to update
@swildermuth
@swildermuth 8 ай бұрын
I've seen that. I usually use a clean browser (e.g. MSEdge) to do the development so I can be sure my extensions in Chrome aren't exacerbating it.
@user-gj7ih4hy5f
@user-gj7ih4hy5f 10 ай бұрын
For API requests, it only caches it on the second reload. Is there any workaround to make it cache on first visit
@swildermuth
@swildermuth 10 ай бұрын
It should be caching on first request, but I find it fidly...maybe make an issue on the github for the plugin github.com/vite-pwa/vite-plugin-pwa
@tommycisternino
@tommycisternino 4 ай бұрын
what about code update? the app is keeping in cache the old code
@arunprasath960
@arunprasath960 6 ай бұрын
Why am I getting this error when I deploy in vps ? Error: Manifest: property 'src' ignored, URL is invalid.
@nwekemaxwell6595
@nwekemaxwell6595 2 ай бұрын
the api caching doesn't work on my app, any tips to debug this??? thanks for the lesson
@swildermuth
@swildermuth 2 ай бұрын
I assume you've looked at the "Application" tool in the debug tools?
@ColinRichardson
@ColinRichardson 10 ай бұрын
Hmmm, 6:49 seems to be where this breaks for me.. I ended up having to run the full build and then and used `npx local-web-server` from the dist folder to get the install icon.. Shame it doesn't seem to work from simple dev server
@swildermuth
@swildermuth 10 ай бұрын
It should, it's just files in the server. How does it not work?
@ColinRichardson
@ColinRichardson 10 ай бұрын
@@swildermuth dev server didn't serve them for some reason. No errors, just no button to install. But when I ran up the dist as a full fledge server and added it to my reverse proxy I got the button.
@JohnnyMentat
@JohnnyMentat 9 ай бұрын
Observation: Seems like it has to be a 512x512 icon. I just selected a random 32x32 png, and it does not work. I had to select a 512x512 png to get the Install icon to display.
@swildermuth
@swildermuth 9 ай бұрын
Depends on the OS, normally you'd supply a few different sizes.
@JohnnyMentat
@JohnnyMentat 9 ай бұрын
@@swildermuth I was testing on my desktop PC. Your reply makes sense though. Maybe it would have worked had I tested it on another OS where 32x32 was appropriate. Thanks for the reply and great video!
@alimaher1
@alimaher1 8 ай бұрын
I have an issue with runtime caching for api?
@swildermuth
@swildermuth 8 ай бұрын
What's the issue?
@alimaher1
@alimaher1 8 ай бұрын
@@swildermuth It seems not working at all. The precache is working fine, but the runtime caching is not working. No errors come out, but it doesn't even create the runtime caching file in Cache Storage. ` workbox: { runtimeCaching: [{ urlPattern: "https:\\/\\/openweathermap\\.org\\/api\\/.*", handler: "NetworkFirst", options: { cacheName: "api-cache", cacheableResponse: { statuses: [200] }, rangeRequests: true } }] }` These are the line of codes I changed.
@geethad.m.5737
@geethad.m.5737 8 ай бұрын
@@alimaher1 Were you able to fix it? Even I've the same issue. Runtime cache is not generated in the cache storage.
@vinnylozada
@vinnylozada Жыл бұрын
I hope that was not actual real customer data in the demo application. 1:31
@swildermuth
@swildermuth Жыл бұрын
I hope that is a joke
@vinnylozada
@vinnylozada Жыл бұрын
@@swildermuth My apologies. It looked real and you made no mention it was fake data, so I commented. Carry on.
@jonathansaindon788
@jonathansaindon788 Жыл бұрын
@@swildermuth Perfect response! 😅 on a side note, Vite means “fast” in French so I hope it is fast!
@KingTambay
@KingTambay 24 күн бұрын
Hi sir, I am looking for a mentor, can you teach me your tech skills, I am willing to work no fees.
@rodrigososa5281
@rodrigososa5281 7 ай бұрын
Mf looks like an AI generated character model
@Alaaja8899
@Alaaja8899 4 ай бұрын
Wtf💀
Coding Shorts: What Surprised Me About ECMAScript Modules
11:16
Shawn Wildermuth
Рет қаралды 1,4 М.
Coding Shorts: Use Open Telemetry in ASP.NET Core
15:32
Shawn Wildermuth
Рет қаралды 3,8 М.
Luck Decides My Future Again 🍀🍀🍀 #katebrush #shorts
00:19
Kate Brush
Рет қаралды 8 МЛН
The day of the sea 🌊 🤣❤️ #demariki
00:22
Demariki
Рет қаралды 92 МЛН
Can You Draw A PERFECTLY Dotted Line?
00:55
Stokes Twins
Рет қаралды 77 МЛН
7 Web Features You Didn’t Know Existed
10:16
Fireship
Рет қаралды 273 М.
A Beginner's Guide to Add PWA to Your Website Using Vite PWA
13:16
This Dot Media
Рет қаралды 6 М.
Why is Everyone Using Vite?
7:34
Awesome
Рет қаралды 75 М.
Coding Shorts #102: Using SQL Server Containers for Dev
11:00
Shawn Wildermuth
Рет қаралды 1,8 М.
How to Create a PWA With Next.js in 10 Minutes
13:08
James Q Quick
Рет қаралды 102 М.
These Coding Projects Give You An Unfair Advantage
14:39
Harkirat Singh
Рет қаралды 322 М.
Intro To Service Workers & Caching
35:26
Traversy Media
Рет қаралды 231 М.
Coding Shorts: .NET Aspire - The Host
13:32
Shawn Wildermuth
Рет қаралды 2,1 М.
Every React Concept Explained in 12 Minutes
11:53
Code Bootcamp
Рет қаралды 426 М.
Node.js is a serious thing now… (2023)
8:18
Code With Ryan
Рет қаралды 630 М.
cute mini iphone
0:34
승비니 Seungbini
Рет қаралды 5 МЛН
Main filter..
0:15
CikoYt
Рет қаралды 13 МЛН
Хотела заскамить на Айфон!😱📱(@gertieinar)
0:21
Взрывная История
Рет қаралды 4,4 МЛН
Low Price Best 👌 China Mobile 📱
0:42
Tech Official
Рет қаралды 717 М.