Chat Logs

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