DEV Community

Discussion on: Vue 3 is Coming!

Collapse
 
mburszley profile image
Maximilian Burszley

So filters are gone with v3? Is that a breaking change?

Collapse
 
sidecut profile image
Jim R

The pipe syntax is just a way of composing functions. That syntax has gone away in favor of the familiar way of composing functions.

So x | y | z can be rewritten as z(y(x)).

That being said, I think there's a strong argument to be made for keeping the filter pipe syntax. It's used in unix, a lot of functional languages, Vue2, other JS frameworks, etc. It's a terrific idea.

Collapse
 
mburszley profile image
Maximilian Burszley

I know it's purpose. I don't know what they gain by removing it. It's also quite popular in jinja2

Collapse
 
zearin profile image
Zearin

Well, they are going with a new major version in Vue 3—so, breaking changes are to be expected.

Collapse
 
mburszley profile image
Maximilian Burszley

Expected, but not mandatory. SemVer also reserves bumping major versions for a sweeping feature introduction (like functional components).

Collapse
 
gautemeekolsen profile image
Gaute Meek Olsen

Yes, it is. The main reason is that JavaScript has this ESNext Proposal: The Pipeline Operator. This may or may not happen, but if JavaScript introduces this, it would break Vue I think. So they are thinking ahead and keeping what's inside the brackets to only be valid JavaScript.

Collapse
 
mburszley profile image
Maximilian Burszley

Interesting; thanks for that link. Is the proposal gaining traction? I've never heard of it before this.

Thread Thread
 
gautemeekolsen profile image
Gaute Meek Olsen

I'm not quite sure actually, first time hearing about it myself :)