Skip Navigation
InitialsDiceBearhttps://github.com/dicebear/dicebearhttps://creativecommons.org/publicdomain/zero/1.0/„Initials” (https://github.com/dicebear/dicebear) by „DiceBear”, licensed under „CC0 1.0” (https://creativecommons.org/publicdomain/zero/1.0/)BR
Posts
0
Comments
207
Joined
2 yr. ago
  • my team was driving me insane with leaving console.log("here") all over the place in every pr, so now we have a "no console.log" eslint rule in ci.

    I guess my answer is it depends on your team. good logs are different, but imo if they're just debugging statements they shouldn't even make it into the repo let alone prod.

    if it's just you, do whatever you want lol, performance is almost certainly not significant and most users should end up ignoring them anyway

  • well the language server plugins all run a binary language server out of sandbox so zed doesn't really do anything safer in particular there either. no ide has solutions, solutions don't really exist right now. it's not a problem of features of the language as much as it is features developers expect in extensions. I suppose there is a hypothetical "the extension wants to make this change to this file, approve" type flow like AI tools have now, but that sounds unpleasant to use. it still doesn't get around things like language servers being designed to run as standalone processes out of sandbox.

    by audits I meant you individually go and read all the code of all the extensions you use. of course that's impossible too, but that was my point

  • I can't imagine a sandbox would help. what can an an extension do that doesn't touch some arbitrary code that gets run? it could add a line to the middle of a giant file right before you run and remove it immediately after. even if you run the whole editor in a sandbox you do eventually deploy that code somewhere, it can change something inconspicuous like a url in a dependency file that might not get caught in a pr

    the only solution is to audit everything you install, know all the code you run, etc. ofc that's not reasonable, but idk what else there is. better automated virus check things maybe? identity verification for extension publishers? idk if there's an actual solution

  • not sure what you're talking about but there's two things here.

    TRAMP is great and you can run the lsp on the remote machine without installing anything assuming the linters and lsp are already installed. for comparison, vscode remote downloads and runs a shim thing when you connect.

    I use doom emacs at work for large codebases all the time and haven't run into any problems. why does it only work for really small projects?

  • plenty of package managers have.

    flatpak doesn't require any admin to install a new app

    nixos doesn't run any code at all on your machine for just adding a package assuming it's already been cached. if it hasn't been cached it's run in a sandbox. the cases other package managers use post install configuration scripts for are a different mechanism which possibly has root access depending on what it is.

  • yeah there isn't really a general purpose react way to do that.

    if order didn't matter then you could just have a Header component that registers itself in a context but there's no way to know where each component is relative to its siblings.

    the other way is to break out of react and just walk the dom. pass a ref to your component and use that as the root to walk. only works assuming normal react dom renderer and no portals.

    you can combine those two options too, use context for registration so you can attach extra info, then dom for position.

    there are some libs that let you walk a component tree, but they're all focused on ssr and idk how they work in a browser. wouldn't go this route for anything prod.

    last option is just store your content as data. have md/mdx/json/whatever files that are the content for your page, then as you parse them build up the tree. probably the most robust if it fits your use case. if you use MDX it seems like they already have some solutions

  • most things seem to have settled on this, but tabs are so much better for accessibility. programmers with bad vision can have trouble differentiating smaller indentation levels, while some of them just bump the font size up so high that 4 spaces takes up too much screen space. each one can set a tab width that is comfortable for them. https://alexandersandberg.com/articles/default-to-tabs-instead-of-spaces-for-an-accessible-first-environment/ has some good arguments

    with a forced formatter and a configured editor there really isn't any argument for spaces

  • 4 to 5 added like 2 tags, but was fully backwards compatibile. the painful upgrade you're thinking of was 3 to 4 where they basically rewrote, it but don't have any tutorial content other than one of the main devs making an absurdly long series of walkthrough videos so it's impossible to find the topic you're interested in

  • json is fine as a serialization format for things that need to be text, but it's not great as something that gets edited by hand.

    not that I enjoy xml, but writing long strings in json is even worse. xml I can write multiline strings as a first class entity.

    I can add a comment to an xml document, json I have to write something hacky like "//": "my comment" and hope whatever is consuming it doesn't care.

    there's just as many problems with json parsers, since most but not all of them treat numbers as js numbers, which are basically floats. you can't rely on an arbitrary consumer having support to parse ints above a certain size so you just have to make everything a string and hope.

    json allows duplicate keys, but they get overridden by the last occurrence. you can't round trip json without losing something. you can't rely on just seeing a key value in json text and that being correct since there could be another later. doesn't come up often but it's there.