Chat Logs

  1. * phaleth joined #primate
  2. phaleth2 ms response time https://images4.imagebam.com/b1/b5/16/ME1BAQWY_o.png used to range from 6-20 ms couple weeks ago
  3. * phaleth joined #primate
  4. * jreicher joined #primate
  5. bluephaleth: hi, did it go done since you reverted to node?
  6. bluego down*
  7. * nevet joined #primate
  8. * blue!~blue@user/blue changed the topic to: https://primate.run | this channel is mirrored to the Primate discord, channel #irc
  9. * phaleth joined #primate
  10. phalethblue: nope, the website didn't go down
  11. * phaleth joined #primate
  12. bluephaleth: no, I mean the response time
  13. bluephaleth: https://github.com/rcompat/rcompat/commit/f0499af05fe0148a0cd150e36073143f7b81fd7f
  14. nevetenv: remove deps, streamline · rcompat/rcompat@f0499af
  15. blue@primate/env (future std:env) 0.15 is out
  16. bluesorry, @rcompat/env, I mean
  17. bluethe new version is necessary for this https://github.com/primate-run/primate/issues/251
  18. nevetProposal: Add `AppFacade#env(key: string)` · Issue #251 · primate-run/primate
  19. phalethyeah, bun was less responsive than node
  20. bluepema schemas btw are generally closed, this will require having the ability to specify an open pema schema, because process.env will otherwise always kill it
  21. phalethpema reminds me I should go drink my lemonade
  22. phalethAppFacade sounds very strange
  23. blueoh nvm, pema schemas are open, I should change that
  24. blueit's not stranger than a RequestFacade :P
  25. bluehm, well, 'open' is a weird way to put. it does ignore unknown values, but doesn't through on them
  26. bluethrow*
  27. bluewell the idea of a Facade is that you don't expose everything
  28. blueso a primate RequestFacade doesn't give everything that a WHATWG Request has. it has a few things extra, and hides some ugly impl details
  29. bluean AppFacade is the same. you don't want/need the entire App object
  30. blueit's jst an abstraction. but calling it just Request or App is confusing. especially in the case of Request where the type is already held by WHATWG Request and we'd be shadowing and confusing people
  31. phalethwhy would there be an App type in rcompat?
  32. blueit's a primate proposal
  33. blue13:39 < blue> the new version is necessary for this https://github.com/primate-run/primate/issues/251
  34. nevetProposal: Add `AppFacade#env(key: string)` · Issue #251 · primate-run/primate
  35. phaleththen call it server?
  36. blueit's not a server, you can't stop. it's really app info
  37. bluestop it*
  38. blueit's a very limited facade atm, anyway
  39. phalethwhat about Config then?
  40. bluehttps://github.com/primate-run/primate/blob/master/packages/core/src/private/app/Facade.ts
  41. blueso it has: config(path: string), which gives you access to the config using a path
  42. blueview(name: string), which gives you programmatic access to a compiled view file
  43. blueand get root
  44. bluehttps://github.com/primate-run/primate/blob/master/apps/website/routes/docs/%5B...page%5D.ts
  45. blueyou see how view() is used there?
  46. blueconst { html, toc, md } = app.view<Component>(`docs/docs/${$page}.md`);
  47. blueI need to embed the markdown file's data within the svelte component
  48. blueand I need to do it dynamically, based on the path
  49. phalethso it's some sort of a root class
  50. blueyeah. and in 0.37 it will get a useful env object
  51. blueso you'll be able to do app.env.STRIPE_SECRET and you get automatic typing, as a string
  52. blueor app.env.PORT and it comes as a number
  53. bluethis will be based on the schema you provide in app/config.ts
  54. phalethok, then I guess env should be a thing of it's own as not in all cases the whole env should be queried at the root of the app
  55. bluethe schema will do a runtime check so the app won't start with a STRIPE_SECRET
  56. phalethI mean some frameworks do that, but it can bring in bloat
  57. blueI actually debloated this, in @rcompat/env 0.14 I used dotenv
  58. bluein 0.15 I just wrote a parse myself, it's like 20 lines
  59. blueparser*
  60. bluethere's not a lot of bloat going on here
  61. bluethe two key advantages to this proposal is: hard failure when you didn't configure a required env key, and strong typing for those keys, if you need it
  62. phalethby bloat I mean a lot of env vars that can be in the current shell or whatever
  63. blueI think the former is important, becaus you could get silent weird failures when some env vars aren't configured. the latter one is aesthetics
  64. blueyes but these get loaded anyway by node into process.env
  65. blueyou can't really avoid that
  66. phalethok, well, if process.env just works, then I'd not bother with any of that
  67. blueit does but you have .env files + as I said, runtime validation
  68. blueapp#env just gives you a nice centralised way to access those env vars in a controlled way, otherwise env vars are too loose
  69. blueof course as a user you can completely ignore it and go with process.env
  70. bluebut I don't see a lot of advantage
  71. blueso one of the things that annoyed me the most deploying nevet (looking at you, dreamreal) is that I had no idea what's up with the env vars. some of them weren't documented. and this stupid framework just starts up without checking if the envs are set, that's terrible
  72. dreamrealWhich ones aren't documented? The user docs and deployment docs should cover every one of them. If there's one that isn't described, it should DEFINITELY be filed as a bug, because that's the author screwing up
  73. phalethyeah, but it's dev's responsibility to warn or error when some input is missing
  74. phalethand I think that obscure error was because of some jdbc whatever thingy
  75. dreamrealand blue: when you have content for primate.run, let me know - I want to write it up on bytecode.news (the site's coming together)
  76. phalethwhich is a library itself and if the library is bad well then everything with that library is bad
  77. dreamrealwhat?
  78. phaleththat was meant for blue, and I agree that there should be as much compile time checking as possible
  79. phalethbut env vars are used for all sorts of crap, not just configs
  80. dreamrealone of the things I'm gonna have to figure out for nevet is how to provide access to more LLMs: right now it's anthropic and that's it, you can't "configure openai and not anthropic" and get openai, and you can't combine them
  81. bluephaleth: the BEST way is self-documenting code. nothing beats: `host: p.string.url({ protocol: "jdbc" })`
  82. bluethis is the angle provided by AppFacade#env
  83. blueI'm so tired of writing @rcompat/*, I wanna finish up flog so I can start using std:
  84. bluetbht, I have no idea how I'd keep primate compatible with node/deno/bun then :(
  85. bluefor node you can rewrite imports, but it's black voodoo magic and doesn't work deno/bun
  86. bluewould be cool if the runtimes supported rewrite rules in package.json
  87. bluebut I can also see how that leads to absolute catastrophes
  88. blue@rcompat/* will always stay aligned with std:*, so if I could rewrite std: onto @rcompat/* for non-flog runtimes, that'd be supreme. unfortunately I'm not sure that's possible
  89. phalethif somebody uses primate to develop their apps then they will use whatever feature the runtime offers and if clanker tells the use this shiny bun feature, they will use that bun specific feature and think it's very convenient, clueless about rcompat being already there
  90. blueya, but that's not the point. I'd like to use std: *myself* in primate code
  91. blueand I can't do that as-is since it wouldn't run on any runtime
  92. bluefor that, the runtime needs to know what "std:" is. and no runtime supports that atm
  93. phaleththat's the burden of being a library author
  94. bluefor node, you can register loads so I could simply map "std:*" to "@rcompat/*
  95. blueloaders*
  96. bluewhy is the js landscape such unregulated dumpster fire
  97. bluehaving a sane std is like the absolute basics in every language out there
  98. phalethlet me bring you some news
  99. blueexcept, uh, js
  100. phalethhah, this looks very retarted https://dev.to/gabrielenache/vite-8-is-here-and-it-changes-everything-about-frontend-builds-45ci
  101. blueyes, that's totally dumb
  102. phalethvite brought it's rust tools to the stable version couple days ago, replaced esbuild and rollup with rolldown
  103. bluerolldown achieves nothing over esbuild
  104. bluehaha
  105. phaleth"The JavaScript ecosystem has been plagued by fragmented tooling for years. Vite 8 is a serious step toward ending that era."
  106. phaleththat totally sums up the bullshit post
  107. bluevite is a dumpster fire I would never touch for the life of me
  108. blueall you really, ever, need, dot, end of sentence, is esbuild
  109. phalethyeah, webpack is better
  110. bluebtw I'm pretty sure this post was clankered
  111. blueit sounds like chatgpt wrote it
  112. phalethyup
  113. blueI keep getting too many requests on gh
  114. bluethe site is literally unusable
  115. * phaleth joined #primate
  116. * nevet joined #primate
  117. * blue!~blue@user/blue changed the topic to: https://primate.run | this channel is mirrored to the Primate discord, channel #irc