Chat Logs

  1. bluehi phaleth
  2. phalethhi blue
  3. phalethhttps://jsx.lol/
  4. phalethyet another https://html.kitajs.org/
  5. nevetKita Html - Super-fast JSX Runtime
  6. bluephaleth: LOL
  7. blueI was thinking that poly should not do JSX
  8. blue<if condition={true}>{"hi"}</fi>
  9. blue<for of={[1, 2]} as=yo>{yo}</for>
  10. phaleth${true ? "hi" : ""}
  11. blue<for in={foo: "bar"} as=[key, value]>{key}</a>
  12. phaleth${[1, 2].forEach(yo => `${yo}`)}
  13. phalethis there forEach in JS? I forgot
  14. blueyes
  15. blueyeah but it's always been a crutch. because you kinda have full JS at your disposal, but then you don't
  16. bluethe realiyt is you don't need full JS in the <template>
  17. blueyou only need a useful subset
  18. phalethanyway, did yout hink about running the svelte code through the esbuild-plugin to just solve the problem that the website has?
  19. phalethi mean esbuild-svelte plugin or whatever it's called
  20. bluethat's unnecessary
  21. blue@primate/svelte already does everything esbuild-svelte does
  22. phalethI like that svelte lets me use full JS
  23. phalethsame for JSX
  24. phalethuh
  25. blueyes but ideally you're never gonna write a full program
  26. blueinside your if tag
  27. blueyou just need a bit of logic
  28. blueI'm kinda having fun with marko
  29. blueprimate 0.39 is going to have full support for it
  30. blueI think you'd kinda like marko, might even switch to it from svelte for the website
  31. phalethtry to read through that https://primate.run/app-5ZNSRVCY.js I think bundlers can purge half of the thing
  32. bluelol
  33. bluemost of it is svelte garbage, anyway
  34. phalethyeah, I think esbuild-svelte gets rid of a lot of that
  35. bluebut we already have an esbuild plugin for svelte, it does the minimum amount of work necessary. or are there any additional flags we're missing?
  36. phalethif marko produces smaller bundle but is still sort of component or partial template based then I guess we could use that
  37. phalethyou mean esbuild flags? I don't think so
  38. blueno I mean, svelte flags
  39. phalethI'm just thinking that svelte needs to be preprocessed for production
  40. blueso let's add that to @primate/svelte if it's missing
  41. phalethI was looking at the svelte compiler flags and non of those made any difference
  42. phalethyeah, would be great if you could do that, to me it seems impossible
  43. blueso @primate/svelte contains an esbuild svelte plugin
  44. bluewhich probably does exactly the same thin gin the end like esbuild-svelte
  45. phalethit just runs the compiler I think
  46. phalethand the compiler adds in a lot of cruft
  47. phalethfor dev that idea is fine
  48. blueif you look here, this is almost the same as what we do
  49. bluehttps://github.com/EMH333/esbuild-svelte/blob/main/index.ts
  50. bluealso some source map support but that's irrelevant for production
  51. bluethere's nothing you're gonna gain from using esbuild-svelte, except for relying on someone else's code, which is almost always bad
  52. blueif you need support for preprocessing, we can add it, and that would mostly amount of passing an option to @primate/svelte and then calling `preprocess`, though what would you gain from? ts is already nativel supported in svelte 5
  53. bluewe'd only need it if we wanted support for additional template engines like pug or scss or so, all garbage in its own right
  54. phalethimport sveltePlugin from "esbuild-svelte";
  55. phalethimport { sveltePreprocess } from 'svelte-preprocess';
  56. phaleth preprocess: sveltePreprocess(),
  57. phaleth app.plugin("client", sveltePlugin({
  58. phaleth }));
  59. phalethit's two things
  60. blueyeah but the preprocessor isn't for optimising the build. it's for supporting magical stuf flike postcss and friends
  61. phalethI don't really exactly know, but I don't think svelte based sites ship extra 23 gzipped KBs
  62. bluehttps://github.com/sveltejs/svelte-preprocess
  63. nevetGitHub - sveltejs/svelte-preprocess: A ✨ magical ✨ Svelte preprocessor with sensible defaults and support for: PostCSS, SCSS, Less, Stylus, Coffeescript, TypeScript, Pug and much more.
  64. blue"Historically, svelte-preprocess was the go-to option whenever you had a language other than JS/HTML/CSS used inside your Svelte files. Today, depending on your setup, you may no longer need it:"
  65. phalethheh, magical, it's all magical
  66. blue"If you're using Svelte 5 and are only using type features of TypeScript (i.e. things that just "go away" after transpiling to JS), you don't need any preprocessor, Svelte handles this natively
  67. blue"
  68. bluebelieve me, we're gonna gain nothing from this nonsense, I've been over these packages and they're a bunch of cruft
  69. blueunless we wanna support scss or coffeescript or pug, of all which are useless
  70. phalethbut still why is there half the unnecesary JS in the final bundle
  71. blueI don't know, but I doubt using esbuild-svelte or svelte-preprocess is gonna influence that
  72. phalethI don't think the compiler just optimizes the output
  73. blueI can't see any magical things they do that we don't do
  74. phalethso then all esbuild based svelte sites ship extra JS
  75. phaleththat makes rollup the tool of choice for prod builds
  76. phalethor rolldown or whatever is the thing nowadays
  77. blueI doubt that. though if anything unneeded is pulled in, that would be primate's fault and not esbuild's
  78. phalethI'm just thinking that cause I remember hello world in svelte was 9 kBs back in the day
  79. blueand then rollup wouldn't do a better job at it, anyway
  80. phalethyeah, but if you look at that app bundle the first half of it is no primate at all
  81. phalethand also why make a new framework if svelte is fine :D
  82. bluewhich part? the svelte error messages?
  83. phalethyeah, prolly, it's like all the svelte features that are not used are included
  84. phalethI gotta go, see ya
  85. blueciao