Chat Logs

  1. bluephaleth: yesteday the primate web machine automatically redeployed
  2. blueis that configured somewhere?
  3. bluealso hi
  4. bluealso, we need to change the deployment branch to 0.38, I accidently floated the unready 0.39 post
  5. blueI edited the Container image with --branch=0.38 on the git clone, but that did nothing
  6. phalethhi blue
  7. phalethno, I did the redeployment last evening
  8. blueoh ok, that makes sense
  9. phalethI'm trying deno for the primate website
  10. blueI took out the 0.39 post for now so we don't need to change the branch, although technically speaking the docs contain some changes
  11. blueI hope that by 0.39, it'll be all managed by repopack so I could quickly change that, and I do prefer we stay on tsgo for now
  12. blueI mean by 0.40*
  13. phalethyeah, we should stay on tsgo
  14. phalethdo you know if this error https://upaste.de/raw/TbM comes from rcompat are would you be able to fix it?
  15. bluegenerally speaking until I "branch", I prefer the website to be on master, but after branching and concentrating on breaking stuff, I usually have the website point to the latest version
  16. blueso that should be easy with RP
  17. bluelet me look
  18. bluehm, that feels like deno not recognising that as a node import
  19. blueshould be "node:http", strictly speaking
  20. bluecould you paste line 117 here?
  21. phalethyeah, but it's an uglified code
  22. phalethdeno does not seems to like pnpm
  23. blueyeah. though there is `deno install`, fwiw
  24. phalethso there is a lot on that one line https://upaste.de/raw/AiH
  25. blueit's just deno is notoriously bad with symlinks and monorepos
  26. phalethok, but does deno install work with all those dependencies that have ^workspace as a version in package.json?
  27. blueno
  28. blueawait (Wo(a) ? import("https") : import("http"))
  29. bluethis seems wrong, it shouldn't end up in the deno bundle
  30. phaleththat's where the error comes from yes
  31. phalethit's not deno bundling it, it's pnpm
  32. phalethI'm just trying to run it with deno
  33. blueoh. yes, that has slim changes of working
  34. bluepnpm will bundle it for node
  35. blueyou know, maybe we should enable cross-building
  36. bluenpx primate build --target=deno
  37. bluethat's what you're looking for, right?
  38. phalethI have no idea, is that a thing?
  39. bluelet me show you
  40. phaleththe thing is there are these ^workspace deps in package json
  41. bluehttps://github.com/primate-run/primate/blob/master/packages/core/src/private/build/server/index.ts#L75
  42. blueyou see that line?
  43. blueif you build with pnpm, it'll be "node"
  44. bluethese conditions after which branch of rcompat is taken
  45. bluewhat you essentially want, is to able to say that you're building with pnpm, but the resulting bundle should be for deno
  46. blueas a quickhack, try changing taht line to "deno"
  47. blueso
  48. phalethok
  49. blue...conditions.deno
  50. bluethis would force rcompat to take deno paths where available
  51. blueand that http import would disappear
  52. phalethhttps://upaste.de/raw/r9r
  53. blueyes, that's not going to work because I haven't coded it yet
  54. blueinstead, edit it in the file
  55. phalethare there no universal package names for all runtimes?
  56. phalethor is npm:http the one?
  57. blueyes but you don't want that
  58. phalethor node:http one that deno can recognize
  59. blueyou want deno native abstractions
  60. blueDeno.serve
  61. phalethah, ok
  62. bluercompat is intentionally incompatible there
  63. bluebecause if you're on deno, you shuld take the deno path
  64. blueanywy, so to src/private/build/server/index.ts
  65. blueand change line 75 to `...conditions.deno`
  66. bluethen rebuild core
  67. blueand try again
  68. bluego to*
  69. blueI can edit that deno target fairly easily, but we'd better first test this
  70. phalethok, new error https://upaste.de/raw/rL7
  71. blueyes, you're not running it with deno
  72. phalethoh, right
  73. phalethhabit
  74. phalethyeah, that works
  75. phaleth$ deno run -A npm:primate serve
  76. phaleth» app url http://0.0.0.0:6161
  77. bluegreat. and it's using native deno functions
  78. blueI
  79. blueI
  80. blueI'll add crossbuilding to 0.39
  81. bluethat's a great idea
  82. bluebuild with bun, run with deno ;P
  83. phalethok, I'll just put that patch to the Containerfile for now
  84. bluealrighty
  85. phalethbuild with node run with deno
  86. phalethok, the 0.39 blogpost is gone
  87. blueya, I removed it
  88. phalethblue: can you merge some of those merge requests?
  89. phalethI mean pull requests
  90. phalethespecially the new one
  91. blueyes, will do phaleth
  92. bluephaleth: https://github.com/primate-run/primate/commit/08bbbe8d1231393060cb9fb8655b6ec949ee1593
  93. nevetcore: add crossbuilding · primate-run/primate@08bbbe8
  94. blueyou can drop your patch and use --target=deno
  95. blueI merged 2/3 of the prs
  96. bluehttps://github.com/primate-run/primate/pull/273
  97. nevetwebsite: remove unused dev dependencies by phaleth · Pull Request #273 · primate-run/primate
  98. bluethis I'm inclined to reject because I need the devdeps for the snippets, unless you have a better idea
  99. phalethok, I've closed that one
  100. bluetell me if that crossbuilding patch worked for you
  101. blueso I've built the angular app (apps/angular) for node, deno and bun
  102. phalethyeah, trying that now
  103. blueI get 3434572 bytes for bun, 3434973 bytes for deno and 3508428 bytes for node
  104. bluenote though I haven't explored all deno/bun APIs, and rcompat does have some deps which could end up in bun/deno
  105. phaleth{"stream":"[1/2] STEP 12/13: RUN npx -y primate build --target=deno\n"}
  106. phaleth{"stream":"\u001b[1m\u001b[38;2;255;165;0mPRIMATE\u001b[0m\u001b[0m \u001b[38;2;255;165;0m0.39.0-pre\u001b[0m \n\n"}
  107. phaleth{"stream":"✓ build path \u001b[2m/app/primate/apps/website/build\u001b[0m\n"}
  108. phalethlooks good
  109. bluegreat
  110. blueyou know, the differences between the frontends are staggering
  111. bluean angular app is 3.3mb, react 1.1m, svelte clocks in at 458K
  112. blueand I do have @lucide/svelte in svelte which I don't in react/angular, that is a hugebutt icon library, not sure how much of it ends up in the bundle
  113. bluereally I should check
  114. phalethyeah, the website is fine, the blog page responds fast now
  115. blueso without lucide, deno is 436K
  116. phalethright, I wish there was client side framework that was small
  117. bluebun is same
  118. bluenode is 508K, ew
  119. bluewell I guess that answers the question, node pulls in busboy and ws
  120. blueyou'd really expect a runtime in 2026 to support websockets and formdata properly
  121. bluebut still, 436K is way too much
  122. phalethif it's server side bundle then I don't care
  123. bluelet me check the website, it should be much large b/c of shiki
  124. bluelarger*
  125. blueoof, 15M
  126. blueI feel like there's room for optimisation there, this can't be all the markdown files. I think it's shiki mostly
  127. bluein dev mode though, the server is 4.7M which is still too much
  128. bluethe docs dir is 736.0 KiB
  129. blueI guess that compiles to a lot of HTML?
  130. blueso an idea I have for the website so it's faster in dev mode, is to not bundle in the .md files, but import from source directly
  131. bluethat also means esbuild doesn't need to recreate 4.7M when I change a single md
  132. blueideally really, in dev mode the server.js should be tiny
  133. blueso basically in the end it's all in memory, right. whether it's a 4.7 file or the different md imports held by esbuild
  134. bluebut the point being, if you change a single md, esbuild should immediately recompile it only
  135. blueanother cool idea would be to compile-on-demand, that would also speed up dev mode
  136. blueso if I never access /docs/i18n, it doesn't get compiled, no idea how to do that though
  137. phalethare .md files currently bundled and the html is generated at runtime per request?
  138. phalethfor prod I mean
  139. blueyes, basically
  140. bluehttps://github.com/primate-run/primate/issues/253
  141. nevetProposal: `--target=static` (SSG output + client-only runtime) · Issue #253 · primate-run/primate
  142. bluethat's why we have this
  143. phalethah, ok, so that's why bun was struggling there with the response time https://images4.imagebam.com/b9/ae/45/ME1D4GWQ_o.png now deno deployed over an hour ago is fast enough
  144. phalethno need to rewrite bun in rust when we can just use deno
  145. blueheh
  146. bluethe thing is, phaleth
  147. blueif we land https://github.com/primate-run/primate/issues/253
  148. nevetProposal: `--target=static` (SSG output + client-only runtime) · Issue #253 · primate-run/primate
  149. bluewe technically don't really need node/deno/bun to run it
  150. bluejust to build it
  151. phalethyeah, that'd be great
  152. blueit'll just be a bunch of html files
  153. bluethat nginx can serve
  154. blueI don't know how fetch navigation would then work, but maybe it's not necessary
  155. bluethe delta between loading the entire html page, essentially if woff/css is externalised, vs loading 'just' the md content as html in json, isn't very big
  156. bluewe would need a bit of dynamics, for theme change (probably localstorage again?)
  157. phalethyeah, that's the thing, client side rendering would always result in flash
  158. blueya
  159. bluetechnically could compile both dark and light separately, and have nginx deliver one based on the cookie? is that a thing? I dunno
  160. phalethnginx can read headers and decide on paths based on that, the web browser could store theme to local storage and set a custom header
  161. phalethbut that'd require nginx specific configuration
  162. bluethat's great, then potentially we could solve that
  163. phalethI think it's just better not to bother storing the theme, but always take whatever theme the browser is set to, the theme switch can still remain on the website
  164. phalethbut does the browser send that information on every request? no clue
  165. blueif it's a cookie, yes
  166. phalethactually css can detect that: @media (prefers-color-scheme: dark) { ... }
  167. phalethhttps://caniuse.com/?search=prefers-color-scheme
  168. nevet"prefers-color-scheme" | Can I use... Support tables for HTML5, CSS3, etc
  169. phalethyeah, so then always load css first and that's it, no reason to bother doing anything server side
  170. phalethI guess I should try that
  171. blueya
  172. phalethI guess this is the solution https://caniuse.com/?search=light-dark
  173. nevet"light-dark" | Can I use... Support tables for HTML5, CSS3, etc
  174. phalethok, that just doesn't solve the flash problem either
  175. bot<discord:blue> Ya
  176. bluedreamreal: I think markdown db makes a lot of sense if I can have it flattened/rendered down into the bundle, in production
  177. bluethe one angle I haven't got sorted out yet is reloading the page in dev mode, because that'd require fs watching of the .md files