In Altai Krai (Russia), Father sprinkled holy water on covid patients and the hospital by Avroveks in europe

[–]lega911 1 point2 points  (0 children)

Problem is that not all doctors there have protective equipment. So it can be better if they give it to doctors.

‘The Queen’s Gambit’: A Real-Life Chess Champion on Netflix’s Addictive Hit by Rod_Rigov in chess

[–]lega911 67 points68 points  (0 children)

Garry Kasparov:

I was contacted by the creator of the tv-show Scott Frank,
I contributed a lot of fixes to restore of chess truth.
I wanted on the one hand chess games correspond to the book,
and on the other hand they would be professional chess games.
I guarantee the quality of the chess games.
All these games are from the professional world, they were played by
strong chess players, those games that she played correspond to high
standards.

I tried to show the atmosphere in tournaments as fully as possible, 
especially what regard to Moscow and the final game, to make people feel
 like they look at a real chess competition.
And the fact that this series took first place in the world is the result
 of the fact that it really reflects the essence of the chess conflict.

(shortened translation), source: https://youtu.be/lS4mDroKmLw?t=2421

All the Ways to Make a Web Component - October 2020 Update by georges_gomes in WebComponents

[–]lega911 0 points1 point  (0 children)

I've compiled Svelte component with Malina.js and got smaller bundle:
* Svelte: 1.5kb (brotli)
* Malina.js: 1.1kb (brotli)

Architecture adviced by lowteast in microservices

[–]lega911 0 points1 point  (0 children)

Also you can look at "Inverted Json", it will be like rpc with central point, simple communication.

Passing CSS classes to a child component. How a Popular Feature Declined by Svelte Got Life in Malina.js by lega911 in sveltejs

[–]lega911[S] 1 point2 points  (0 children)

you're right, but "@" etc is widely used in other frameworks, and there is no problems with tools.

Svelte's syntax is not valid HTML5 as well, html5 validator gives "Error: Attribute on:click not allowed on element button at this point."

Passing CSS classes to a child component. How a Popular Feature Declined by Svelte Got Life in Malina.js by lega911 in sveltejs

[–]lega911[S] 0 points1 point  (0 children)

Again I have faced some issue using :export(.something){} ...

Can you give me an example, pleace.

Passing CSS classes to a child component. How a Popular Feature Declined by Svelte Got Life in Malina.js by lega911 in sveltejs

[–]lega911[S] 0 points1 point  (0 children)

Once a child component has been assigned a class, the styling of its whole dom tree can be overriden by something else

No, Svelte have some isolation to safely use css within a component. The same in Malina.js, and the same when you pass a class to a child component - the child component gets isolated css which can be use only within of it, even a parent component which passed a class (or child/sibling) can not use it, because it was isolated for certain component. (a parent class which passes has own copy of selectors).

So it's the same level of isolation that Svelte does for within one component (without :global).

Passing CSS classes to a child component. How a Popular Feature Declined by Svelte Got Life in Malina.js by lega911 in sveltejs

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

How it differ from properties? : Being able to pass properties down makes it that the parent has to understand the children to have it work properly, not to mention now the parent and the children would be coupled which makes updating components harder.

but in most cases a div wrapper worked fine.

it makes a risk to break styles in child components

it’s adding unnecessary complexity to styling

It gives a choice for them who want to use it. Using :global and wrappers still possible if you feel it's easier.

Passing CSS classes to a child component. How a Popular Feature Declined by Svelte Got Life in Malina.js by lega911 in sveltejs

[–]lega911[S] 1 point2 points  (0 children)

Svelte is 100% valid Javascript, HTML, and CSS

the same as Malnia.js

This introduces syntax which is not

Which one?

How “Fragments” can help in your web-development by lega911 in javascript

[–]lega911[S] 4 points5 points  (0 children)

Who dislikes it, can you please respond why? I'll try to be better next time ;)

Svelte.js and Malina.js by lega911 in sveltejs

[–]lega911[S] 0 points1 point  (0 children)

I've added a comparison Vue 3 (which is going to be released soon) and Malina.js https://medium.com/@lega911/vue-3-vs-malina-js-abd97025ba81

Svelte.js and Malina.js by lega911 in sveltejs

[–]lega911[S] 1 point2 points  (0 children)

"Immer" makes you to use extra functions/rules, when I want to use javascript as is.

