Antonio Sarcevic
Antonio Sarcevic
  • 6
  • 31 988
Simple native-like App in SvelteKit!
This guide shows how to create a simple installable and offline-first web application using SvelteKit and workbox-precaching. It only takes less than ten lines of code for the Service Worker!
With this, you might not need a native App, or hybrid using Electron, React Native, Flutter, Tauri, Cordova or Ionic! Just build one web app that works everywhere, available from your home screen or app launcher and even offline. SvelteKit and workbox-precaching pair nicely to take the work off your hands.
🖼️ App Icons: www.sarcevic.dev/offline-first-installable-pwa-sveltekit-workbox-precaching/app-icons.zip
✂️ Code for copying and pasting: github.com/SarcevicAntonio/offline-first-pwa-sveltekit-workbox-precaching#readme
📝 Blog Post: www.sarcevic.dev/offline-first-installable-pwa-sveltekit-workbox-precaching
Timestamps:
00:00 Intro
00:36 Create SvelteKit App
01:08 App Icons
01:18 Web App Manifest
02:19 Service Worker
04:01 Define NODE_ENV
04:23 Notes on Offline Data
04:47 Prerender Pages
05:00 Check the App in prod
05:21 Useful Tips when working with Service Workers and Caching
05:59 Outro
Special thanks to my Schapsi 💖
Переглядів: 8 168

Відео

