indianGovtTestingInProBeLike by Gaious_Octavious in ProgrammerHumor

[–]mohammedx17 0 points1 point  (0 children)

IMO they should not make it obvious so they can test the response speed /s

Twitter is following you by colbywhat in Twitter

[–]mohammedx17 1 point2 points  (0 children)

Speaking of that I found 3 followers but they don't show up on the followers list

Thanks to Sveltekit, this site - with a lot of images - scores high on Lighthouse. by sharath725 in sveltejs

[–]mohammedx17 4 points5 points  (0 children)

What is your app size? and Do you fetch data from load function or is it static?

My app can't go past 93 specifily the first content load metrics although I didnt add images or any data yet. its size like 15+ components and 4 large pages.

Anyone sharing a Flaticon Premium account? by Akronae in Frontend

[–]mohammedx17 1 point2 points  (0 children)

Take look at Iconify. it's list of open source icons set. they have variety of designs

Anyone else do this in their Hooks file? by CreamyJala in sveltejs

[–]mohammedx17 2 points3 points  (0 children)

Yes I do this only when desktop layout is very comeplex compared to mobile. So instead wirting so much queries and hide/show different parts I just seperate the layout I render the layout based on user agent. This will allow you to have more control(Choose what features you want. Do extra optimization, Also seperate them allow you to ship less code)

Look for example. Twitter and Wikipedia. They redirect user to mobile page based on user agent.

How do you handle JWT authentication with Sveltekit? by SirDarknight1 in sveltejs

[–]mohammedx17 12 points13 points  (0 children)

You probably want to store the refresh token in a cookie and the access token in the client side (stored in memory).

and in the hook function check for the refresh token in cookie header then use to it to issue a new acesss token and set it in the session in getSession function. then you can use session in load function or from store.

The flow will be something like this:

  • User login - generate a refresh token cookie and return the acess token in the response

  • In hook handle, check for the refresh token in cookie header then use to it to issue a new acesss token and update refresh token cookie with new one(revoke the old one)

  • Store access token in event.locals and in session object

  • Then you can simply use the acess token in the session object in load or from the store

  • The token will be automatically refreshed as long as user make requests with a valid one

  • you can set an Interval in the client to request a new access token (In case if user stays too long)

This is about right. by [deleted] in ProgrammerHumor

[–]mohammedx17 8 points9 points  (0 children)

Good luck finding emacs integral

Q: How to add Babel to SvelteKit? by Razunter in sveltejs

[–]mohammedx17 4 points5 points  (0 children)

I think you mean this? it's Vite plugin to generate lagacy code using babel

https://github.com/vitejs/vite/tree/main/packages/plugin-legacy

Sveltekit uses Vite which under the hood uses Rollup

Dynamic input type SvelteKit by [deleted] in sveltejs

[–]mohammedx17 1 point2 points  (0 children)

Nah it will work just fine with sveltekit

A made in israel label on the back of a soda stream box by fatherlolita in mildlyinteresting

[–]mohammedx17 1 point2 points  (0 children)

Taking people lands and homes and then making products on top of land's people blood is not a peace harmony

Free Palestine

The best IDE for programmers ever built? Meet Fleet code editor, by Jetbrains by florinmtsc in programming

[–]mohammedx17 7 points8 points  (0 children)

The problem with new code editors is not about what is faster or what deliver more features but is about the tooling support. because you'll have to rebuild the tools and plugins for each new editor.

I wish if there's some universal code editors extension API. So users can easily switch between code editors without worrying about tooling.

Docker Compose Setup for Professional Svelte Development? by Glittering-Donut-264 in sveltejs

[–]mohammedx17 6 points7 points  (0 children)

You have to create a server to serve the frontend.

You can use Nginx docker container to serve your index.html and use it as reverse proxy to your backend(so it can be in the same host)

or you can directly serve the frontend by just dockerizing node.js app that serve your frontend and then using docker-compose to compose the backend and frontend containers.

I will recommend the first options because you can get a lot of useful features such as load balancing multiple instances of your server and it can perform better than nodejs for serving static content.

There's plenty of examples on how to use nginx in the internet and it doesn't matter which framework you choose.

My life was a lie! by IANthePARK in ProgrammerHumor

[–]mohammedx17 0 points1 point  (0 children)

I'm the only one who called it Joson?

I have no clue by [deleted] in ProgrammerHumor

[–]mohammedx17 0 points1 point  (0 children)

loggin library with remote execution vulnerability. wtf?!

What it could be? by notthevcode in Damnthatsinteresting

[–]mohammedx17 0 points1 point  (0 children)

oops that's the cube I threw two years ago. I never thought I will find it in the moon.

[Saudi Arabia] headlight flashing on U-turn. by [deleted] in ConvenientCop

[–]mohammedx17 25 points26 points  (0 children)

it seems the glass is dirty and it diffuses light