|
dupersaurus posted:
I very much appreciated this joke.
|
# ? Dec 2, 2021 15:06 |
|
|
# ? Jun 7, 2024 04:56 |
|
okokok thanks all. This is helpful stuff. It sounds like I've already got a build output that people will want, so I'll update my documentation to instruct people to import a la carte.HaB posted:It sounds like you're conflating a few things. hahah yes. I'm really not sure why I misunderstood tree shaking so badly dupersaurus posted:and include the whole libraries, even if you're just using a single function from each, because you're not telling it that you're only using a single function from each: from my testing, even this will cause webpack to bundle the entirety of lodash in an app's final build
|
# ? Dec 2, 2021 16:10 |
|
teen phone cutie posted:from my testing, even this will cause webpack to bundle the entirety of lodash in an app's final build Yeah good point, I forgot that lodash has some submodules to better target specific functions. And it looks like there's now a babel plugin that will convert the imports for you
|
# ? Dec 2, 2021 16:54 |
|
teen phone cutie posted:from my testing, even this will cause webpack to bundle the entirety of lodash in an app's final build As for publishing your own package with tree-shaking enabled... You should ideally build both a commonjs and esmodules version of your library, and assign their paths to main and module in your package.json JSON code:
JSON code:
You'll also need to add sideEffects (a webpack-specific package.json property) with a value of false (or an array of file paths or globs of files which have side-effects) JSON code:
|
# ? Dec 2, 2021 20:00 |
|
Marak Squires, developer of the popular Faker.js and Colors.js libraries, has apparently continued his downward spiral from allegedly setting his home on fire with possible bombmaking materials back in September to publishing breaking changes for both libraries with weird right-wing Aaron Schwartz conspiracy theories, cries of liberty, and American flags. GitHub and NPM have, understandably, banned him for this and removed the broken versions. Dude's clearly got some significant mental health issues and is going through a lot right now, so I hope someone will be able to get him the help he needs. Unfortunately, there look to be at least a few folks on social media confusing the above for "evil corporations stepping all over the independent open source developers!!" and trumpeting him striking against the system. There are real discussions to be had about things like supporting open source projects or even the risks of tech giants monopolizing major dev tooling, but hooboy is this incident ever not a rallying cry for that. JavaScript code:
|
# ? Jan 10, 2022 06:18 |
|
Lmao, I’ve contributed to faker.js. When they added currencies they hosed up and for countries that support 2 currencies both got merged into one entry.
|
# ? Jan 10, 2022 08:48 |
|
A rant: I'm having a tough time getting a firm idea for how mobile Web Views work and the documentation for both iOS and Android seems piss poor (or expects broader familiarity with mobile development, which I'm awfully lacking in). Basically, I need validate that the rendering engine used by the Web View component on our supported OS versions has a specific modern JS primitive available—if not, have to do some janky poo poo with a third party library with equivalent functionality (but is not a 1:1 polyfill). The understanding I've arrived at is that iOS Web View makes use of the device's version of Safari, which is pinned to the loving iOS release, for some reason. I guess it's the same on Safari for MacOS? We "officially" support Safari, but it has such low usage and we're so stretched thin we've never given it attention. On Android, meanwhile, it looks like Android 4.4+ Web View uses Chromium/Chrome on Android, such that it will stay evergreen assuming the user hasn't manually toggled off updates (or installed something that supplants the system web view with FF or something). So theoretically we can impose the burden of keeping up to date just like we do for our web browser support (last X versions of all evergreen browsers). Thing is, the above assessments aren't from any explicit documentation, just cleaned hodgepodge from miscellaneous, sometimes conflicting sources. I'll need to actually go in and validate the primitive is available before I have any degree of confidence.
|
# ? Jan 13, 2022 04:28 |
|
This is because iOS users frequently update their OS as they get nagged to do so, and it is both no cost and available. Android still had quite a problem with updates due to the split between Google and the Vendor (tm). Googles workaround with v4 or whatever was to ship WebView updates with Google Store so that phone users stopped getting hacked so much. However Google Store generally means optional updates and thus you end up with a user base ranging from stock versions, which are significantly out of date on release day, to quite near the latest upstream version and everything in between. Thus making targeting minimum functionality quite annoying.
|
# ? Jan 13, 2022 11:31 |
|
The trick is to treat android users like the second class citizens they are.
|
# ? Jan 13, 2022 13:50 |
|
cries in pine/librem
|
# ? Jan 13, 2022 14:09 |
|
I've now lost my entire morning attempting to get an iOS 14 simulator installed through xcode. Fucker just stalls out ~66% and nothing I do resolves it.
|
# ? Jan 13, 2022 21:51 |
|
Cugel the Clever posted:I've now lost my entire morning attempting to get an iOS 14 simulator installed through xcode. Fucker just stalls out ~66% and nothing I do resolves it. I ran into this on older versions of simulator and xcode. I needed to download the package directly, move it into xcode's directory, and then restart. This: https://stackoverflow.com/questions/29058229/download-xcode-simulator-directly
|
# ? Jan 13, 2022 23:34 |
|
Xcode is like 90% of the reason I'm not pursuing a career shift into native iOS development
|
# ? Jan 14, 2022 05:18 |
|
Now doing the thing I’ve avoided for years: learning Webpack. I wanted to experiment with compiling Rust to web assembly (so far a bit disappointing in file size), and getting the wasm file integrated into an old site of mine has been much harder than I expected. First I tried using parcel because I’d heard it was zero configuration. It was awesome… except web assembly didn’t work. So then I started working through the webpack getting started tutorial and good lord I feel like this is SO much more complicated than the NPM build scripts I used to use. I’ve finally got it working but I’m a little stunned that this is the state of the art in build tools. It just feels so hostile and configuration heavy. Every single thing requires another package and four lines in four different places in the webpack.config.is file.
|
# ? Jan 14, 2022 05:27 |
|
Thanks for the recs. Fifth attempt was the charm and, after being stalled for 30+ minutes at 66%, it finally started (slowly) moving. Maybe it would have done so the other times! Either way, it's utterly mind-boggling to me... is it expected that simulator install takes over an hour with no meaningful user feedback??? Why does the install max out my fans?? Android simulator installations take ten minutes, tops. This, plus other arcane and poorly documented nonsense, has turned a task that should have taken at most a couple hours into a multiday epic of frustration that I'm still not 100% sure on. While I'm sure that mobile devs experience the same frustration of not knowing the little things that are essential for productive development when trying to get something done on the web, it doesn't make it any less excruciating. Siguy posted:Now doing the thing I’ve avoided for years: learning Webpack.
|
# ? Jan 14, 2022 07:07 |
|
Vite is very good. I'd choose it for a new project now.
|
# ? Jan 14, 2022 10:50 |
|
Chas McGill posted:Vite is very good. I'd choose it for a new project now.
|
# ? Jan 14, 2022 11:59 |
|
Webpack is magic compared to what came before, and it's not that bad once you get the hang of it, but yeah it's probably time for a new king to take the throne
|
# ? Jan 14, 2022 15:22 |
|
A few years back when i was still pretty junior, i went to a JS convention and this talk on webpack. the speaker had prepared code in different branches for each step in his talk, and during his demo, he spent a solid 20 minutes debugging his webpack config and even needed the audience to help him figure out what was wrong. at that moment, i knew everything i needed to know about webpack:
|
# ? Jan 14, 2022 16:19 |
|
Webpack is magic when it works. It works when you don't look at it, or change it, or do anything other than running a build script you cobbled together three years ago and haven't touched since, mainly out of fear.
|
# ? Jan 14, 2022 17:15 |
|
I built a NextJS site and I can't figure out why in the world it's laggy/choppy when I scroll on mobile. There's no repainting, nothing is rerendering that I can see. I tried everything. Scrolls fine on desktops, choppy as gently caress on mobile: https://brianpaskoff.vercel.app/
|
# ? Jan 15, 2022 01:36 |
|
This isn't choppy for me on a new iPhone, what device are you looking at it on?
|
# ? Jan 15, 2022 02:16 |
|
Looks good to me as well. iPhone 11, ios 15.2
|
# ? Jan 15, 2022 02:20 |
LifeLynx posted:I built a NextJS site and I can't figure out why in the world it's laggy/choppy when I scroll on mobile. There's no repainting, nothing is rerendering that I can see. I tried everything. Scrolls fine on desktops, choppy as gently caress on mobile: https://brianpaskoff.vercel.app/ It chugs a bit on chrome android, on a xiaomi poco x3. Maybe it's because of the size of the cat image? Although it's not _that_ big.
|
|
# ? Jan 15, 2022 02:45 |
|
lunar detritus posted:It chugs a bit on chrome android, on a xiaomi poco x3. I thought that too, but I've also tried with zero images rendering on the page. I should have specified: Chrome Android. Though it's surprising that iOS (Safari?) handles something better.
|
# ? Jan 15, 2022 02:47 |
|
On Pixel 5 with chrome is indeed a bit laggy. On Firefox, with the same phone, is fine.
|
# ? Jan 15, 2022 03:24 |
|
Cugel the Clever posted:Yeah... Webpack has come a long, long way toward being accessible and taking care of simple things out of the box, but it's still hostile enough that competitors keep popping up. I keep forgetting to look into esbuild.
|
# ? Jan 15, 2022 04:01 |
|
Anyone built anything with Remix yet? This (fairly long) blog post they did comparing it with Next.js is pretty interesting https://remix.run/blog/remix-vs-next
|
# ? Jan 19, 2022 21:35 |
|
prom candy posted:Anyone built anything with Remix yet? This (fairly long) blog post they did comparing it with Next.js is pretty interesting https://remix.run/blog/remix-vs-next One thing that stood out: quote:If the Next.js app moved away from client fetching, and used getServerSideProps, they would probably close the gap and have simpler answers to these questions.
|
# ? Jan 19, 2022 23:18 |
|
I've been building SPAs for about 5-6 years now and the idea of going back to the good old days is really tantalizing. Like you said the pain points won't be evident until you actually build something big with it but having a framework that's driven by basic web concepts coupled with modern tooling and being able to do modern UI sounds really nice. What I really want to know is if it can actually power a monolith. It seems easy enough to install an ORM and use it with your database, but I wonder what it looks like to build a large full stack application on it.
|
# ? Jan 20, 2022 00:40 |
|
interesting issue today where Redux devtools broke JIRA. Their last release added JavaScript code:
and JIRA was relying on global._ to be underscore code instead of the lodash library so it was clashing. Also their past 2 releases were created from each commit in this open PR. Very strange https://github.com/reduxjs/redux-devtools/pull/1031
|
# ? Jan 20, 2022 01:08 |
|
prom candy posted:I've been building SPAs for about 5-6 years now and the idea of going back to the good old days is really tantalizing. Like you said the pain points won't be evident until you actually build something big with it but having a framework that's driven by basic web concepts coupled with modern tooling and being able to do modern UI sounds really nice. Curious about the pain points you've encountered. Mostly just related to the build process, I reckon? When our agency switched from PHP monoliths to Next.js with a headless CMS, biggest pain points have been explaining to the client why they need to wait two minutes to see their changes on the site and why they have two different hosting bills.
|
# ? Jan 20, 2022 01:09 |
|
we use Next.js with getServerSideProps to build a relatively naive frontend for our main site, it whips rear end except for the way that all of the Next.js docs are like "hey have you considered static generation??" making me concerned that they're going to stop investing in server-side rendering in the framework I think static generation is a fool's errand for 99% of use cases and I'm really excited about Remix, we're fairly early in this project so we're keeping an eye on it and tracking how much work a switch would be. Think the biggest issue is that Remix tries to side step a lot of the complexity of rolling in a build pipeline like other frameworks by specifically not handling CSS or assets and telling you to bring your own parallel build process that outputs CSS - which I actually think isn't that bad in theory except that we use CSS Modules, which you really can't split away from your JS build process. (e: googling actually shows someone has figured out how to get CSS Modules using https://github.com/madyankin/postcss-modules and a bit of boilerplate per component, might give it a go) feel like the most reasonable paradigm for building web sites in 2022 is: "just write server-side logic like it's 2006 and you're writing Rails controllers, except now they go call microservices/your 'real' backend to fetch data, and your view layer is React and also everything has nice TypeScript static typing." Remix goes the further step of letting you handle forms using the same server-side paradigms of your data-fetching logic and I think that's cool as hell, especially for architectures like I've described where a form submission might not map 1:1 with your microservice API and you can now abstract that behind your server layer instead of adding a huge layer of client-side coordination logic and it goes without saying you can drop literally all state management tooling from your app when you go this route and that's an incredible weight lifted. I was backporting some data-fetching logic from our new Next app to the old custom SSR+Redux app to support some legacy pages, and turning it from "simple getServerSideProps logic that eventually passes down props to the root component of this page" to "a set of Redux actions that fetch a bunch of data, a Redux state for storing that data, and then a complex selector to pull out all of that data to derive the final props" made is crystal clear how much loving simpler life is once you cut out Redux-like stores when all you really want is to just fetching page data and not have long-lived state sorry I'm rambling this is basically the only thing I've been even slightly excited about in JS in the last two years since rather than be pie-in-the-sky thinking it's incredibly pragmatic and makes my life a lot simpler as a dev who no longer cares about building Ambitious Web Applications and now just wants to put pages on the internet without anyone yelling at me abraham linksys fucked around with this message at 04:10 on Jan 20, 2022 |
# ? Jan 20, 2022 04:04 |
|
That comparison was posted in my circles today and what I found immediately off about it was it explicitly ignored NextJS’s server side rendered features then claimed victory. Just felt a bit cherry picked and I left me curious what the comparison would be if they used SSR for both.
|
# ? Jan 20, 2022 04:45 |
|
prom candy posted:I've been building SPAs for about 5-6 years now and the idea of going back to the good old days is really tantalizing. i've been spending the last couple months working on a pure django project with zero JS and it's like putting on a comfy old sweater
|
# ? Jan 20, 2022 05:18 |
|
fsif posted:Curious about the pain points you've encountered. Mostly just related to the build process, I reckon? Managing loading/error states is annoying and i'd really like end to end type safety. Like if I make a change to the database schema I'd like to get type errors all the way through to my react components. Really I think I just want to stop working with Rails. Summit posted:That comparison was posted in my circles today and what I found immediately off about it was it explicitly ignored NextJS’s server side rendered features then claimed victory. Just felt a bit cherry picked and I left me curious what the comparison would be if they used SSR for both. I think it might partially be because that's what the next docs do? I don't have a ton of next experience but i used it recently and it really pushes you towards SSG. prom candy fucked around with this message at 06:13 on Jan 20, 2022 |
# ? Jan 20, 2022 06:09 |
|
After hours trying to fix that Chrome scrolling issue I talked about above, I found the cause of the problem. I tried everything - replacing the Image component with plain img tags, removing all the images, not using intersection observer, removing all animations, adding will-change: transform and backface-visibility: visible to all elements, etc. The issue was the background image. A tiny 1.6kb SVG: code:
|
# ? Jan 21, 2022 16:31 |
|
I'm looking to create a photo gallery. Like I've said before, my previous experience is just Wordpress, so what I want is an idiot proof way for my client to: - Upload images somewhere (Digital Ocean Spaces? An AWS S3?) - Manage folders and thumbnails (this is image transformations, correct?) Cloudinary looks to be the most recommended way to serve images, however the price jump from "free" to $89/mo. scares me. (Why don't any of these places have an in-between tier that's in the sweet spot of $20/month?) The project I have in mind is for a photographer friend, and he'll have galleries like Weddings, Engagements, Portraits, etc. Roughly 200 images, so half a GB if they're not uploading raw images? I could use just an S3 bucket with a CDN, but I want some way for them to manage the galleries.
|
# ? Jan 24, 2022 02:44 |
|
LifeLynx posted:I'm looking to create a photo gallery. Like I've said before, my previous experience is just Wordpress, so what I want is an idiot proof way for my client to: Honestly the best answer for this use case is Squarespace. It's such a solved problem that it's not worth building out a custom solution unless they have a really esoteric requirement.
|
# ? Jan 24, 2022 03:02 |
|
|
# ? Jun 7, 2024 04:56 |
|
blunt posted:Honestly the best answer for this use case is Squarespace. It's such a solved problem that it's not worth building out a custom solution unless they have a really esoteric requirement. It's more of a personal project as well as polishing my React skills, so I didn't want to go with a no-code solution.
|
# ? Jan 24, 2022 03:45 |