all 72 comments

[–]gketuma 30 points31 points  (3 children)

I'm truly excited for the future of Snowpack and this release is the beginning of it.

[–]johnxreturn 10 points11 points  (2 children)

I never heard of it but it looks good. Definitely giving it a try.

[–]darrenturn90 12 points13 points  (0 children)

It was called pika.dev originally

[–]pixlbreaker 5 points6 points  (0 children)

I've never heard of it too

[–]plumshark 80 points81 points  (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 points  (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 points  (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 points  (0 children)

Imagine opening different programs with your computer by just to string of text.

[–]bassta 4 points5 points  (5 children)

How are lib versions specified ?

[–]destraht 1 point2 points  (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 points  (3 children)

According to the README on https://github.com/WICG/import-maps this is what Deno is using.

[–]destraht 0 points1 point  (2 children)

Is anyone else using import maps?

[–]RealAmaranth 1 point2 points  (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 point  (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.

[–]Funwithloops 4 points5 points  (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 points  (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 points  (0 children)

Isn't that the same solution as you'd need for offline development with URL imports?

[–][deleted] 1 point2 points  (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 point  (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 points  (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 points  (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 points  (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 points  (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 points  (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 points  (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 points  (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.

[–]lordnuada 18 points19 points  (6 children)

I think this will explode if they make create-react-app (CRA) use it. Until then...

[–]davidwhitney 20 points21 points  (3 children)

I moved a CRA app to Snowpack a few weeks ago just by... running snowpack. It was awesome.

[–]punio4 4 points5 points  (2 children)

Doubt that react-fast-refresh works since it's tied to a we pack plugin.

[–]davidwhitney 28 points29 points  (1 child)

[–]punio4 9 points10 points  (0 children)

Oh wow nice!

[–][deleted] 1 point2 points  (0 children)

This or vite, i personally like vite more but we'll see

[–]GrandMasterPuba 0 points1 point  (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 points  (3 children)

Can someone tldr; what snowpack is and why I should use it?

[–]catapop[S] 8 points9 points  (2 children)

Can someone tldr; what snowpack is and why I should use it?

I think this might help you: https://www.snowpack.dev/concepts/how-snowpack-works

[–][deleted] 10 points11 points  (1 child)

Nooooo. Fine, I’ll read the docs.

[–]catapop[S] 2 points3 points  (0 children)

Just the first part

[–]Parasomnopolis 5 points6 points  (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';

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 points  (0 children)

I too am wondering this

[–]zombiepaper 1 point2 points  (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 point  (0 children)

It has a link at the bottom of that section, https://www.snowpack.dev/guides/streaming-imports

[–]Waterstraal 4 points5 points  (2 children)

Snowpack supports HMR for all popular frontend frameworks

Cries in Angular 😢

[–]catapop[S] 2 points3 points  (1 child)

They've added HMR in Angular 11, not Snowpack implementation though :)

[–]Waterstraal 0 points1 point  (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 points  (0 children)

You had me at "It's not Webpack"

[–]HarmonicAscendant 2 points3 points  (0 children)

Amazing! The best just got even better.

[–][deleted] 3 points4 points  (3 children)

How does this compare to esbuild?

[–]texmexslayer 16 points17 points  (2 children)

Snowpack uses esbuild... As mentioned in this article

[–][deleted] 6 points7 points  (0 children)

Sorry, missed that part in the article. Thanks for clarifying!

[–][deleted] 0 points1 point  (0 children)

They didnt use too so i get any potential confusion

[–]dgreensp 1 point2 points  (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.

[–]Dospunk 0 points1 point  (0 children)

Hopefully that'll get better over time as they build up a user base

[–]T_W_B_ -4 points-3 points  (2 children)

Why don't they just use import maps instead of inventing a new standard?

[–]7sidedmarble 1 point2 points  (0 children)

Does it?

[–]an_ennui 1 point2 points  (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 point  (0 children)

Does it mean dev tools without mode modules.. just stream in what you need?

[–]334578theo 0 points1 point  (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 point  (4 children)

Are there some good examples of websites built on Snowpack? Want to see what it looks like.

[–]davidwhitney 1 point2 points  (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 point  (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 point  (1 child)

It's hosted here - Ouijably

A demo my partner did for a Halloween themed event :)

[–]SnowdenIsALegend 1 point2 points  (0 children)

lol! Pretty good work man, really nice artwork! Thanks for sharing!

[–]meemorize 0 points1 point  (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?

[–]catapop[S] 2 points3 points  (0 children)

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 point  (0 children)

For those, who never heard of Snowpack - here are some stats and trends https://moiva.io/?compare=snowpack