Hello everyon! At this point I wrote a good amount of dataviewjs and I find that snippets get long really quickly and I have a lot of code repetiton… On top of that, debugging is only really possible with console.log since the real source of errors inside dataviewjs is never displayed. All these problems stack up to a very unpleasent development experience.
Things I have tried
A while back, I hacked together some require0 wrappers but ultimately failed. I don’t remember all of it, but I think it was due to mobile and/or some async problems.
Does anyone run into the same inconveniences and has some tipps or a solution for the problem? It would certainly be nice to have some modularity and debugging that works on desktop and mobile.
My scripts do tend to have a lot of console.log() & co when being developed, and that is the main source for debugging. I’ve not so far spent enough time to get any of the debugger solution up and running.
However, I’ve occasionally triggered exception (and/or debugger), and use that as an entry point to get to look at the code within _Developer tools, and fiddled around there to get stuff working correctly before going back and doing the same in the actual script.
To avoid code repetition I’ve got two suggestion, and that is first of all to use dv.view() whenever you can, as this moves the actual script out of the notes and into a dedicated script. When you then update that script, all the instances using it is also updated.
Secondly, I also suggest looking into using something like Custom JS or user plugins or Templater (with its user functions), or other plugins allowing you to define modules/functions to be called from other places. Plenty of these exists, and it’s mostly a user preference which you want to use.
Where I’m mostly annoyed/irritated/… when developing is by far when doing stuff for mobile. There I really miss the Developer tools, and feel the Logstravaganza plugin is not up for the task (in my experience).