HNHacker News
TopNewBestAskShowJobs

zkldi

1,734 karma · joined March 10, 2021

aspirant
submissionscomments
zkldi··on Vue.js is Wikimedia Foundation's future JavaScript framework
> it's what it appears to be that is apparently the problem.

Yep, Someone mentioned in another part of this thread that Vue compiles most of this out before production, so my remaning confusion pretty much stems from the DSL being a mishmash of html attribute context, vue custom syntax, and evaluated JS.

zkldi··on Vue.js is Wikimedia Foundation's future JavaScript framework
Then that sounds pretty good that it's not ran in production and compiled out!

I guess my remaining alien issue is that the DSL for Vue is a mish-mash of JS, custom syntax, dom attribute context and possibly more?

zkldi··on Vue.js is Wikimedia Foundation's future JavaScript framework
Yes.
zkldi··on Vue.js is Wikimedia Foundation's future JavaScript framework
I don't really see much of a difference - that is still storing it as a text attribute inside a DOM node.

To be clear, I vastly prefer Reacts approach of putting HTML into JS, rather than Vue/Angulars approach of putting JS into HTML.

zkldi··on Vue.js is Wikimedia Foundation's future JavaScript framework
The "scary underscore" expression isn't scary because it's an underscore, it's because it implies the evaluation of JS, such that you could (and obviously wouldn't) do things like

    v-for="x in console.log('hello world!') && fetch('/') && [1,2]"
(my syntax might be off since I don't use Vue, but the merit should still apply)

My point is that when your templating language starts doing things like this (and inevitably, all of them do) - you've created a new programming language that is generally less thought out as one than deliberately made programming languages. Although the above for loop is evaluating JS, the syntax is decidedly not JS.

zkldi··on Vue.js is Wikimedia Foundation's future JavaScript framework
My issue isn't the existance of programmatic expressions (yeah, it's the point of templating languages), but more that the way vue (and angular) do it is a mess of syntaxes that creates a really, really strange template.

The lodash example is the main critique because that is not JS, but it involves evaluating JS - it's created its own programming language with its own rules -- when one was right there from the beginning!

zkldi··on Vue.js is Wikimedia Foundation's future JavaScript framework
> :href="xxx" isn't a string, that is javascript in there.

This is the part I don't really follow, though. Technically:

    <a href="print(1//3)"></a>
href here isn't a string, it's python, but it's stored as a string, representing python. In the :href example for JS, that's not JS - an engine isn't seeing that - that's a string that is evaluated as JS at some point in the vue lifecycle.
zkldi··on Vue.js is Wikimedia Foundation's future JavaScript framework
If it's a template then it's a very complex one, and under closer inspection it reads almost like storing code in a string and evalling it.

Let's say we want to iterate over commits in reverse. A google shows that we can do something like this:

    v-for="item in items | orderBy 'field' -1"
So, there's pipes now, and Vue has essentially re-invented a programming language inside HTML attributes. But then comes this example below it:

    v-for="item in _.reverse(items)"
And this line is terrifying! If this string is able to use lodash, then that means it's able to access the JS global scope, and therefore is very powerful - yet the resulting template is nonsense js, but still at some point involves JS evaluation?

Maybe I'm missing something though - I don't use Vue and if something is this big with this approach, I'm definitely missing something.

