Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    mclare
    @mclare:matrix.org
    [m]
    Yes there's a little graph at the sidebar, but it only shows the relationships, not when something has updated
    wlach
    @wlach:matrix.org
    [m]

    I just added "anonymous" cells to Irydium, which work more like cells in Jupyter or Observable. Basically they just render whatever you return (which, if you use a library like Observable Plot, is just an SVG element). Demo here:

    https://irydium.dev/examples#observable-plot

    Probably need to think more about what the long-term ergonomics of this should be, and figure out how to take advantage of this feature from the python language plugin.

    mclare
    @mclare:matrix.org
    [m]
    wlach: I saw you're working on swapping over to pnpm. I was going to poke around with sveltekit this week and possibly try to tackle Issue #120, so should I hold off until you've finished that?
    wlach
    @wlach:matrix.org
    [m]
    mclare: Hey, that's great! I'm a bit on the fence about whether pnpm is the right choice (although I think it probably is). I think it's ok to do other work while we figure that out-- the switch (assuming we do it) is unlikely to change very much about any code that's within packages/
    I think the main thing we would get from a switch to pnpm is deterministic publishing of the npm packages (I thought there might be other benefits, but there turned out not to be). Thinking through whether that's worth the disruption
    ryanprior
    @ryanprior:matrix.org
    [m]
    I think pnpm is technically neat, but if your dependencies aren't deterministically built from source (and practically nothing in npm is) then your pnpm-built package distros aren't really going to be fully deterministic either.
    1 reply
    mclare
    @mclare:matrix.org
    [m]
    I'm still poking around with sveltekit migration, but trying to get sveltekit set up for a different project and it's not as smooth as the docs would imply unfortunately (especially if you're using a lot of external libraries)
    1 reply
    mclare
    @mclare:matrix.org
    [m]
    lI'm just trying to get a small d3 example with a map working and I'm down several threads about what should be included in svelte.config.js and issues with SSR
    mclare
    @mclare:matrix.org
    [m]
    I've tried troubleshooting on this project: https://github.com/m-clare/layercake-sveltekit-template but I'm still stumped on an error "Must use import to load ES module"
    for geojson
    sveltekit docs do say that if a library needs access to document or window, (which must be the case for d3-geo since the other d3 components seemed to work in the example) that I need to make sure it runs client side
    The docs do warn that even if you try to disable SSR, vite will still fail
    mclare
    @mclare:matrix.org
    [m]
    Anything more than 3 months old is likely to not work, back in April you could still use require rather than import, so workarounds that seemed to manage to get d3 to work aren't likely to succeed anymore
    mclare
    @mclare:matrix.org
    [m]
    if I swap d3-geo to a dependency rather than a devDependency I do get a different error! 😃🤦‍♀️
    all this to say, d3 isn't playing really well with sveltekit
    wlach
    @wlach:matrix.org
    [m]
    I wonder if d3-geo needs to be updated in a similar way that other parts of d3 have been? Just guessing based on the links you posted above
    mclare
    @mclare:matrix.org
    [m]
    I think all parts of d3 have been updated. The template repo, it seems like they had errors when Layercake was installed as a devDependency, but then they moved it to a dependency
    and added it to optimizeDeps in the svelte.config.js
    when I add d3-geo to dependencies rather than devDependencies and then also add it to optimizeDeps, I'm onto a different error with [vite] Error when evaluating SSR module /node_modules/d3-geo/src/path/context.js: ReferenceError: PathContext is not defined
    it does seem weird to have parts of d3 as devDependencies and other parts as dependencies, but I can't find any example projects with a more recent version of Sveltekit (same svelte.config.js file using only import) that use more of the modules within d3
    wlach
    @wlach:matrix.org
    [m]
    How strange, I don't understand why devDependencies vs. dependencies would make any kind of difference
    mclare
    @mclare:matrix.org
    [m]
    I mean neither works, I just get a different error, but the new error seems to be related to client side vs server side rendering.
    mclare
    @mclare:matrix.org
    [m]
    I think I'm going to give up for now and try one of the just plain svelte templates for d3
    so maybe the sveltekit migration would be better once it's at 1.0, I think the issue is still in their roadmap of blockers to 1.0 sveltejs/kit#1895
    wlach
    @wlach:matrix.org
    [m]
    mclare: makes sense, I imagine the default svelte template is quite battle-tested by this point
    wlach
    @wlach:matrix.org
    [m]

    mclare: Heh, starting to experience the type of issue you mentioned for myself. I needed to upgrade some packages in the unified ecosystem (what we use for parsing markdown) for TypeScript support, but recent versions of unified are ES-only. Which of course sapper has problems with 🙄 (kind of the reverse problem that you had with SvelteKit).

    I'm curious, did you resolve the issues you were having?

    mclare
    @mclare:matrix.org
    [m]
    @wlach: Ended up putting it aside for now, the issue I was having seems to come up frequently in both issues and the discord, but it's still not resolved. I just didn't have time to keep going down build error rabbit holes and troubleshooting why one d3 dependency would work, but another one wouldn't. I'd keep an eye on this issue: sveltejs/kit#2086
    wlach
    @wlach:matrix.org
    [m]
    mclare: I completely sympathize with that, it really doesn't feel like a good use of time.
    mclare
    @mclare:matrix.org
    [m]
    wlach: did you figure out how to use sapper for the upgrade?
    I wanted to take a closer look at some of the MyST features
    seems like a small thing I could work on
    wlach
    @wlach:matrix.org
    [m]

    mclare: you mean use sapper with the upgrade to pnpm? I thought I did but ran into some issues yesterday when I actually tried to use/test it. I'll try to fix them shortly (like later today).

    I'd love some help fleshing out the MyST support.

    mclare
    @mclare:matrix.org
    [m]
    Cool, if you want to open some issues with pieces that should be part of it, I can figure out what to tackle
    wlach
    @wlach:matrix.org
    [m]
    For sure, I may not have time today but I'll try to do it soon
    mclare
    @mclare:matrix.org
    [m]
    sounds good!
    wlach
    @wlach:matrix.org
    [m]

    mclare: oh shoot, I think the issues with the pnpm upgrade are going to be harder than I expected to properly fix :/ I'll try to address it this weekend, but it might be easiest to revert to an earlier version of irydium if you want to work on things.

    I did file a couple of MyST issues, including this one:

    irydium/irydium#200

    wlach
    @wlach:matrix.org
    [m]

    mclare: ok I think I fixed things up (I hope). Still have some TypeScript stuff to do with the compiler (which I need to rebase on top of what I just landed), but I think I managed to fix most of the egregious issues.

    tl;dr: I think the trick for now with irydium is to bundle esm-module dependencies (like unified and the other markdown parsing stuff) into the compiler bundle. This is a little inefficient and inelegant, but seems to be the most viable alternative until the tooling (SvelteKit, vite, whatever) catches up.

    mclare
    @mclare:matrix.org
    [m]
    Great! I should be able to take a look this week
    mclare
    @mclare:matrix.org
    [m]
    wlach: finally getting around to the panels component, did you copy the default styles for the admonitions from somewhere? It looks like the cards contained within panels use Bootstrap 4, so I just wanted to make sure I'm getting the proper base styles
    1 reply
    mclare
    @mclare:matrix.org
    [m]
    sounds good, there's a bunch of default styling for cards, which are what the classes within the panel container are called. It looks like I can just write a function to split the panel content based on "---" so I'll try doing that as a start.
    mclare
    @mclare:matrix.org
    [m]
    So I managed to hardcode a string that would properly create cards based on splitting a string like "Test\n---\nTest2", but with the dev website within the repl, I can't figure out how to wrap {node.value} so that I don't get an "Unterminated string constant" error on creating a newline
    \```{panels}
    Test
    ---
    Test2
    \
    ```
    so messing around with the myst-directives example, the moment I hit enter, I get the "Unterminated string constant" error, so I'm wondering if there's a way within the template to ensure that the value passed to the Panels template is always a template literal.
    mclare
    @mclare:matrix.org
    [m]

    I was able to get a panel like this to work.

    \```{panels}
    Test\n---\nTest\n---\nTest
    \

    ```

    wlach
    @wlach:matrix.org
    [m]
    mclare: Thanks for looking at this! Could you post a draft PR? I suspect we might to refactor the compiler module a bit to make this work.
    wlach
    @wlach:matrix.org
    [m]
    BTW, I just merged a irydium/irydium#197 which ports of the compiler to TypeScript.
    mclare
    @mclare:matrix.org
    [m]
    wlach: cool! I just added the draft PR, and I'll take a look at your changes this morning