Size: a a a

2020 November 06

ER

Eric Rovell in Svelte [svelt]
Alexander Ponomarev
равенства при сортировке не бывает да? =)
Проглядел 😅
источник

ER

Eric Rovell in Svelte [svelt]
Alexander Ponomarev
равенства при сортировке не бывает да? =)
Стоит тогда поставить нестрогое?
источник

AP

Alexander Ponomarev in Svelte [svelt]
Eric Rovell
Стоит тогда поставить нестрогое?
Это будет тоже самое что строгое но в другую сторону. Я просто отдельно обрабатываю равенство и возвращаю ноль обычно.
источник

ER

Eric Rovell in Svelte [svelt]
Alexander Ponomarev
Это будет тоже самое что строгое но в другую сторону. Я просто отдельно обрабатываю равенство и возвращаю ноль обычно.
Спасибо, буду знать
источник

AP

Alexander Ponomarev in Svelte [svelt]
Зависит от того нужна ли стабильность сортировки, по идее сейчас вроде бы все браузеры делают стабильную сортировку.
источник

IS

Ivan ShRt in Svelte [svelt]
Hey guys, a little cry of a desperation and call for help for you all :)
So, after many weeks of developing my first webapp with Sapper I'm ready to host it and to go live. It took me a few hours to deploy it on my first ever DO droplet (generally speaking everything is my first time/experience in this case). So, I have this audio player for listening music and I thought that for now I could keep all my audio files in "static" folder and later as the number of files grows I would just move them to my backend and serve them from there. What I didn't anticipate that Service Worker is loading all the static files at once, for caching and offline usage. I didn't notice this when developing from localhost (serving local files ofc is super fast) but once I went online, omg, every new user would have to wait until 80+ audio files are loaded in the browser and cached.
1. What are my options here? As I want to launch asap, can I disable this somehow or the only way is actually to move all those files to backend and serve them from there?

Another question, a bit offtopic and silly (first time going live, remember) is it okay to have  a such structer for the API and frontend app - https://domain.com/api/blabla
or there is actually a way to set up Nginx so my Sapper app connects  to API on localhost without publicly opening it?
In first case how this works for crawling engines and SEO, do I have to simply close the API url in my robots.txt?
Thanks everyone! :)
источник

M

Marat in Svelte [svelt]
Использую smelt, почему-то при чистой установке при клике на Select/TextInput появляется черный бордюр. Подскажите, пожалуйста, почему так может происходить и как это отловить?
источник

VF

Vitaliy Fain in Svelte [svelt]
Alexander Ponomarev
равенства при сортировке не бывает да? =)
я его убрал так как в моем случае данные не совпадают
источник

IF

Igor Filippov in Svelte [svelt]
Marat
Использую smelt, почему-то при чистой установке при клике на Select/TextInput появляется черный бордюр. Подскажите, пожалуйста, почему так может происходить и как это отловить?
Ну это :active наверное
источник

VF

Vitaliy Fain in Svelte [svelt]
ну в любом случае это на стороне css
источник

VF

Vitaliy Fain in Svelte [svelt]
потыркать в дебагере поставить галочки
источник

M

Marat in Svelte [svelt]
Igor Filippov
Ну это :active наверное
это :focus, пойду дальше искать
источник

AS

Aleksandr Shirochkin in Svelte [svelt]
подскажите, у меня есть компонент (в DOM это input), как правильно вызвать его focus в onMount ?
источник

МТ

Марк Танащук... in Svelte [svelt]
Aleksandr Shirochkin
подскажите, у меня есть компонент (в DOM это input), как правильно вызвать его focus в onMount ?
<script>
 import { onMount } from "svelte";
 let myInput;
 onMount(() => {
   myInput.focus()
 })
</script>

<input bind:this={myInput} />


Я бы сделал это через экшн:

<script>
 const focus = node => node.focus();
</script>

<input use:focus />
источник

МТ

Марк Танащук... in Svelte [svelt]
Ivan ShRt
Hey guys, a little cry of a desperation and call for help for you all :)
So, after many weeks of developing my first webapp with Sapper I'm ready to host it and to go live. It took me a few hours to deploy it on my first ever DO droplet (generally speaking everything is my first time/experience in this case). So, I have this audio player for listening music and I thought that for now I could keep all my audio files in "static" folder and later as the number of files grows I would just move them to my backend and serve them from there. What I didn't anticipate that Service Worker is loading all the static files at once, for caching and offline usage. I didn't notice this when developing from localhost (serving local files ofc is super fast) but once I went online, omg, every new user would have to wait until 80+ audio files are loaded in the browser and cached.
1. What are my options here? As I want to launch asap, can I disable this somehow or the only way is actually to move all those files to backend and serve them from there?

Another question, a bit offtopic and silly (first time going live, remember) is it okay to have  a such structer for the API and frontend app - https://domain.com/api/blabla
or there is actually a way to set up Nginx so my Sapper app connects  to API on localhost without publicly opening it?
In first case how this works for crawling engines and SEO, do I have to simply close the API url in my robots.txt?
Thanks everyone! :)
Ask this question in Sapper Community: @sapperjs
источник

ВГ

Вячеслав Гримальский... in Svelte [svelt]
Dan Kozlov
Все так. Хранение всего кросс-компонентного и глобального стейта — это сторы и только они.
И правда очень удобно. Создал common.ts, туда всяких сторов и общих функций накидал, и оно магически связывается. Прямо красота)
источник

AS

Aleksandr Shirochkin in Svelte [svelt]
спасибо, через экшен красивое решение
источник

IS

Ivan ShRt in Svelte [svelt]
Марк Танащук
Ask this question in Sapper Community: @sapperjs
Hey, thanks for now I found a simple hardcoded solution. But I have different crazy problem at the moment, for some reason {#each} loop renders my elements twice in a row, lol
источник

МТ

Марк Танащук... in Svelte [svelt]
Ivan ShRt
Hey, thanks for now I found a simple hardcoded solution. But I have different crazy problem at the moment, for some reason {#each} loop renders my elements twice in a row, lol
If you provide a code sample (ideally REPL) then we can provide a solution
источник

IS

Ivan ShRt in Svelte [svelt]
Марк Танащук
If you provide a code sample (ideally REPL) then we can provide a solution
Thanks, I will play around it and see what I can hack together and then post to Sapper community you mentioned :)
источник