https://www.dendron.so/ logo
Join Discord
Powered by
# dev
  • n

    nwehner

    09/24/2021, 5:45 PM
    Yeah, I thought that would be shimmed by webpack but not so much lol
  • n

    nwehner

    09/24/2021, 5:45 PM
    I wanted to to a quick
    existSync
    check to see if a file is in the assets dir
  • k

    kevins8

    09/24/2021, 5:45 PM
    nope, if you need to check that, you would check it while building the metadata in
    src/builtin/NextjsExportPod.ts
  • n

    nwehner

    09/24/2021, 7:11 PM
    I'm stumped at the moment on exactly what's going wrong with the testing setup. Dummy React apps seem fine. And front-end tests run just fine in
    engine-test-utils
    -- but in my setup for
    nextjs-template
    , it's now throwing a type error "Cannot read property 'query' of null" from
    function getNoteRouterQuery(router: NextRouter)
    because router is null It doesn't appear to be a dependency issue. Ideas?
  • n

    nwehner

    09/24/2021, 7:20 PM
    Actually, golly. I just noticed that whenever I build the project, yarn discards the TSConfig we need to run jest.... "jsx was set to preserve (next.js implements its own optimized jsx transform)" ๐Ÿ˜ญ
  • k

    kevins8

    09/24/2021, 7:22 PM
    sometimes i see caching issues with old next builds. inside nextjs-template, i would โ€˜rm -rf .nextโ€™ and then run โ€˜yarn setupโ€™ at the root just to rule that out
  • v

    viztor

    09/24/2021, 7:26 PM
    Next.js use Babel, so the transformation is done at that stage, not at the Typescript stage. I actually ran into this issue some other day.
  • n

    nwehner

    09/24/2021, 7:28 PM
    That explains it -- thanks!
  • v

    viztor

    09/24/2021, 8:43 PM
    I think you might want to just reuse Next.js existing babel config at some point. We are using ts-jest in other packages, so there will be an inconsistency, well, the build pipeline is not consistent either.
  • s

    Stephen

    09/28/2021, 1:56 AM
    @User so I imagine that this is not a super uncommon scenario. I've officially spent over twice as much time debugging one component of tests than I did in writing the actual feature. I've gotten much more familiar with typescript, testing, and Dendron in the process, but I think I could use a bit of help on this ๐Ÿ˜…
  • k

    kevins8

    09/28/2021, 1:57 AM
    yeah, that's not uncommon - where are you at and what are you running into?
  • s

    Stephen

    09/28/2021, 2:05 AM
    it's the line editor.selection = new vscode.Selection(start, end). for whatever reason, the debugger seems to completely ignore the line which is guaranteeing errors. I've copied over and dissected 3 other variations on the same function that work properly in other test scripts but it just won't work in this context. I've pushed the limits on what might actually be at fault to no avail. I think I might just leave the tests where they are and push the other changes you suggested in the meantime.
  • k

    kevins8

    09/28/2021, 2:06 AM
    can you make sure that the typescript compiler is working during this time? so
    ./bootstrap/scripts/watch.sh
    is active
  • k

    kevins8

    09/28/2021, 2:06 AM
    also, when the debugger seems to be funky, you can also write a
    debugger;
    clause directly in the code to force it to trigger
  • s

    Stephen

    09/28/2021, 2:07 AM
    yup, I've been checking it each time
  • s

    Stephen

    09/28/2021, 2:08 AM
    I'll give that a try. I've been using breakpoints mainly and stepping through lines to try to corner the issue
  • s

    Stephen

    09/28/2021, 2:09 AM
    It's been pretty illuminating to trace through commands line by line
  • k

    kevins8

    09/28/2021, 2:12 AM
    will also try to dig some time tomorrow to go through the PR and see what the issue is. feel free to push what you have and i can take a look
  • k

    kevins8

    09/28/2021, 8:50 PM
    @User took a look at your PR and found what the issue was. see comments here -> https://github.com/dendronhq/dendron/pull/1317#pullrequestreview-765942839
  • s

    Stephen

    09/29/2021, 4:17 AM
    Thanks @User! all tests are passing now ๐Ÿ‘
  • l

    lukecarrier

    09/29/2021, 10:35 PM
    Howdy folks, am I correct in understanding that
    11:30:40 PM: TypeError: Cannot destructure property 'excerpt' of 'note.custom' as it is undefined.
    may come about since the note lacks frontmatter? I've hit this error while testing out the new Next.js publishing pod, and I think it's because of a rogue markdown file somewhere but I can't repro it locally, only on Netlify ๐Ÿ™ƒ
    k
    • 2
    • 15
  • j

    Joshi

    09/30/2021, 9:57 AM
    Like
    yarn gen:data
    can update the dendron-yml.vaidator.json, is there any command that can be used to update
    package.json
    ?
  • k

    kevins8

    09/30/2021, 3:12 PM
    package.json
    for
    plugin
    or for all packages? whats the use case?
  • k

    kevins8

    09/30/2021, 5:24 PM
    @User your open link pr is now merged ๐Ÿ™‚ will come out in tomorrow's early seed release!
  • l

    lukecarrier

    09/30/2021, 8:16 PM
    Giving the next.js publishing a bit more of a test drive today, it's pretty nice. Would a PR adding support for Plausible analytics be interesting, or maybe support for
    dendron publish init --template
    for forks of the default template?
  • l

    lukecarrier

    09/30/2021, 8:17 PM
    I'm also really keen on testing out Netlify's SSR support, not sure if anyone's looked into this yet? Looks like a great way to cut down build times on larger sites with lots of lesser-accessed notes
  • k

    kevins8

    09/30/2021, 8:20 PM
    +1 on init with template. need to figure out the right extension hooks here
  • k

    kevins8

    09/30/2021, 8:21 PM
    iโ€™m working on example templates for both netlify and vercel
  • l

    lukecarrier

    09/30/2021, 8:29 PM
    Provided the base template isn't too tightly coupled to the pod that exports the notes I think a custom template is the way to go, especially since we can just fork and raise PRs for reusable changes. It seems like a good way to test different templates, too -- just switch branch/fork
  • k

    kevins8

    09/30/2021, 8:33 PM
    just to make sure we're on the same page - when you say custom template, you mean a fork off
    nextjs-template
    ?
1...818283...108Latest