Community
Chat Logs
Sunday, May 24, 2026
- * phaleth joined #primate
- phalethonMount is difficult to replace
- phalethlooks like html components cannot handle ES6 imports, is that the case? https://images4.imagebam.com/e9/ac/29/ME1DC245_o.png
- phalethI mean views
- * phaleth joined #primate
- bluephaleth: I think it should work, I'll investigate why
- phalethok, cool, the apps/html example does not have any script tag in views
- bluethat's bad
- phalethmaybe the example is just old
- bluephaleth: https://github.com/primate-run/primate/commit/5a8842add692231d71bb28bbc9498e7ed2428359
- nevethtml: support imports 路 primate-run/primate@5a8842a
- phalethesbuild is used now, nice
- blueI should probably improve it to minify in production, but couldn't be bothered for now
- blueso technically fyi phaleth, this isn't the case right now, but if html really tapped onto the primate build system, you should potentially also import svelte components, in case they're configured to act like web components
- blueyou could*
- bluebut this would requiring a larger rewrite of @primate/html, and also the ability to configure svelte to emit web components, which I think is possible, but isn't available in @primate/svelte right now
- bluerequire*
- blueI've been playing around with marko v6 and the next primate release will have support for csr in marko, and it has some interesting concepts
- phalethis the bundle size with marko small?
- blueI haven't checked, to be honest
- blueso they support top level imports inside .marko components, which is interesting
- phalethsvelte brings in about 23 kBs gziped of some unused vite garbage or whatever
- blueoh god
- bluethe pivot around vite is terrible: vite is overengineered garbage that should never exist in an ideal universe
- bluethe answer has always been esbuild
- bluewhy should a frontend framework concern itself with delivering bundler integration, above all in its *core* package
- blueat least marko has @marko/vite, which you don't have to tap onto if you don't want
- blueanyway, in marko you can do, `import SomeTag from "../lib/SomeTag.marko"; <SomeTag />`
- blueI think that's elegant, it's nearing my idea of how things should be in frontend. I'd consider putting the template part inside <template> to make it less chaotic
- phalethI've fetched and rebased against master, rebuilt the packages and now when I start primate website I get https://upaste.de/raw/8xk
- bluethat looks like a marko error, inside of a svelte component
- bluelet me see
- blueprobably the marko commit
- phalethok
- phalethcan esbuild bundle marko?
- blueyes
- blueok, turns out I replaced the create-root.ts in svelte with the marko one
- bluelet me fix that
- phalethyeah, no hurry
- bluehttps://github.com/primate-run/primate/commit/3d572012ef44b395b6a131b8e3e3bb6107f48962
- nevetsvelte: restore root 路 primate-run/primate@3d57201
- bluephaleth: ^
- bluecool thing I just learnt: to get the commit *before* a commit (so the parent commit essentially), you can add ^ to the sha
- blueI did `git restore --source=acf65633b6d0372e32e653754f877ee69adf8b6e^ create-root.ts`
- bluegot the source with `git log -n 1 -- create-root.ts`
- bluein one command: `git restore --source="$(git log -n 1 --format=%H -- create-root.ts)^" create-root.ts`
- blueobviously you can script around that to do something like `restore-last create-root.ts` or so
- phalethgetting a new error https://upaste.de/raw/no3
- bluehm
- bluephaleth: try again
- bluelast commit should be `svelte: restore deleted files"
- phalethgetting the previous error again https://images4.imagebam.com/44/a8/05/ME1DC8CU_o.png
- bluephaleth: did you recompile @primate/html?
- phalethyeah, the picture shows that
- phalethoh, actually it's cut off
- phalethbut in any case yeah
- phaleththat error appears at runtime btw
- bluehm
- bluebut you can run `apps/html` and browse to /script ?
- phalethyeah, I can and I get `Hello, bar` on that page and no error
- phalethI guess I should just push the code I have to a branch
- blueare you sure? this is working for me
- blueI created docs2.html
- bluethen put `import theme from "#config/theme";` in it, and a console.log
- bluethen returned it from a route, and it works
- phalethyeah, well, take a look at the wip-dont-merge on my fork
- blueok
- phalethlatest deno is much faster than previous one, kind of on par with node
- bluecool
- bluephaleth: I looked at the branch
- bluethis is a misunderstanding
- bluevariables inside the `<script>` block aren't available as template variables
- bluetemplate variables are props
- blueso ${theme} would require you passing a `theme` prop to docs.html
- phalethah, ok
- phaleththat means every variable needs to be a prop?
- phalethlike for example size
- bluewell yes. or you set it dynamically via querySelector
- phalethdang :)
- bluewell, we need poly, there's only so much html tmeplates can do
- bluespeaking of which, what do you find better?
- phalethbut poly will also bring in the svelte compiler?
- bluehttps://dpaste.com/3YFKRQV96
- bluehttps://dpaste.com/9AF828WK5
- blueno, poly will have nothing to do with svelte
- phaleththe client side bundle size is the problem with svelte
- blueyes, that will be as tiny as possible
- phalethah, ok, so you are already working on something new
- blueyes
- phaleththe first one with template tag looks good
- blueso poly will feel very much like svelte 3/4
- phalethbut the second one should work if you save it as html file
- phalethI mean editors should have no problems then
- blueexcept that instead of a magical let, we have a `signal` keyboard, and instead of magical export let being props, we'll have the prop keyword
- blueso you're saying the second form is better for editors?
- phalethyeah, signal means state
- phalethcould also call it state
- blueI mean, it doesn't particularly matter because editors wouldn't be able to parse it correctly because of the two new keywords
- phalethyeah, the second one with script tag can just go into html file
- blueyeah
- bluethe main attractive part is that .poly will be ts-first
- phalethah, so maybe if you want ts extension to work then the first one is better
- blueso `prop foo: number;` and `signal bar: string = "bar";`
- phalethor tsx if you want a template lang
- bluethe main thing I care about is not having magic here
- phalethtsx is actually not as bad as react's tsx
- phalethreact kinda screwed it up
- blueroyally
- phalethand esbuild has no problem transpiling tsx
- bluebut tsx won't recognise things like `signal bar: string;`, no?
- blueor is it extensible?
- phalethyeah, you'll have to add a preprocessor
- phalethbut for editors you can use tsx extension I guess
- bluethe main concern are editors, but I guess for that you need a plugin/language server
- blueanyway, I think svelte 3/4 nearly nailed it, but then they moved on to the rune nonsense, because, you know, toxic community and so on
- phalethnah, there is always something underlined with red squiglies with TS in the editor
- phalethas long as the compiler is good with the code then the code is good
- blueya
- phalethsvelte 3 was peak frontend tech
- phalethzero dependencies
- blueyup
- phalethblue: can you tell if this is the correct way to setup an esbuild plugin? the size of the app bundle didn't change https://images4.imagebam.com/17/e1/7d/ME1DCDWD_o.png
- phalethyeah, esbuild-svelte is being picked up by the core https://images4.imagebam.com/e8/92/e0/ME1DCERE_o.png
- phalethmaybe it should go first before svelte plugin?
- * jreicher joined #primate