notespace icon indicating copy to clipboard operation
notespace copied to clipboard

windows support

Open joinr opened this issue 4 years ago • 6 comments

Given:

(ns m4tutorials.core
  (:require [notespace.api]))

#_(notespace.api/init-with-browser)

;;hello, this is a tutorial.

(+ 2 3)

["hello world"]

(def x :a)

2

and a dependency on [scicloj/notespace "3-beta9"] , evaluating (notespace.api/init-with-browser) gives me: notes

(notespace.api/eval-this-notespace ) leaders to an error in the JS on the browser side and a blank page. Invoking (listen) yields a similar error in gorilla-notes js:

TypeError: ca is null (slew of minified gibberish elided).

I have no idea where to start trying to debug this, but am interested in getting it working for some recent tutorials I would like to develop. As I recall, gorilla had issues with windows before (I remember talking with the lead like a year ago, trying to get stuff working). Seems like this is a transitive issue with gorilla maybe.

joinr avatar Sep 22 '21 21:09 joinr

Thanks, @joinr.

In few days, we will share an initial version of Notespace v4, and it will be interesting to check if the problem persists there. The frontend (gorilla-notes) will remain the same, for some time. So maybe the problem will persist.

daslu avatar Sep 30 '21 19:09 daslu

https://github.com/scicloj/notespace/blob/master/src/scicloj/notespace/v4/watch.clj#L6

fails on windows since sun.nio.fs.UnixPath doesn't exist.

examining the usage to determine a portable way to do this; can't load at all.

;;scicloj.notespace.v4.path/real-path returns nil for temp files, which are picked up by the regex. ;;naive fix is to modify the regex to ignore emacs tmp files. less naive fix would be to use a cleaner ;;path to convince windows file exists; but we don't really want to be looking at tmp files....

;;this prevents us from picking up emacs tempfiles which error out ;;nil values passed from real-path, since windows doesn't think they exist... (defn clj-path? [path] (re-matches #_ #"..clj$" #"[^#].clj$" path))

;;watch imports a unix-specific class, when a portable interface would work fine.. (ns scicloj.notespace.v4.watch (:require ...elided) (:import java.nio.file.Path)) ;;changed to Path interface instead of unix-only class.

The JS side is still jacked up with the same earlier error, TypeError: ca is null (slew of minified gibberish elided).

joinr avatar Nov 29 '21 17:11 joinr

I can confirm that the sun.nio.fs.UnixPath doesn't exist can be overcome by using WSL Ubuntu and running the REPL. However I get probably the same Type issue as specified above.

jsss )

jsg24 avatar Jan 27 '22 17:01 jsg24

Tried installing my own checked out version of gorilla-notes with shadow-cljs release app --debug and an altered version number but couldn't get any clojurescript error messages in the browser to appear.

jsg24 avatar Jan 31 '22 17:01 jsg24

I think WSL dodges the issue though (that can be fixed using my little patch though). fwiw it looks like there may have been a similar issue in clerk, but that seems to work fine. I may try the shadow-cljs variant as well.

joinr avatar Jan 31 '22 20:01 joinr

@joinr Thanks for the clerk tip. Switching my project to that. Hope notespace resolves this issue.

jsg24 avatar Feb 01 '22 10:02 jsg24