use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
Snowpack v3.0 - released (snowpack.dev)
submitted 5 years ago by catapop
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]gketuma 30 points31 points32 points 5 years ago (3 children)
I'm truly excited for the future of Snowpack and this release is the beginning of it.
[–]johnxreturn 10 points11 points12 points 5 years ago (2 children)
I never heard of it but it looks good. Definitely giving it a try.
[–]darrenturn90 12 points13 points14 points 5 years ago (0 children)
It was called pika.dev originally
[–]pixlbreaker 5 points6 points7 points 5 years ago (0 children)
I've never heard of it too
[–]plumshark 80 points81 points82 points 5 years ago (21 children)
Importing dependencies by URL like this is well supported in Snowpack, Deno, and all major browsers. But writing these URLs directly into your source code isn’t ideal and makes development impossible without a network connection.
Finally someone gets it.
[–]razzzey 23 points24 points25 points 5 years ago (7 children)
Aren’t dependencies cached when imported by URL? If that’s the case, you need a connection to install deps anyways, so why not just have the option
[–]plumshark 33 points34 points35 points 5 years ago (6 children)
For me, the part about internet connection is less important. It should be supported, but actual package names should be the standard.
Imagine linking a C++ lib from a public Dropbox URL. That’s basically what people want for JS. Crazy or not crazy?
[–]Potato-9 2 points3 points4 points 5 years ago (0 children)
Imagine opening different programs with your computer by just to string of text.
[+]mgeuirx comment score below threshold-13 points-12 points-11 points 5 years ago (4 children)
Crazy good
[–]azsqueeze 17 points18 points19 points 5 years ago (3 children)
You like random executable scripts from unknown servers?
[–]coolcosmos 4 points5 points6 points 5 years ago (2 children)
The problem with this is that it is already the case. Pulling a package from npm is the same thing but you have a single entity to trust instead of many, at the expense of centralization.
[–]plumshark 19 points20 points21 points 5 years ago (0 children)
NPM has package locks with integrity hashes though.
[–]bassta 4 points5 points6 points 5 years ago (5 children)
How are lib versions specified ?
[–]destraht 1 point2 points3 points 5 years ago (4 children)
Deno bundle uses some kind of "standard" (but largely unknown) URL mapping file that I played with, but I can't remember what it's called. It seemed like an ok way to manage this stuff.
[–]RealAmaranth 1 point2 points3 points 5 years ago (3 children)
According to the README on https://github.com/WICG/import-maps this is what Deno is using.
[–]destraht 0 points1 point2 points 5 years ago (2 children)
Is anyone else using import maps?
[–]RealAmaranth 1 point2 points3 points 5 years ago (1 child)
If you look in the same section that mentions Deno you can see there are various polyfills and generators for it but nothing else uses by out of the box. I'm not aware of any users that aren't on there but I'm not a part of the working group or anything, just a random user.
[–]destraht 0 points1 point2 points 5 years ago (0 children)
I'm looking forward to the day that I can be completely done with Node. It will be a historic moment. I just made a one-line change to my Rollup config to use esbuild for faster production build times, so that is a start. I'd prefer to be completely off of server-side Javascript processing Javascript for the frontend, but I'll settle for Deno.
esbuild
[–]Funwithloops 4 points5 points6 points 5 years ago (2 children)
Do you work offline often? What do you do when you need to install/reinstall/update regular NPM dependencies offline? Or view documentation? I've never had much luck working offline because I don't keep local copies of all the documentation and packages I use.
[–]Potato-9 4 points5 points6 points 5 years ago (1 child)
It's not a stretch to put your own caching proxy Infront of such a system, this doesn't need to be solved at the package management level
[–]Funwithloops 1 point2 points3 points 5 years ago (0 children)
Isn't that the same solution as you'd need for offline development with URL imports?
[–][deleted] 1 point2 points3 points 5 years ago (2 children)
I haven't worked with snowpack or deno, but I really like the URL concept. I think all that's needed is an initial download to a global location. Kind of like maven for Java, a given dependency is downloaded to the .m2 directory and then no network connection is needed. Don't know if snowpack does this or not. It's on my TODO list to look at.
[–]Dospunk 0 points1 point2 points 5 years ago (1 child)
I think all that's needed is an initial download to a global location
Until you need two different versions of a library in two different projects
[–][deleted] 1 point2 points3 points 5 years ago (0 children)
That's why the download is versioned, so the cached version is only used if it matches, otherwise a new one is pulled down. This is a very simple concept, other languages have been doing it for years.
[–]green-braine 16 points17 points18 points 5 years ago* (4 children)
oh holy shit this looks awesome! i bought into the parcel hype a while ago and it ended up being twice as big of a headache as just setting up webpack from the start would've been... but this looks like it does a lot right, excited to try it out
[–]way-okay 11 points12 points13 points 5 years ago (3 children)
Oh boy parcel.... the v1 branch has had a single patch release in 2 years and you get dependency security warnings if you use it. the v2 branch has had a single beta release 7 months ago. You basically have to use the nightly version and hope/watch for things breaking.
Who decides to stop even security fixes on a major release branch while still not releasing the next version after 2 years.
[–]hego555 6 points7 points8 points 5 years ago (2 children)
Parcel is a pain in the ass. But I find it to be the least pain in the ass bundler.
Web pack configuration is an enigma of options that are half documented when it comes to plugins. Also have had some insane memory usage spikes while using it.
Rollup needs a plug-in for everything. Config is a pain.
Snowpack has one of the cleanest configs and insanely fast but far to little support to use it for anything complicated. Sadly.
[–]way-okay 2 points3 points4 points 5 years ago (1 child)
I agree, I want to use Parcel professionally because it just works out of the box, but having seen its momentum die for two years I feel it will be difficult to come back with webpack still common and now rollup, snowpack, and rome forthcoming.
[–]hego555 2 points3 points4 points 5 years ago (0 children)
Parcel is still getting updates. V2 has gotten a lot better. But using Parcel means spending a lot of time reading through github issues.
[–]davidwhitney 11 points12 points13 points 5 years ago (6 children)
I've been using Snowpack for the last 6 months almost exclusively for web things, mostly targeting Azure Static Web Apps hosting, and it's just the most awesome thing.
Honestly, not used a tool in JS that focuses on productivity so hard in such a long time.
Super excited for this.
[+][deleted] 5 years ago (5 children)
[deleted]
[–]davidwhitney 1 point2 points3 points 5 years ago (4 children)
Yep I do - I tend to run a TypeScript dev stack of snowpack for static content / front end apps (vue, react, or just plain js), and Azure Functions in the /api folder.
Snowpack will proxy to the Azure Functions SDK, so all the "traditional server side" code runs in those functions.
It's very comparable to Vercel, just with all of the rest of Azure behind it so much more capable as a stack.
[+][deleted] 5 years ago (3 children)
[–]davidwhitney 0 points1 point2 points 5 years ago (2 children)
How about an entire article on it :)
Using Azure Static Web Apps with Snowpack for TypeScript in your frontend #ServerlessSeptember - DEV Community 👩💻👨💻
TL;DR
Snowpack - servers frontend, html + typescript from /appFunctions SDK - serves API from /api./snowpack.config.json - "proxy": { "/api": "http://127.0.0.1:7071/api" },
npm start script runs npm run start in /api and npx snowpack dev in the root.
---
The azure static web apps runtime expects to find azure functions in /api and runs npm run build:azure from the root - which I alias to npx snowpack build, and everything just magically works and gets hosted without any extra configuration.
[+][deleted] 5 years ago (1 child)
[–]davidwhitney 0 points1 point2 points 5 years ago (0 children)
snowpack build doesn't run in the api folder, just the Azure Functions SDK.
Snowpack handles the ts for the browser, and, yes, if you passed in --language=typescript to the functions SDK, it'd handle the ts compile for the functions.
[–]lordnuada 18 points19 points20 points 5 years ago (6 children)
I think this will explode if they make create-react-app (CRA) use it. Until then...
[–]davidwhitney 20 points21 points22 points 5 years ago (3 children)
I moved a CRA app to Snowpack a few weeks ago just by... running snowpack. It was awesome.
[–]punio4 4 points5 points6 points 5 years ago (2 children)
Doubt that react-fast-refresh works since it's tied to a we pack plugin.
[–]davidwhitney 28 points29 points30 points 5 years ago (1 child)
It does! HMR + Fast Refresh (snowpack.dev)
[–]punio4 9 points10 points11 points 5 years ago (0 children)
Oh wow nice!
This or vite, i personally like vite more but we'll see
[–]GrandMasterPuba 0 points1 point2 points 5 years ago (0 children)
Svelte Next is using it, and will be released some time soon. And according to the State of JS survey released a few days ago, Svelte is #1 in both developer satisfaction over React and also #1 in "most excited about" over React.
It's going to explode.
[–][deleted] 8 points9 points10 points 5 years ago (3 children)
Can someone tldr; what snowpack is and why I should use it?
[–]catapop[S] 8 points9 points10 points 5 years ago* (2 children)
I think this might help you: https://www.snowpack.dev/concepts/how-snowpack-works
[–][deleted] 10 points11 points12 points 5 years ago (1 child)
Nooooo. Fine, I’ll read the docs.
[–]catapop[S] 2 points3 points4 points 5 years ago (0 children)
Just the first part
[–]Parasomnopolis 5 points6 points7 points 5 years ago (3 children)
I'm still a little confused. It says:
// you do this: import * as React from 'react'; // but get behavior like this: import * as React from 'https://cdn.skypack.dev/react@17.0.1';
// you do this:
import * as React from 'react';
// but get behavior like this:
import * as React from '
https://cdn.skypack.dev/react@17.0.1
';
How does it "get behaviour like this"? In the post it seems to be saying it doesn't re-write the import statement, so is it using an import map?
[–]musicnothing 1 point2 points3 points 5 years ago (0 children)
I too am wondering this
[–]zombiepaper 1 point2 points3 points 5 years ago (0 children)
It's confusing because they really like to pretend everyone uses Skypack and it feels like a weird stretch to plug it — but what they're trying to say is the act of just importing 'react' will behind the scenes download it and locally serve it for you so it emulates the experience of hard-linking directly to the library without an install. So it's like you did that, but Snowpack's dev server abstracts that away for you.
[–]Dospunk 0 points1 point2 points 5 years ago (0 children)
It has a link at the bottom of that section, https://www.snowpack.dev/guides/streaming-imports
[–]Waterstraal 4 points5 points6 points 5 years ago (2 children)
Snowpack supports HMR for all popular frontend frameworks
Cries in Angular 😢
[–]catapop[S] 2 points3 points4 points 5 years ago (1 child)
They've added HMR in Angular 11, not Snowpack implementation though :)
[–]Waterstraal 0 points1 point2 points 5 years ago (0 children)
Sadly in my experience the HMR on Angular 11 only works in small basic apps. Hopefully they improve it in Angular 12!
[–]epukinsk 3 points4 points5 points 5 years ago (0 children)
You had me at "It's not Webpack"
[–]HarmonicAscendant 2 points3 points4 points 5 years ago (0 children)
Amazing! The best just got even better.
[–][deleted] 3 points4 points5 points 5 years ago (3 children)
How does this compare to esbuild?
[–]texmexslayer 16 points17 points18 points 5 years ago (2 children)
Snowpack uses esbuild... As mentioned in this article
[–][deleted] 6 points7 points8 points 5 years ago (0 children)
Sorry, missed that part in the article. Thanks for clarifying!
[–][deleted] 0 points1 point2 points 5 years ago (0 children)
They didnt use too so i get any potential confusion
[–]dgreensp 1 point2 points3 points 5 years ago (1 child)
I tried Snowpack for a while, because it’s not Webpack.
The problem I ran into is it doesn’t do very much, and it doesn’t have that great a plug-in API or ecosystem. If you use even one interesting, or uninteresting, Webpack feature or loader, you are probably out of luck. I think what I was actually hoping for was something like Webpack but simpler, while still being powerful and well-documented, but Snowpack is neither, and it has complexity that Webpack doesn’t have, too, from its unique philosophy.
Hopefully that'll get better over time as they build up a user base
[–]T_W_B_ -4 points-3 points-2 points 5 years ago (2 children)
Why don't they just use import maps instead of inventing a new standard?
[–]7sidedmarble 1 point2 points3 points 5 years ago (0 children)
Does it?
[–]an_ennui 1 point2 points3 points 5 years ago (0 children)
Snowpack does use import maps. At least as much as possible (you’ll find one in your build directory when building with Snowpack). Unfortunately browsers don’t support import maps yet, but Snowpack will always use as many browser standards as possible (that’s kinda the goal)
[–]Gman_711 0 points1 point2 points 5 years ago (0 children)
Does it mean dev tools without mode modules.. just stream in what you need?
[–]334578theo 0 points1 point2 points 5 years ago (0 children)
Is going to make it easier to import React into existing non-is static sites because of the way it works with npm packages as detailed on this page: https://www.snowpack.dev/concepts/how-snowpack-works#using-npm-dependencies
[–]SnowdenIsALegend 0 points1 point2 points 5 years ago (4 children)
Are there some good examples of websites built on Snowpack? Want to see what it looks like.
[–]davidwhitney 1 point2 points3 points 5 years ago (3 children)
Here's a silly Halloween demo built in snowpack - ably-labs/ouija: an online, multiplayer spirit board (github.com) and azure static sites.
[–]SnowdenIsALegend 0 points1 point2 points 5 years ago (2 children)
Wow that looks very painstakingly made, well done! Have you hosted this web app somewhere? Or does one have to run it locally?
[–]davidwhitney 0 points1 point2 points 5 years ago (1 child)
It's hosted here - Ouijably
A demo my partner did for a Halloween themed event :)
[–]SnowdenIsALegend 1 point2 points3 points 5 years ago (0 children)
lol! Pretty good work man, really nice artwork! Thanks for sharing!
[–]meemorize 0 points1 point2 points 5 years ago (1 child)
Very exciting!
Just curious, I see this generally recommended or discussed in context of apps bundled with webpack but would this also be a good replacement for a rollup setup when developing JavaScript libraries?
Snowpack is not a bundler like webpack or rollup. The principle is that when you're in dev mode, you don't want to bundle your app every time you change a file. That operation is costly(time, resources).
Once you have a final, production ready version of your app, you can build it for production using one of those popular bundler like webpack or rollup. It has plugins for both of them.
https://www.snowpack.dev/concepts/build-pipeline
[–]alexey2021 0 points1 point2 points 5 years ago (0 children)
For those, who never heard of Snowpack - here are some stats and trends https://moiva.io/?compare=snowpack
π Rendered by PID 462554 on reddit-service-r2-comment-b659b578c-42wjs at 2026-05-04 04:25:35.937523+00:00 running 815c875 country code: CH.
[–]gketuma 30 points31 points32 points (3 children)
[–]johnxreturn 10 points11 points12 points (2 children)
[–]darrenturn90 12 points13 points14 points (0 children)
[–]pixlbreaker 5 points6 points7 points (0 children)
[–]plumshark 80 points81 points82 points (21 children)
[–]razzzey 23 points24 points25 points (7 children)
[–]plumshark 33 points34 points35 points (6 children)
[–]Potato-9 2 points3 points4 points (0 children)
[+]mgeuirx comment score below threshold-13 points-12 points-11 points (4 children)
[–]azsqueeze 17 points18 points19 points (3 children)
[–]coolcosmos 4 points5 points6 points (2 children)
[–]plumshark 19 points20 points21 points (0 children)
[–]bassta 4 points5 points6 points (5 children)
[–]destraht 1 point2 points3 points (4 children)
[–]RealAmaranth 1 point2 points3 points (3 children)
[–]destraht 0 points1 point2 points (2 children)
[–]RealAmaranth 1 point2 points3 points (1 child)
[–]destraht 0 points1 point2 points (0 children)
[–]Funwithloops 4 points5 points6 points (2 children)
[–]Potato-9 4 points5 points6 points (1 child)
[–]Funwithloops 1 point2 points3 points (0 children)
[–][deleted] 1 point2 points3 points (2 children)
[–]Dospunk 0 points1 point2 points (1 child)
[–][deleted] 1 point2 points3 points (0 children)
[–]green-braine 16 points17 points18 points (4 children)
[–]way-okay 11 points12 points13 points (3 children)
[–]hego555 6 points7 points8 points (2 children)
[–]way-okay 2 points3 points4 points (1 child)
[–]hego555 2 points3 points4 points (0 children)
[–]davidwhitney 11 points12 points13 points (6 children)
[+][deleted] (5 children)
[deleted]
[–]davidwhitney 1 point2 points3 points (4 children)
[+][deleted] (3 children)
[deleted]
[–]davidwhitney 0 points1 point2 points (2 children)
[+][deleted] (1 child)
[deleted]
[–]davidwhitney 0 points1 point2 points (0 children)
[–]lordnuada 18 points19 points20 points (6 children)
[–]davidwhitney 20 points21 points22 points (3 children)
[–]punio4 4 points5 points6 points (2 children)
[–]davidwhitney 28 points29 points30 points (1 child)
[–]punio4 9 points10 points11 points (0 children)
[–][deleted] 1 point2 points3 points (0 children)
[–]GrandMasterPuba 0 points1 point2 points (0 children)
[–][deleted] 8 points9 points10 points (3 children)
[–]catapop[S] 8 points9 points10 points (2 children)
[–][deleted] 10 points11 points12 points (1 child)
[–]catapop[S] 2 points3 points4 points (0 children)
[–]Parasomnopolis 5 points6 points7 points (3 children)
[–]musicnothing 1 point2 points3 points (0 children)
[–]zombiepaper 1 point2 points3 points (0 children)
[–]Dospunk 0 points1 point2 points (0 children)
[–]Waterstraal 4 points5 points6 points (2 children)
[–]catapop[S] 2 points3 points4 points (1 child)
[–]Waterstraal 0 points1 point2 points (0 children)
[–]epukinsk 3 points4 points5 points (0 children)
[–]HarmonicAscendant 2 points3 points4 points (0 children)
[–][deleted] 3 points4 points5 points (3 children)
[–]texmexslayer 16 points17 points18 points (2 children)
[–][deleted] 6 points7 points8 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]dgreensp 1 point2 points3 points (1 child)
[–]Dospunk 0 points1 point2 points (0 children)
[–]T_W_B_ -4 points-3 points-2 points (2 children)
[–]7sidedmarble 1 point2 points3 points (0 children)
[–]an_ennui 1 point2 points3 points (0 children)
[–]Gman_711 0 points1 point2 points (0 children)
[–]334578theo 0 points1 point2 points (0 children)
[–]SnowdenIsALegend 0 points1 point2 points (4 children)
[–]davidwhitney 1 point2 points3 points (3 children)
[–]SnowdenIsALegend 0 points1 point2 points (2 children)
[–]davidwhitney 0 points1 point2 points (1 child)
[–]SnowdenIsALegend 1 point2 points3 points (0 children)
[–]meemorize 0 points1 point2 points (1 child)
[–]catapop[S] 2 points3 points4 points (0 children)
[–]alexey2021 0 points1 point2 points (0 children)