Skip to content

Latest commit

 

History

History
245 lines (233 loc) · 12.2 KB

Changelog.md

File metadata and controls

245 lines (233 loc) · 12.2 KB

Changelog

v0.2.2

  • Enhancement: Upgrade to nREPL v0.6 - eliminate uncaught stacktrace error
  • Introduce modular message handling incl new tests
  • Add retrievable version including timestamp, printed at startup (banner)
  • Add config file to control features such as log level
  • Address (some) reported issues
    • #83: Hanging after evaluating cell with syntax error
    • #84: Kernel dies on empty code string
    • #30: Dead kernel on startup (comm_info_request) (don't terminate on unknown messages)
    • #69: FileNotFoundException Could not locate... on classpath.
    • #76: add-javascript broken?
    • #58: AOT+old tools.reader causing problems using latest ClojureScript
    • #85: Consider the silent and store_history keys of an execute request
  • Improve basic install
    • Eliminate shell script in clojupyter install artifact (call java directly)
    • Add clojupyter icons (in Jupyter Lab Launcher, top right corner in Jupyter Notebook)
    • Add version numbered icons
    • Replace shell scripts with lein functions for basic build operations
      • clojupyter-install
      • check-os-support
      • check-install-dir
      • update-version-edn
    • Add version-specific kernel install directory
    • Make default kernel install directory clojupyter (instead of clojure)
    • Add make targets
      • update-version-edn
      • install-version (install plain icon)
      • install-version-tag-icons (install version-tagged icon, depends on convert from imagemagick package)
  • Create updated Docker image for current version
  • Update TODO in README.md: add tentative near-term roadmap
  • Clean out obsolete issues on github
  • Delete unused branches on github
  • Establish numbered releases
  • Update example notebooks
  • Change code structure towards having an open, extensible architecture (more work is needed to make it extensible)
    • Introduce handler-based middleware structure similar to nREPL and Ring

    • Enable higher degree of separation of concerns, thus enabling adding features in a modular fashion

    • Introduce layered message handling: Incoming messages pass through a define sequence of middleware handlers with outbound message passing through the same set of handlers in reverse order, yielding a layered message-processing architecture

    • Introduce handler, middleware, and transport abstractions similar to those of employed in nREPL, but adapted to fit into the multichannel context of Jupyter (cf. send-stdin, send-iopub, and send-req in clojupyter.transport)

    • Convert existing functionality to middleware-based structure, messaging-handling is now defined by core message handler (in clojupyter.middleware):

      (def wrap-base-handlers
        (comp wrap-execute-request
              wrap-comm-msg
              wrap-comm-info
              wrap-comm-open
              wrap-is-complete-request
              wrap-complete-request
              wrap-kernel-info-request
              wrap-inspect-request
              wrap-history-request
              wrap-shutdown-request))
      
      (def wrap-jupyter-messaging
        (comp wrapout-encode-jupyter-message
              wrapout-construct-jupyter-message))
      
      (def default-wrapper
        (comp wrapin-verify-request-bindings
              wrapin-bind-msgtype
              wrap-print-messages
              wrap-jupyter-messaging
              wrap-busy-idle
              wrap-base-handlers))
      
      (def default-handler
        (default-wrapper not-implemented-handler))
      

      The modular structure will make it much easier to add functionality going forward.

    • Reorganize code structure:

    src
    ├── clojupyter
    │   ├── display.clj
    │   ├── javascript
    │   │   └── alpha.clj
    │   ├── kernel
    │   │   ├── cljsrv
    │   │   │   ├── nrepl_comm.clj
    │   │   │   ├── nrepl_middleware.clj
    │   │   │   └── nrepl_server.clj
    │   │   ├── config.clj
    │   │   ├── core.clj
    │   │   ├── history.clj
    │   │   ├── init.clj
    │   │   ├── jupyter.clj
    │   │   ├── logo.clj
    │   │   ├── middleware
    │   │   │   ├── base.clj
    │   │   │   ├── comm.clj
    │   │   │   ├── complete.clj
    │   │   │   ├── execute.clj
    │   │   │   ├── history.clj
    │   │   │   ├── inspect.clj
    │   │   │   └── log_traffic.clj
    │   │   ├── middleware.clj
    │   │   ├── spec.clj
    │   │   ├── stacktrace.clj
    │   │   ├── state.clj
    │   │   ├── transport
    │   │   │   └── zmq.clj
    │   │   ├── transport.clj
    │   │   ├── util.clj
    │   │   └── version.clj
    │   ├── misc
    │   │   ├── display.clj
    │   │   ├── helper.clj
    │   │   ├── leiningen.clj
    │   │   └── mime_convertible.clj
    │   └── protocol
    │       └── mime_convertible.clj
    └── clojupyter.clj
    
    8 directories, 32 files
    
  • Add support for configuration file, loaded at startup
    • Read from ~/Library/Preferences/clojupyter.edn on MacOS and ~/.config/clojupyter.edn on Linux (per XDG Base Directory specification)
    • Move location history file to ~/Library/Caches on MacOS and ~/.local/share (per XDG Base Directory specification)
    • Control printing of stacktraces (workaround, base issue addressed by upgrade to nREPL 0.6) in configuration file
    • Control log level in configuration file
    • Control ZMQ traffic logging in configuration file
  • Improve tests
    • Convert existing tests to work with new structure
    • Add tests for middleware providing checks for basic message responses
  • Miscellaneous
    • Upgrade Jupyter messing protocol to v5.3 (from v5.0) - no apparent impact
    • Replace clj-time with clojure.java-time
    • Rename idents in ZMQ messages to envelope
    • Define names for Jupyter message identifiers (in clojupyter.misc.jupyter)
    • Eliminate zmq-comm protocol - not needed
    • Use :aot only in uberajr profile in project.clj

