Submit

Back to the channels

#primate

  1. * phaleth joined #primate
  2. blue hi phaleth
  3. phaleth hi blue
  4. phaleth https://jsx.lol/
  5. phaleth yet another https://html.kitajs.org/
  6. nevet Kita Html - Super-fast JSX Runtime
  7. blue phaleth: LOL
  8. blue I 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. phaleth is there forEach in JS? I forgot
  15. blue yes
  16. blue yeah but it's always been a crutch. because you kinda have full JS at your disposal, but then you don't
  17. blue the realiyt is you don't need full JS in the <template>
  18. blue you only need a useful subset
  19. phaleth anyway, did yout hink about running the svelte code through the esbuild-plugin to just solve the problem that the website has?
  20. phaleth i mean esbuild-svelte plugin or whatever it's called
  21. blue that's unnecessary
  22. blue @primate/svelte already does everything esbuild-svelte does
  23. phaleth I like that svelte lets me use full JS
  24. phaleth same for JSX
  25. phaleth uh
  26. blue yes but ideally you're never gonna write a full program
  27. blue inside your if tag
  28. blue you just need a bit of logic
  29. blue I'm kinda having fun with marko
  30. blue primate 0.39 is going to have full support for it
  31. blue I think you'd kinda like marko, might even switch to it from svelte for the website
  32. phaleth try to read through that https://primate.run/app-5ZNSRVCY.js I think bundlers can purge half of the thing
  33. blue lol
  34. blue most of it is svelte garbage, anyway
  35. phaleth yeah, I think esbuild-svelte gets rid of a lot of that
  36. blue but 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. phaleth if marko produces smaller bundle but is still sort of component or partial template based then I guess we could use that
  38. phaleth you mean esbuild flags? I don't think so
  39. blue no I mean, svelte flags
  40. phaleth I'm just thinking that svelte needs to be preprocessed for production
  41. blue so let's add that to @primate/svelte if it's missing
  42. phaleth I was looking at the svelte compiler flags and non of those made any difference
  43. phaleth yeah, would be great if you could do that, to me it seems impossible
  44. blue so @primate/svelte contains an esbuild svelte plugin
  45. blue which probably does exactly the same thin gin the end like esbuild-svelte
  46. phaleth it just runs the compiler I think
  47. phaleth and the compiler adds in a lot of cruft
  48. phaleth for dev that idea is fine
  49. blue if you look here, this is almost the same as what we do
  50. blue https://github.com/EMH333/esbuild-svelte/blob/main/index.ts
  51. blue also some source map support but that's irrelevant for production
  52. blue there's nothing you're gonna gain from using esbuild-svelte, except for relying on someone else's code, which is almost always bad
  53. blue if 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. blue we'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. phaleth import sveltePlugin from "esbuild-svelte";
  56. phaleth import { sveltePreprocess } from 'svelte-preprocess';
  57. phaleth preprocess: sveltePreprocess(),
  58. phaleth app.plugin("client", sveltePlugin({
  59. phaleth }));
  60. phaleth it's two things
  61. blue yeah but the preprocessor isn't for optimising the build. it's for supporting magical stuf flike postcss and friends
  62. phaleth I don't really exactly know, but I don't think svelte based sites ship extra 23 gzipped KBs
  63. blue https://github.com/sveltejs/svelte-preprocess
  64. nevet GitHub - 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. phaleth heh, 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. blue believe me, we're gonna gain nothing from this nonsense, I've been over these packages and they're a bunch of cruft
  70. blue unless we wanna support scss or coffeescript or pug, of all which are useless
  71. phaleth but still why is there half the unnecesary JS in the final bundle
  72. blue I don't know, but I doubt using esbuild-svelte or svelte-preprocess is gonna influence that
  73. phaleth I don't think the compiler just optimizes the output
  74. blue I can't see any magical things they do that we don't do
  75. phaleth so then all esbuild based svelte sites ship extra JS
  76. phaleth that makes rollup the tool of choice for prod builds
  77. phaleth or rolldown or whatever is the thing nowadays
  78. blue I doubt that. though if anything unneeded is pulled in, that would be primate's fault and not esbuild's
  79. phaleth I'm just thinking that cause I remember hello world in svelte was 9 kBs back in the day
  80. blue and then rollup wouldn't do a better job at it, anyway
  81. phaleth yeah, but if you look at that app bundle the first half of it is no primate at all
  82. phaleth and also why make a new framework if svelte is fine :D
  83. blue which part? the svelte error messages?
  84. phaleth yeah, prolly, it's like all the svelte features that are not used are included
  85. phaleth I gotta go, see ya
  86. blue ciao
  87. * jreicher joined #primate

Search posts