mastodon.xyz is one of the many independent Mastodon servers you can use to participate in the fediverse.
A Mastodon instance, open to everyone, but mainly English and French speaking.

Administered by:

Server stats:

802
active users

#webpack

0 posts0 participants0 posts today
Replied in thread

I'm learning just a tad-bit about #AMD ( #asynchronous #module #dependencies ) and #RequireJS. I've always been too retarded to do anything with #Webpack, because it needs to be running server-side as well as clientside in the browser (I think). Dependencies bundled together in real time, at the server side, plus whatever minifier and obfuscation they decide to add.

With RequireJS, it just needs to find static JS files in the URL folder structure it expects. So you can use really any webserver.

Continued thread

Another try, and I'm giving up once again 😭

I just can't upgrade my whole build setup to use #webpack + #typescript + #esmodules for both the app code and the test suite. Something always breaks. I lose *hours* reading github issues and stuff, trying stuff left and right, trying to switch to this or that, nothing works entirely, and it never breaks the same way.

That kind of nonsense will end up with me abandoning my side project 😩

You can send query params to a #javascript module at import time

import "./mymodule.js?hello=world"

and then read them from import.meta.url

const hello = new URL(import.meta.url).searchParams.get('hello');

It does get a little hairy if you’re using a bundler like #webpack, #vite or #parcel

esimmler.com/passing-url-param

esimmler.comPassing URL params to Javascript modulesOne weird trick our tools apparently don't want us to use

Please don't judge the site itself in terms of design, etc. cos I'm very much a backend engineer and I am still learning and rely on others' designs just so I could get my ideas out there - BUT I've managed to write my first ever site using #Eleventy 🎉

It's also my first time working with
#NodeJS, #Javascript (not really, but first time meaningfully), #Typescript, and #Sass CSS. I've always wanted a fun way of maintaining a portfolio/resume instead of writing them up using #MicrosoftWord and whatnot, so that's what I've set myself to make with #11ty and I'm pretty happy with the results.

This project supports both JS and TS in modern browsers as well as legacy browsers using
#Webpack. As mentioned it also uses Sass which is mindblowing to me how awesome it is, I've always hated how messy and non programmatic CSS is and this thing just solves those issues singlehandedly. In a local development environment, this project also supports all sorts of linting from HTML, CSS, JS, and TS so my perfectionist brain can sleep soundly at night knowing I've not unknowingly used a single quote instead of a double quote.

My project,
Portfolio essentially is aimed to produce two personalised views - a Portfolio/Homepage view and a Resume view based on user-supplied data files. The Resume view has a downloadable PDF version automatically generated for it using #Puppeteer - so no proprietary, paid APIs are required for the HTML-PDF conversion. Also, as a #Kubernetes engineer first and foremost - I've #Docker -ised it (based on #Alpine and uses #Apache as the web server) and created a #Helm chart you could use to easily deploy it to your Kubernetes cluster locally or to the internet (with Ingress).

I've made the entire stack public on
#GitLab just in case someone would find it useful to refer to for their own (future) projects.

🔗 https://gitlab.com/irfanhakim/portfolio

🔗 https://gitlab.com/irfanhakim/pepatung

🔗 https://gitlab.com/irfanhakim/portfolio-chart

🔗 Demo: https://portfolio.moekai.com

GitLabirfanhakim / portfolio · GitLabA dynamic site built using Eleventy that generates a personalised portfolio and resume with PDF support based on user-provided data. Demo:

I just released 1.0.3 of Python Webpack Boilerplate

No matter if you are using Django or Flask, this package can bring modern frontend techs to your project, within minutes.

1. Remove `Bootstrap` from the default setup. Now user can pick TailwindCSS, Bootstrap or other solutions as they like
2. Add doc to help switch from Babel to SWC (Speedy Web Compiler), it is really fast 🚀
3. Update frontend dependency to the latest version

github.com/AccordBox/python-we

GitHubGitHub - AccordBox/python-webpack-boilerplate: Django Webpack boilerplate & Flask Webpack boilerplateDjango Webpack boilerplate & Flask Webpack boilerplate - AccordBox/python-webpack-boilerplate

<rant>
Yesterday I got really sad about the state of IT and how very rarely we go back and actually fix things and instead we just keep piling more sort-of fixes onto each other.

I was trying to help my partner to add an (background)image to her website.

She managed to find a manual for #tailwind to create a custom class and after a few fixes we got it working, sort of. #Webpack was being, as usual, less than helpful and spew few incomprehensible errors about loader type missing. I know this, I get how to fix this, but the config botch to make it work is ... less than optimal.

Then I noticed that the original design actually used image tag directly to show a placeholder svg. Cool, let's use that. #EmberJS has a cool library ember-responsive-image that will do 90% of the job. Well, in the version the project is using, the image needs to be imported through (already configured) dark magic of webpack imports. Cool, let's do that. Oh no this part of the app is lacking controllers, let's define those. Now I have to explain why this whole whoop of new files and references exists. To show an effing image on an effing webpage.

So we just went old school of defining HTML IMG tag and referencing the non responsive, non optimised image directly from assets. Flip this, Apple landing page literally downloads 100MB to show a scrollbar invoked animation. How bad is it for a private website to show an non optimised image?
</rant>

Now the practical part: More than 20 years ago when I started playing with #HTML and Apache I was researching if it's possible to stream images. So that it's not the developer at the build time to decide the dimensions and quality being displayed, but the webpage at show time saying: "I will need to fill in 2000x1000 pixels for this one image, please keep em coming".

And no, images scaled on the server over query params are not what I'm looking for. That's just a botch that brings more problems than solutions.

I'm talking about an image format where first kB when brutally chopped off would be render-able as a very low res representation of said image. Then next 10kB would give slightly sharper image, then the next 100kB...

And the browser would just keep streaming next part until it would decide it has enough to fill in given space perfectly.
This is the solution to the problem that should've been built in the first place. We could have avoided all the `picture` and `srcset` and build time optimisation and N-times cache invalidation dance. I'm looking for a solution that removes responsibility from the user instead of giving them more work.

Now please tell me that I'm just old and this technology already exists.

If you think react is complicated now, go back to 2015 when you had to configure babel and webpack yourself, you had to do SSR and routing yourself, you had to decide between flow and typescript, you had to learn flux and immutable.js, and you had to choose 1 of 100 boilerplates