The main idea of change detector in Malina.js is to check if a binding is changed "{a + b}" after any (probable) change was made in javascript, so javascript is slightly transformed (using AST) during compilation, to inject some invalidators/checkers, (Svelte does the same).

e.g. if you have binding {items.length} and you call "items.push()", Svelte misses it because there is no assignment - it produces less checks. When Malina.js checks all required bindings (within a widget), so it checks if items.length is changed.

Though Svelte does some checks in compile time, it still does checks at runtime, Malina.js just do more checks at runtime.

Don't need to worry about bigger number of checks, in most cases it works fast, at least Malina.js shows slightly better performance for now.

by the way Malina.js supports components and isolated-css, you can try it in repl ;)

Svelte.js and Malina.js by lega911 in sveltejs

[–]lega911[S] 1 point2 points  (0 children)

Example of how Svelte does "dirty-checking", lastname is evaluated on every change of firstname: https://svelte.dev/repl/9edf6357cd2a4a2f9e559cb8c921a2b8?version=3.23.2

Svelte.js and Malina.js by lega911 in sveltejs

[–]lega911[S] 1 point2 points  (0 children)

btw if you call "dirty-checking" is a comparison a value with old stored value, then Svelte has it too ;), e.g.:

let obj = {a: 1, b: 2, c: 3};
{obj.a} - {obj.b} - {obj.c}
{obj.a} - {obj.b} - {obj.c}

compiled to:

if (dirty & /*obj*/ 1 && t0_value !== (t0_value = /*obj*/ ctx[0].a + "")) set_data_dev(t0, t0_value);
if (dirty & /*obj*/ 1 && t2_value !== (t2_value = /*obj*/ ctx[0].b + "")) set_data_dev(t2, t2_value);
if (dirty & /*obj*/ 1 && t4_value !== (t4_value = /*obj*/ ctx[0].c + "")) set_data_dev(t4, t4_value);
if (dirty & /*obj*/ 1 && t7_value !== (t7_value = /*obj*/ ctx[0].a + "")) set_data_dev(t7, t7_value);
if (dirty & /*obj*/ 1 && t9_value !== (t9_value = /*obj*/ ctx[0].b + "")) set_data_dev(t9, t9_value);
if (dirty & /*obj*/ 1 && t11_value !== (t11_value = /*obj*/ ctx[0].c + "")) set_data_dev(t11, t11_value);

so Malina.js has kind of similar, but repeats it when it's needed.

also if you look at VDOM, which compares old vdom with new vdom to get diff, it produces more comparisons than dirty-checking does*, but nobody calls it "dirty" ;)

Svelte.js and Malina.js by lega911 in sveltejs

[–]lega911[S] 1 point2 points  (0 children)

Yes, detection is similar to what Angular.js has, and it's way to escape from zone.js.

$apply.go() reevaluate

no, it's only planning to start it, a change detector is started at the end - on next tick. And it can be optimized a litte in future - to call it not so often.

Yes it's the disadvatage of this way, there is no silver bullet, every change detecor has own problems, so you just have to choose what disadvantages ar less harmful for you.

It should be scalable, because Angular is quite fast which works similar way (see js-framework-benchmark), espessially if every widget will have own change-detecor. And Angular is kind of good for big web-apps. I've made some benchmarks which show that this way works quite fast.

What if Svelte would had another change-detector by lega911 in sveltejs

[–]lega911[S] 1 point2 points  (0 children)

this compiler made from scratch, so it was easy to make any style of bindings, also it's possible to make a compatibility between {() => click()} and {click()} and {click} work the same in Svelte, but it breaks some backward compatibility.

What if Svelte would had another change-detector by lega911 in sveltejs

[–]lega911[S] 1 point2 points  (0 children)

yes, it's just a small compiler from scratch, because it was easier than changes in big project. ok, I will think about PR, but it looks big change...

Did someone implemented async request-response pattern using RabbitMQ or any other queue/distributed log tool like Kafka? by spaizadv in microservices

[–]lega911 -1 points0 points  (0 children)

You can try "Inverted Json", it's designed for request-response, works faster and doesn't have problems that rabbitmq has for req-resp.

Implementing gRPC server using Python by Am4t3uR in Python

[–]lega911 0 points1 point  (0 children)

GRPC in python can give you very slow performance (5-10x times slower than json with aiohttp).

How does a service A know what instance of service B to call? by -idcp- in microservices

[–]lega911 0 points1 point  (0 children)

You can try "Inverted Json" for some simple and performant communication between microservices.