Submit

Back to the channels

#primate

  1. phaleth 2 ms response time https://images4.imagebam.com/b1/b5/16/ME1BAQWY_o.png used to range from 6-20 ms couple weeks ago
  2. blue phaleth: hi, did it go done since you reverted to node?
  3. blue go down*
  4. phaleth blue: nope, the website didn't go down
  5. blue phaleth: no, I mean the response time
  6. blue phaleth: https://github.com/rcompat/rcompat/commit/f0499af05fe0148a0cd150e36073143f7b81fd7f
  7. nevet env: remove deps, streamline · rcompat/rcompat@f0499af
  8. blue @primate/env (future std:env) 0.15 is out
  9. blue sorry, @rcompat/env, I mean
  10. blue the new version is necessary for this https://github.com/primate-run/primate/issues/251
  11. nevet Proposal: Add `AppFacade#env(key: string)` · Issue #251 · primate-run/primate
  12. phaleth yeah, bun was less responsive than node
  13. blue pema 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
  14. phaleth pema reminds me I should go drink my lemonade
  15. phaleth AppFacade sounds very strange
  16. blue oh nvm, pema schemas are open, I should change that
  17. blue it's not stranger than a RequestFacade :P
  18. blue hm, well, 'open' is a weird way to put. it does ignore unknown values, but doesn't through on them
  19. blue throw*
  20. blue well the idea of a Facade is that you don't expose everything
  21. blue so a primate RequestFacade doesn't give everything that a WHATWG Request has. it has a few things extra, and hides some ugly impl details
  22. blue an AppFacade is the same. you don't want/need the entire App object
  23. blue it'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
  24. phaleth why would there be an App type in rcompat?
  25. blue it's a primate proposal
  26. blue 13:39 < blue> the new version is necessary for this https://github.com/primate-run/primate/issues/251
  27. nevet Proposal: Add `AppFacade#env(key: string)` · Issue #251 · primate-run/primate
  28. phaleth then call it server?
  29. blue it's not a server, you can't stop. it's really app info
  30. blue stop it*
  31. blue it's a very limited facade atm, anyway
  32. phaleth what about Config then?
  33. blue https://github.com/primate-run/primate/blob/master/packages/core/src/private/app/Facade.ts
  34. blue so it has: config(path: string), which gives you access to the config using a path
  35. blue view(name: string), which gives you programmatic access to a compiled view file
  36. blue and get root
  37. blue https://github.com/primate-run/primate/blob/master/apps/website/routes/docs/%5B...page%5D.ts
  38. blue you see how view() is used there?
  39. blue const { html, toc, md } = app.view<Component>(`docs/docs/${$page}.md`);
  40. blue I need to embed the markdown file's data within the svelte component
  41. blue and I need to do it dynamically, based on the path
  42. phaleth so it's some sort of a root class
  43. blue yeah. and in 0.37 it will get a useful env object
  44. blue so you'll be able to do app.env.STRIPE_SECRET and you get automatic typing, as a string
  45. blue or app.env.PORT and it comes as a number
  46. blue this will be based on the schema you provide in app/config.ts
  47. phaleth ok, 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
  48. blue the schema will do a runtime check so the app won't start with a STRIPE_SECRET
  49. phaleth I mean some frameworks do that, but it can bring in bloat
  50. blue I actually debloated this, in @rcompat/env 0.14 I used dotenv
  51. blue in 0.15 I just wrote a parse myself, it's like 20 lines
  52. blue parser*
  53. blue there's not a lot of bloat going on here
  54. blue the 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
  55. phaleth by bloat I mean a lot of env vars that can be in the current shell or whatever
  56. blue I think the former is important, becaus you could get silent weird failures when some env vars aren't configured. the latter one is aesthetics
  57. blue yes but these get loaded anyway by node into process.env
  58. blue you can't really avoid that
  59. phaleth ok, well, if process.env just works, then I'd not bother with any of that
  60. blue it does but you have .env files + as I said, runtime validation
  61. blue app#env just gives you a nice centralised way to access those env vars in a controlled way, otherwise env vars are too loose
  62. blue of course as a user you can completely ignore it and go with process.env
  63. blue but I don't see a lot of advantage
  64. blue so 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
  65. dreamreal Which 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
  66. phaleth yeah, but it's dev's responsibility to warn or error when some input is missing
  67. phaleth and I think that obscure error was because of some jdbc whatever thingy
  68. dreamreal and 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)
  69. phaleth which is a library itself and if the library is bad well then everything with that library is bad
  70. dreamreal what?
  71. phaleth that was meant for blue, and I agree that there should be as much compile time checking as possible
  72. phaleth but env vars are used for all sorts of crap, not just configs
  73. dreamreal one 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
  74. blue phaleth: the BEST way is self-documenting code. nothing beats: `host: p.string.url({ protocol: "jdbc" })`
  75. blue this is the angle provided by AppFacade#env
  76. blue I'm so tired of writing @rcompat/*, I wanna finish up flog so I can start using std:
  77. blue tbht, I have no idea how I'd keep primate compatible with node/deno/bun then :(
  78. blue for node you can rewrite imports, but it's black voodoo magic and doesn't work deno/bun
  79. blue would be cool if the runtimes supported rewrite rules in package.json
  80. blue but I can also see how that leads to absolute catastrophes
  81. 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
  82. phaleth if 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
  83. blue ya, but that's not the point. I'd like to use std: *myself* in primate code
  84. blue and I can't do that as-is since it wouldn't run on any runtime
  85. blue for that, the runtime needs to know what "std:" is. and no runtime supports that atm
  86. phaleth that's the burden of being a library author
  87. blue for node, you can register loads so I could simply map "std:*" to "@rcompat/*
  88. blue loaders*
  89. blue why is the js landscape such unregulated dumpster fire
  90. blue having a sane std is like the absolute basics in every language out there
  91. phaleth let me bring you some news
  92. blue except, uh, js
  93. phaleth hah, this looks very retarted https://dev.to/gabrielenache/vite-8-is-here-and-it-changes-everything-about-frontend-builds-45ci
  94. blue yes, that's totally dumb
  95. phaleth vite brought it's rust tools to the stable version couple days ago, replaced esbuild and rollup with rolldown
  96. blue rolldown achieves nothing over esbuild
  97. blue haha
  98. phaleth "The JavaScript ecosystem has been plagued by fragmented tooling for years. Vite 8 is a serious step toward ending that era."
  99. phaleth that totally sums up the bullshit post
  100. blue vite is a dumpster fire I would never touch for the life of me
  101. blue all you really, ever, need, dot, end of sentence, is esbuild
  102. phaleth yeah, webpack is better
  103. blue btw I'm pretty sure this post was clankered
  104. blue it sounds like chatgpt wrote it
  105. phaleth yup
  106. blue I keep getting too many requests on gh
  107. blue the site is literally unusable

Search posts