Svelte makes Drag And Drop API easy!
Переглядів 22 тис.Рік тому
This video shows how to create a minimal draggable and dropzone Svelte Action using the browser native Drag and Drop API. It only takes about 80 lines of code for the Svelte Actions. Svelte Actions are functions that make a node and hook into their lifecycle, making it easy to compose DOM work in components. Boilerplate Kanban Board without Drag and Drop for coding along: www.sveltelab.dev/rl7w...
{🧪} SvelteLab Launch Teaser
Переглядів 542Рік тому
SvelteLab is a supercharged REPL for Svelte. Instantly spin up a new SvelteKit project and share it with the world. 🧪 Try it now: sveltelab.dev/ ✨ Features: - 🌗 Light / Dark Mode - 🎨 Command Palette: Ctrl / CMD Shift P - 🧹 Code Formatting - 📒 Templates (TypeScript, Tailwind, mdsvex) - 📄 SvelteKit File Icons - 🛤️ SvelteKit Route Generation - ➕ Svelte Add - 📦 Install Packages - ⌨️ Vim Keybindings...
Antonio Sarcevic SvelteKit Testimonial
Переглядів 246Рік тому
Antonio Sarcevic SvelteKit Testimonial
Creating a Web App with Imba - The friendly full-stack language [#CozyCoding:001 Highlights]
Переглядів 2492 роки тому
This i s a cut up version of the full stream I did a couple of weeks ago. That stream was full of dead air, so I had to chop it up to be more concise. Watch the full stream here: ua-cam.com/video/H4RQ9HyX4UU/v-deo.html Check out Imba imba.io/ (and check the free tutorial course on scrimba too!) Visit my site www.sarcevic.dev/ Follow me on Twitter SarcevicAntonio
Creating a Web App with Imba - The friendly full-stack language [#CozyCoding:001 FULL STREAM]
Переглядів 3852 роки тому
I might be getting into web dev content creation, and felt like starting with a stream about exploring / using a cool programming language I found. I started by creating a little mockup to help me visualize the app I want to build, and then got my hands dirty implemeting it with Imba, a compile-to-js language that has some pretty neat syntax and features build in. At the end I deploy the app so...

КОМЕНТАРІ

  • @EliSpizzichino
    @EliSpizzichino 20 днів тому

    Nice, but most people need apps that are actually online... How would you do that?

  • @Arcade_Archie
    @Arcade_Archie 2 місяці тому

    Was bewirkt das '@const' im svelte/html code?

  • @mrsauravsahuin
    @mrsauravsahuin 3 місяці тому

    Amazing! 🔥

  • @figloalds
    @figloalds 3 місяці тому

    This should work ... And it didn't This is the most "Programmer thing" I can think of

  • @charlesokorobo508
    @charlesokorobo508 4 місяці тому

    You've said that you want to create simple things, on the Web platform. Unfortunately, these simple things will not take us anywhere. Please do a useful series, that can teach us to build massive Projects with Svelte and SvelteKit-- when you do find the time for it. WHAT WOULD I WANT? Here ( ua-cam.com/video/z1UMKqMN3VQ/v-deo.html ) is a series on building a Facebook clone with the MERN Stack (MongoDB, Express, React and Node) I will need you to do the same thing that this person did, and show us how to build the same thing (Facebook clone) with Svelte, SvelteKit and Postgres database. Regards.

  • @NabekenProG87
    @NabekenProG87 5 місяців тому

    Very cool, unfortunaltely the DnD API does not work on mobile :c. I don't want to use another library, I just want to be happy

  • @daleyc.3008
    @daleyc.3008 8 місяців тому

    I tried this on Svelte 5 with runes, smooth like butter. Nice video!

    • @KeesFluitman
      @KeesFluitman Місяць тому

      Where would u advise do i learn svelte 5?

  • @GrzegorzPalian
    @GrzegorzPalian 9 місяців тому

    Does your "update" function actually work? Unless there is some svelte magic going on, the functions created with the initial value of `state` (like handle_dragstart) would create a closure and never get the updated value when you reassign the variable like this. Am I missing something here?

  • @FrostFlag
    @FrostFlag 9 місяців тому

    lifesaver, this is so useful!

  • @ThanHtutZaw3
    @ThanHtutZaw3 10 місяців тому

    is there any mainfest config for multiple notification setting like native apps for pwa ?

  • @cv3787
    @cv3787 Рік тому

    Does this work with re-ordering between the items in the same column?

  • @FabianVilersBe
    @FabianVilersBe Рік тому

    Nice tutorial, thank you. May I add that I'd rather use the API function "dispatchEvent" on the node object to emit a "drop" custom event with the required data. node.dispatchEvent(new CustomEvent('custom_drop', { detail: data })); Then, the usage would be more idiomatic by writing <li class="column" use:dropzone on:custom_drop={onDropHandler}>(...)</li> My two cents ;-)

  • @nushankodikara
    @nushankodikara Рік тому

    Straight to the point! Awesome!

  • @RDR-jn1sn
    @RDR-jn1sn Рік тому

    Finally a tutorial that doesn't use svelte-dnd-action... thanks a lot!!!

  • @alpaslaneldemir6904
    @alpaslaneldemir6904 Рік тому

    Just incase someone implementing this on Tauri + Svelte set the "fileDropEnabled":false .

  • @chinmayk8004
    @chinmayk8004 Рік тому

    The brevity is bewilderingly beautiful !

    • @SarcevicAntonio
      @SarcevicAntonio Рік тому

      Haha thank you that was my main focus around the creation of this video 😁

  • @nicholasamaral7156
    @nicholasamaral7156 Рік тому

    I've been looking for offline svelte kit content for a while now. Does anyone have any recommendations of extra resources, reading I might do on this topic?

  • @jonathancastillo5953
    @jonathancastillo5953 Рік тому

    I also really enjoy using imba, thank you very much for the content. How can I put tabs or spaces in my VScode, using dot as seen in the video? Do you use plugin for scrolling or vim?

    • @SarcevicAntonio
      @SarcevicAntonio Рік тому

      To show whitespace (tabs and spaces) visibly in vscode I use this setting: "editor.renderWhitespace": "boundary", I'm not sure what you mean by scrolling. I don't use vim, but have some scrolling-related settings: "editor.smoothScrolling": true, "terminal.integrated.smoothScrolling": true, "workbench.editor.scrollToSwitchTabs": true, "workbench.list.smoothScrolling": true,

    • @jonathancastillo5953
      @jonathancastillo5953 Рік тому

      @@SarcevicAntonio Thank you so much, I really appreciate it.I'll be watching for new videos.

  • @justingolden87
    @justingolden87 Рік тому

    Very informative! I thought of something else for DND, not "drag and drop" lol

  • @rogueyoshi
    @rogueyoshi Рік тому

    REALLY wanted this, thanks.

  • @sarma_sarma
    @sarma_sarma Рік тому

    I want more details about it because i want to run one app offline and sync with network when get internet access back

  • @twd2
    @twd2 Рік тому

    great, and we watting for handling data offline with couchdb,pouchdb!!!

  • @magick93
    @magick93 Рік тому

    Very interesting! Thank you

  • @cholasimmons
    @cholasimmons Рік тому

    I needed this information so bad 🤣👌

  • @Kikibeh
    @Kikibeh Рік тому

    Great video, very helpful! How would you handle the drag and drop on touch devices e.g. smartphones or tablets? May you do a video of that as well?

  • @guynatumanya
    @guynatumanya Рік тому

    Exactly what I've been looking for! Thank you....

  • @andrewbullen1799
    @andrewbullen1799 Рік тому

    Knowing how to connect this kind of app to FireBase would be extremely valuable🙏

    • @greendsnow
      @greendsnow Рік тому

      There are many svelte firebase tutorials out there. You initialize firebase on you main layout and use it in you components basically

  • @nickstaresinic9933
    @nickstaresinic9933 Рік тому

    Very impressive, Antonio -- well organized and presented, and it expands my understanding of how/when to use actions. Thanks.

  • @Martin-kt8sz
    @Martin-kt8sz Рік тому

    Excellent video, great work !

  • @anton-shubin-live
    @anton-shubin-live Рік тому

    Please make a CouchDB video about offline apps :)

  • @meka4996
    @meka4996 Рік тому

    Awesome! Thanks

  • @roblesrt
    @roblesrt Рік тому

    This is what I'm looking for! more samples please. Thanks!

  • @IStMl
    @IStMl Рік тому

    Wow

  • @sledgex9
    @sledgex9 Рік тому

    Can someone explain to me 5:10? I am coming from C++ and I am a JS noob. It seems to me that changing the "state" variable after the draggable() function has returned (via update()) it will also affect the data seen inside handle_dragstart() after it is called as an event listener at a later time. Is that correct? So the "state" variable not only outlives the draggable() function but it also has effects on the nested functions? Does this behavior/pattern have a name in JS so I can read up on it?

    • @trzcin5724
      @trzcin5724 Рік тому

      I think this is called a closure.

    • @sledgex9
      @sledgex9 Рік тому

      @@trzcin5724 Thank you. I had just read up on Closures on MDN. I'll give a more detailed comment below this one.

    • @sledgex9
      @sledgex9 Рік тому

      For any other noob wondering: You must read on what "closures" are in Javascript and how they behave in that context. MDN has a very good article on them. In short and very simple words(mostly in C++ speak): Closures( lambdas in C++) capture the variables in their surroundings by reference AND extend their lifetime. Hence, a variable captured in one closure can be updated in another closure that has captured the same variable even if that variable was local to the surrounding scope.

  • @hazreh
    @hazreh Рік тому

    How do you think this approach stacks up against the Vite PWA plugin?

    • @SarcevicAntonio
      @SarcevicAntonio Рік тому

      Vite Plugin PWA generates a Service Worker and Manifest for you via configuration. If you don't want to deal with the Service Worker and Manifest yourself and want to benefit from the extra features (like update prompt and automatic reload), it's a solid option! For me personally, it felt like too much magic and overhead, as I did not fully understand how it worked and what it does behind the scenes. The docs are a bit hard to understand for me. With the approach from the video, we are in full control and know exactly what our Service Worker does. Since SvelteKit already provides the $service-worker module, it makes integrating with workbox modules like workbox-precaching super straightforward!

    • @maloxi1472
      @maloxi1472 Рік тому

      @@SarcevicAntonio Wow ! It would be great if you could present these specific arguments in a standalone video (or maybe link to a post). I've always had a weird feeling about the vite pwa plugin (and even worse, the more idiosyncratic, insufficiently documented and always-somewhat-out-of-date "@vite-pwa/sveltekit") and had a hard time figuring out what the purpose of it all was or how it would compare do a more hands-on approach like I was used to doing in Vue 5 years ago. Judging by the likes on your reply, I'm not alone. I wasn't even aware that Sveltekit provided its own service worker module and now that I've read your comment, I'm even more confused as to what is the value provided by @vite-pwa/sveltekit. A video or post where you compare the vite-plugin-pwa or @vite-pwa/sveltekit workflow to the one you prefer ($service-worker with a la carte workbox modules) would be amazing !

  • @zipcod7726
    @zipcod7726 Рік тому

    Cool! I subscribe

  • @blokche_dev
    @blokche_dev Рік тому

    svelte actions are so powerful. Thanks for sharing.

  • @hallowatcher
    @hallowatcher Рік тому

    Cool, thanks!

  • @roblesrt
    @roblesrt Рік тому

    Amazing! Thanks for sharing!

  • @naranyala_dev
    @naranyala_dev Рік тому

    more about svelte 😍

  • @Hurby24
    @Hurby24 Рік тому

    great video

  • @SvelteSociety
    @SvelteSociety Рік тому

    Nice!

  • @ScriptRaccoon
    @ScriptRaccoon Рік тому

    Very well explained!

  • @Huntabyte
    @Huntabyte Рік тому

    What VSCode theme are you using? Joking aside, great video!

  • @JoyofCodeDev
    @JoyofCodeDev Рік тому

    🔥

  • @fist4fun
    @fist4fun 2 роки тому

    Imba is awesome. Good content. Sub👍🏻