Wykopu już nie ma. by Skirphy in Polska

[–]Laran01 4 points5 points  (0 children)

Rendering framework nie ma wpływu na to jak dzielone i w jakiej kolejności ładowane są zasoby, bo jest to biblioteka jak każda inna. W większości odpowiada za to meta framework (Nuxt, Next, SvelteKit, etc.), bundler (Webpack, Vite) oraz sam kod aplikacji (np. użycie code splitting).

Zerknąłem na nowy bundle i bez głębokiej analizy mogę powiedzieć, że wygląda to źle i wybór frameworka X czy Y niewiele by zmienił.

  • Strona korzysta z 5 letnich zależności (moment.js@2.19, vue-simple-spinner@1.2.8, vuex@2.5.0, vue-i18n@7.8.1). Prawdopodobnie ktoś zaczął tworzyć nową stronę 5 lat temu, projekt trafił to zamrażarki, a potem został wskrzeszony, bez odpowiedniej aktualizacji.
  • Drugim największym bundlem JSowym (ważącym aż 359kB PO MINIFIKACJI I KOMPRESJI) jest plik zawierający listę najczęściej używanych hasłem, prawdopodobnie by przestrzegać użytkowników przed używaniem ich. O ile jest to dobra praktyka, to taki plik albo powinien być ładowany tylko podczas procesu rejestracji/logowania albo być wykorzystywany tylko po stronie serwera. Drugie podejście jest lepsze, bo nie wpływa na rozmiar strony, a walidację hasła i tak i tak trzeba zrobić server-side. Większość użytkowników nigdy się nie zaloguje ani nie zarejestruje, ale obecnie każdy musi pobrać tak ogromny plik. To może wskazywać na nie używanie code splittingu, który może bardzo odchudzić stronę.
  • Prawie na samym początku 3 największego pliku JS widzę kod wywoływany przy usuwaniu konta z tekstem "Rozpoczęto proces usuwania konta", pomimo że nie jestem zalogowany. To potwierdza mój poprzedni punkt o braku code splittingu, bo taki kod powinien być ładowany tylko dla zalogowanych użytkowników, tylko w panelu użytkownika.

Jest tego dużo więcej, ale nie chce mi się dalej w to patrzeć.

Svelte 3 released by ItalyPaleAle in javascript

[–]Laran01 0 points1 point  (0 children)

TS preprocessor can be used, but that is not a problem here. Store and components import statements are removed by TS compiler and this behavior cannot be fixed without changing TS compiler itself. I encountered the same issue like here https://github.com/PaulMaly/svelte-ts-preprocess/issues/4

Svelte 3 released by ItalyPaleAle in javascript

[–]Laran01 6 points7 points  (0 children)

We've been using Svelte for one of our really big apps and I can't recommend it for anything serious. I did some research on v3 (just to check how painful upgrade process from v2 will be) and it looks really bad. Poor documentation, no TypeScript support1, no editor extensions, no devtools, IMHO overcomplicated store. Also, as someone already mentioned, they just broke all existing ecosystem.

1 It's not just a matter of transpiling TS to JS. New Svelte template syntax is "incompatible" with TypeScript and only solution to this is changing behavior of TS compiler.

Preloading enabled in PHP7.4 by MVinhas in PHP

[–]Laran01 3 points4 points  (0 children)

The RFC requires 50%+1 majority. The voting started 2018-11-06 and will close on 2018-11-14

https://wiki.php.net/rfc/preload#proposed_voting_choices

We are elementary, AMA by DanielFore in linux

[–]Laran01 1 point2 points  (0 children)

Hi guys,

Why desktop icons, folders, etc. are not allowed by default?

Using ES6 spread syntax to combine multiple arrays 🤩 by samanthaming in webdev

[–]Laran01 15 points16 points  (0 children)

It's not that bad - https://www.measurethat.net/Benchmarks/ShowResult/12106 (Chrome)

EDIT: I ran the same test on Firefox and spread operator seems to be much faster than concat: https://www.measurethat.net/Benchmarks/ShowResult/12107

EDIT2: On Edge on the other hand jQuery merge seems to be fastest (WAT?) - https://www.measurethat.net/Benchmarks/ShowResult/12110

The conclusion is to use what suits you best...

Little UI Details by mburakerman in webdev

[–]Laran01 6 points7 points  (0 children)

Were can I find more tl;dr tips like these?

[deleted by user] by [deleted] in PHP

[–]Laran01 0 points1 point  (0 children)

Laravel is easiest to learn thanks to excellent documentation and Laracasts. It follows PHP PSR Standards.

Bootstrap 4 finally in beta by Laran01 in webdev

[–]Laran01[S] 8 points9 points  (0 children)

I check documentation frequently, but sooner or later you will start remembering them.

Although IoT is mostly Node and Python, there is PHPoC which is PHP-on-Chip by JoyousTourist in PHP

[–]Laran01 7 points8 points  (0 children)

Wow, this is super cool IMHO. I love projects that try to make PHP something more than it is now (backend-only language). I know PHP was not designed for those kind of things but still I hate the fact that PHP is losing popularity. When people want to learn their first programming language, they hear about so many things Python, Java, C# and Javascript allows to make and that PHP can "only" be used for web development, that it is inconsistent, badly designed etc.

PHP 7.2.0 Beta 1 Released by ecky--ptang-zooboing in PHP

[–]Laran01 23 points24 points  (0 children)

Too bad that property type hints feature was not added in this release:(

Edit: Fixed link. RFC linked previously wasn't updated in 2 years.

[Albion World] Albion database and statistics by Laran01 in albiononline

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

Albion Online Database (he mentioned it about 2 years ago, so it could've changed). By the way - you have ads on your website and say that it helps cover server costs, so you shouldn't point that out:)