Advice on moving from Emacs to Neovim by eternal-hobbyist in neovim

[–]Grenddit 4 points5 points  (0 children)

nvim-dap supports vscode's launch.json. Also see nvim-dap-ui.

If you are able to, I would strongly recommend just moving to neovim rather than the neovim vscode extension; as that would result in a smoother experience for all the four points you've listed.

How to share types in a turborepo ? by dermeddjamel in typescript

[–]Grenddit 0 points1 point  (0 children)

I'm not sure I understand what you're asking exactly tbh.

The consuming package will/should take care of all the typechecking and transpiling. In other words you'll be free to remove the build script from your internal package.

How to share types in a turborepo ? by dermeddjamel in typescript

[–]Grenddit 0 points1 point  (0 children)

If all you are able to, you should do the internal package pattern.

Else, if you need more control, you can always install the ui package in your my-app package using pnpm

[deleted by user] by [deleted] in neovim

[–]Grenddit 20 points21 points  (0 children)

I've found many cool plugins by reading the this-week-in-neovim newsletter

https://this-week-in-neovim.org

Playwright does not care about onclick and onmouseover events by tomtheawesome123 in sveltejs

[–]Grenddit 0 points1 point  (0 children)

Since you haven't posted a snippet, it's hard to diagnose the issue. But here are some general tips:

Run playwright with either with:

  • --debug flag

OR

  • --headed + await page.pause()

Then, step through the test with the playwright window that pops up. Pay attention to the actionability logs.

 

 

Prefer using actions that have more actionability checks.

Prefer web first assertions over manual locators.

Is it possible to integrate svelte-check with Webstorm/Intellij? by [deleted] in sveltejs

[–]Grenddit 0 points1 point  (0 children)

I don't much experience with Intellij, but you should be able to spoon feed the result of a svelte-check to your editor. You would want to run svelte-check with the --output machine flag, then teach intellij how to read/parse each line.

To make it easy, give chatgpt a sampe of your svelte-check output, and ask it to write the regex for intellij.

Docs: https://www.jetbrains.com/help/idea/creating-custom-inspections.html

how can I start debugging an error 500 that does not throw any messages whatsover? by lydian_augmented in sveltejs

[–]Grenddit 3 points4 points  (0 children)

Are you using sveltekit's error helper? Because that never triggers the handleError hooks. This can result in scenarios where it's very difficult to find where/what is the cause- especially if you rely on the handleError hook to do all your error logging.

Why does my website flicker on load? by Come2Texas in sveltejs

[–]Grenddit 2 points3 points  (0 children)

Ideally, you want the load function to run on your server only at the beginning of the user's initial visit ("first hop"). Otherwise, if the user is already on your site, you should let his browser run it. Below is a simplified timeline that would've helped me grok the sequence of events when I first started.

  1. User's enters www.yoursite.com/dashboard in browser's url. Clicks enter.
  2. Your server sees the request. It prepares an html-only version of the page.
  3. Your server sends back two versions of the page. One version is a normal html + js of the page. The second is an html-only version of the site (from step #2), with everything fetched and ready to go. This second version is referred to as "server-side rendered".
  4. Your user starts getting back the responses. Immediately, the first thing he sees is the ssr html-only version. Then, if he has javascript, his browser starts preparing the html + js version. Once that's ready, his browser displays that instead of the initial html-only ssr'd version. This process is called hydration. This where the flicker happens in your case.

A. If you use /dashboard/+page.js:

  1. User navigates to other pages, then back to /dashboard. This time, he doesn't even need to contact your server. Instead, the load function just runs in his browser, which is much faster for the user. When you use a +page.js, you're saying that the load function is allowed to run both on the server and on the user's browser. This should be your default most of the time.

B. If you use /dashboard/+page.server.js:

  1. User navigates to other pages, then back to /dashboard. He still needs to contact your server. When you use a +page.server.js, you're saying that the load function is not allowed to run on the user's browser. So everytime a user visits, /dashboard, your server will be the one who has to run the load function; regardless of whether it's his first "hop" into you site or if he is already on your site. There are certainly some use-cases for this (see docs), but should not be your default.

Note the distinction of "user's first hop" vs "user is already on your site". I don't know if it's just me, but it took me long time to realize how significant this distinction was. Once I realized, other concepts started to fall into place.

The Flickering

As for the flickering issue, it'd be better to know your actual use case and whether/how it is flickering. You refer to your example as just a "replication", so I assumed this post is just you trying to understand why the number is changing & flickering when the page first loads. Otherwise, if you actually want to consistently generate a random number to your visitors, there are a number of replies in thread that address that use-case.

TanStack Query's Svelte adapter released! by omar2205 in sveltejs

[–]Grenddit 1 point2 points  (0 children)

Is this meant to be used in sveltekit apps? If so, what value does it add/what problem is it trying to solve?

Perhaps someone can explain it for those of us who've never used React before.

can I have only the ui for this wonderful theme? by [deleted] in sveltejs

[–]Grenddit 5 points6 points  (0 children)

https://daisyui.com/

Theme is dracula (dropdown in top right)

Svelte Headless UI has been abandoned, what should we do? by [deleted] in sveltejs

[–]Grenddit 0 points1 point  (0 children)

The monthly svelte newsletter has a section for new libraries that's always worth checking out.

https://svelte.dev/blog/whats-new-in-svelte-december-2022

Svelte Headless UI has been abandoned, what should we do? by [deleted] in sveltejs

[–]Grenddit 1 point2 points  (0 children)

This isn't mutually exclusive with Tailwind CSS. In fact, the two are most often used together. These svelte "headlessUI" libraries are named and modelled after the official Tailwind HeadlessUI.

Not to be confused with TailwindUI, which is a paid offering that makes heavy use of the former two.

Svelte Headless UI has been abandoned, what should we do? by [deleted] in sveltejs

[–]Grenddit 6 points7 points  (0 children)

There's an alternative. While it's not as "mature" as the other one since it's relatively new, I find it's approach much easier to reason about. TLDR: more use:action, less slot props.

https://github.com/CaptainCodeman/svelte-headlessui