EDIT: A search for *new Function(` calls in the vue github repository shows quite a lot of code that essentially evals strings.

zkldi··on Vue.js is Wikimedia Foundation's future JavaScript framework
I feel like I'm in an alien world when it comes to Vue - it has this weird pattern of making strings do loads of heavy lifting.

The Github Commits[1] example on their documentation has a load of stuff that just doesn't sit right with me.

Things like

    v-for="record in commits"
to loop over something is insane to me - this isn't code, this is a string inside a html attribute! How can you get any sort of good type analysis/variable checking/syntax highlighting inside this?

Similarly, accessing properties like

    :href="record.html_url"
has the exact same issues - what if there's a typo here? My IDE can't highlight that this is wrong because it's *not code* and is just a string.

Maybe I'm just the odd one out here, but vue (and angular) love to use strings as a makeshift programming language, which to me is a major smell.

^[1]: https://v3.vuejs.org/examples/commits.html

zkldi··on Yarn 3.0
Sorry for the long delay on replying to this - what packages depend on files being there? I've never had a single issue with pnpm's approach to package management, minus some poor support from github.
zkldi··on New in Git: switch and restore
You can see the original error message in vscode by clicking "output" and navigating to Git in the dropdown.
zkldi··on DaisyUI – Tailwind CSS Components
I really like this approach - I forget CSS has native variables now (maybe it has had it for a while?) and always think of scss's $variables.
zkldi··on Yarn 3.0
I've had a wonderful time with PNPM ever since switching for a couple of projects - installs are near instant, and my hard drive is no longer stuffed with a million installs of the same package in different places.

I always thought it was weird that npm didnt use a central store on your hard drive for your packages and instead just duplicated them everywhere, and i always thought it was even weirder that yarn didn't change this behaviour, but maybe i'm missing something.

zkldi··on DaisyUI – Tailwind CSS Components
But why would you use @apply instead of something like:

    .button {
        background-color: $gray-100;
        border: 1px $gray-200
        /\* so on... \*/
    }
i don't understand how these "micro" css classes actually help versus just setting the property.
zkldi··on No-code startup Bubble raises $100M
> Declarative goal based development. You type in English what you want the application to do,

Isn't that just code?

I'm convinced that for sufficiently complex "no-code" solutions, you just end up with a poor mans programming language.

zkldi··on The Goals of XML at 25: and the one change that XML now needs
I've seen this posted around quite a lot now and it seems quite interesting. Is there a JS/TS implementation of the spec?
zkldi··on Npm Audit: broken by design?
PNPM[1] has became a must-use for me in every node project I work on now.

[1]: https://pnpm.io/

zkldi··on AlpineJS – Lightweight JavaScript Framework
Completely agree.

Whenever html attributes start containing logic is when the templating engine has just implemented its own programming language - poorly.

zkldi··on Steam on Linux around 0.9% marketshare
The latency on cloud gaming makes it unusable for so many games. Especially anything multiplayer.
zkldi··on UK regulator clamps down on Binance
> NFTs will enable new interconnected markets that we haven’t even dreamed of yet.

How? My understanding of it is that it's a JSON document that points to a URL (which is just some webserver 99% of the time).

How does this allow anyone to do anything novel that couldn't be done with a centralised database and an API?

zkldi··on ES2021 Features
These articles always seem to pop up everytime there's a JS language update - and they're all just copy-pasted content from MDN.
zkldi··on You can buy Hacker News upvotes and comments
Whoops, looks like they took it down. There's a reupload here: https://www.youtube.com/watch?v=6SAkUs3urrg.

And it depends on your definition of advertisement, I guess. A new version of $product coming out getting to the front page here is advertisement, but (in theory) organic, from people who are genuinely interested in $product.

If that's taken advantage of (like it is in reddit), then you can manufacture that organic "advertising".

From what other people in the thread are saying, it appears HN mods clamp down hard on this stuff, so it's probably not much of a concern here, but it's still interesting to see.

zkldi··on You can buy Hacker News upvotes and comments
It's probably less of a personal thing and more of a marketing/advertisement campaign thing.

The website itself claims to be organic advertising, and it's certainly something that would work. This is actually used in practice on sides like Reddit[1].

[1] https://www.youtube.com/watch?v=FxNvUWN3vYk

zkldi··on You can buy Hacker News upvotes and comments
Just to be clear: you can do this with basically all social media, but I think it's an interesting discussion to be had that these services exist (and have specific detail, such as the comments[1] or FAQ[2]) one. This isn't a knock against any of the HN staff, but rather about how discussion can be paid for and shaped.

[1] https://web.archive.org/web/20210126003211/https://upvotes.c... [2] https://web.archive.org/web/20210126003211/https://upvotes.c...

EDIT: looks like this hug-of-deathed the site, thats certainly one way to deal with this.

zkldi··on Fastly Outage
It's always DNS...
zkldi··on Fastly Outage
Mediation is a real word though?
zkldi··on PHP in 2021
> Depends on the language really. JavaScript? Yeah, good luck even spinning up a year old project on NodeJS without any breakages. Slightly better situation in the browser but most likely you'll need to change something if you're using NPM.

Is that really true? I can't think of much in terms of older nodeJS stuff that would break on modern node (and with N, you can just install an older version of node).

zkldi··on Deno 1.9
That solution is great! But it sounds like something that could be automated or managed for me.
zkldi··on Deno 1.9
I do! And I think node has a lot of flaws (Ryan seems to agree).

I do not understand why deno has gone for this route. It seems primed to produce a package manager eventually, and it seems like a bad idea to leave package manager creation down to whoever makes the first decent tool (which is mostly why npm is the standard for node.)

zkldi··on Deno 1.9
That's just a package manager!

If something like that is needed, then I think deno should attempt to come with something for managing dependencies.

Eventually, developer convinience will win, and everyone will settle on some sort of package manager for deno. It'd probably be for the best if deno made it official as, personally, I think this is heading towards a second NPM.

← PreviousPage 6 of 7Next →