v0.2.1

  • Improve code structure / organization
    • Use a single atom for all global state. Provide abstraction for manipulating global state. Eliminate states.
    • Use accessor functions for socket access. Avoids storing sockets in Zmq_Comm. Accessor functions for stdin-socket and iopub-socket in passed-around map S.
    • Eliminate atoms containing sockets - not necessary since they are used, not updated.
    • Remove depencency on async.core - not used.
  • core.clj
    • Replace configure-shell-handler and configure-control-handler with make-handler. Their role is the same, the main difference that execution-counter is incremented on the shell socket. Why not simply use the same handler?
    • Integrate creation of signer and checker functions.
    • Simplify run-kernel based on above.
    • Separate code related to nrepl-server and Clojupyter middlerware into separate namespace: clojupyter.misc.nrepl-server.
  • messages.clj
    • Considerably simplify make-shell-handler and make-control-handler: Unify into one.
    • Use consolidation of global state to turn handle-execute-request into regular responding function defined with defresponse.
    • Add with-debug-logging
    • Add accessor functions for socket access.
    • Integrate creation of signer and checker.
    • Integrate status-content and pyin-content into point-of-use.
    • Use abstractions to access global state.
  • nrepl_comm.clj
    • Refactor giant defrecord into smaller functions, no change in logic.
  • history.clj
    • Move determination of max history length here.
  • nrepl_server.clj(added)
    • nrepl-related code from core.clj.
  • state.clj
    • Rename from states.clj - add single atom for all of global state.
    • Add functions to manipulate global state.
  • zmq_comm.clj
    • Use accessor functions instead of access-by-socket-name.
  • util.clj
    • Add with-debug-logging macro.
    • Add reformat-form. Very early experiment with auto-indent / auto-reformat of cells based on Code Prettify / Autopep8. Very primitive / early cell reformatting prototype appears to work (cf. ./nbextensions/code_prettify/autopep8.yaml). More work needed (quite a bit), but it looks like there's a fairly straightforward solution.
  • user.clj
    • Added to support experiments with reformat-form.

Changes at revision 2913dc17 relative to Clojupyter master latest commit per 15 February 2019 (994f680c):

  • Ensure compatibility with Clojure v1.9 and Clojure v1.10
  • Enable nrepl-based access from interactive development environments such as CIDER/Cursive: Leave :value unchanged, add :mime-tagged-value instead
  • Update dependencies, not least move to nrepl v0.5.3 and cider-nrepl v0.20.0
  • Improve code structure / organization
    • Use a map for passing largely unchanging values around
    • Abstract message content access: Use message-* functions
    • Make functions used only locally :private
  • core.clj
    • Refactor configure-{shell,control}-handler to use multi-method instead (respond-to-message)
    • Use macro catching-exceptions to improve code readability
    • Refactor process-heartbeat away
    • Shorten arglists using a map instead of individual args
    • Add nrepl-server-addr to retrieve nrepl server port to enable connection from interactive development environment
  • messages.clj
    • Use multi-method respond-to-message dispatching on request type to eliminate individually named response functions such as input-request, comm-open-reply, kernel-info-reply, etc.
    • Use macro defresponse to further reduce code size
    • Refactor shutdown-reply separating shutdown actions and responding to shutdown request
    • Refactor away content-calculating functions to get better locality permitted by much smaller response generating functions
    • Refactor send-message and send-router-message to reduce code redundancy and make code easier to follow
    • Refactor execute-request-handler a bit, add comments
    • Rename get-message-{signer,checker} to make-message-{signer,checker}
    • Move some generic helper functions to util.clj
  • middleware/mime_values.clj
    • Assoc :mime-tagged-value to result of to-mime (instead of mime-tagging :value directly): Enables using the nrepl server using regular clients
  • protocol/mime_convertible.clj
    • Print nil as nil (instead of not printing anything)
  • stacktrace.clj
    • Add mechanism to control whether stacktraces are printed or not as it appears that cider-nrepl occasionally triggers uncaught exceptions. Most likely linked to upgrade of nrepl and/or cider-nrepl; the cause of the problem not understood as yet.
  • core_test.clj
    • Update tests
  • Miscellaneous code cleanup
    • Send error messages to Jupyter stream stderr instead of stdout
    • Use ->Class-forms, e.g. ->HiccupHTML instead of HiccupHTML., to allow interactive class updates
    • Extra log/debug here and there
    • Various reformatting here and there
  • Examples
    • html-demo.ipynb
      • Update to use Vega Lite instead of Highcharts (which seems to be broken in both updated version and current HEAD of master using Clojure 1.8)
    • incanter-demo.ipynb
      • Update to print Clojure version