Giter Club home page Giter Club logo

clj-reload's Introduction

Here are a few projects I worked on.

Fonts:

Apps:

  • AnyBar: universal macOS menubar status indicator

Java libraries:

  • Skija: Bindings for Skia, a graphics library
  • JWM: Cross-platform window management

Clojure libraries:

Sublime Text:

  • Clojure Sublimed: Clojure support for Sublime Text 4
  • Executor: Run any executable from your working dir in Sublime Text
  • Writer: Color scheme for focused long-form writing

Alabaster, a Minimalist Color Scheme:

Keyboard layouts:

  • Universal: EN/RU reimagined to be used together

clj-reload's People

Contributors

danieroux avatar tonsky avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

clj-reload's Issues

Provide functionality to reload library namespaces

First thanks for the great library, I've replaced tools.namespace with it and I'm much happier.

Maybe this is outside the scope of this project, but given all the nice functionality to reload namespaces in topological order I think it would be great to have a function like clj-reload.core/reload to reload namespaces by regex (like with :only) but that works on the entire classpath and which doesn't take into account or modifies the current reload state.

This can be useful in situations where you go and re-eval libraries functions (like to add debug statements), so after you are done you can do something like (clj-reload.core/reload-all #"ring.*"), and you don't need to think what functions you changed nor restart the repl.

Error loading stashed private vars

Having a private that is loaded from stash, such as

(defonce ^:private abc {})

results in

; Execution error (IllegalStateException) at clj-reload.util/ns-load-file (util.clj:93).
; var: clj-reload.stash/abc is not public

This seems to happen because the ^:private metadata is retained when the var is stashed.

Looks like `:dirs` can only be one

(reload/init {:dirs ["src" "dev" "test"]})
Execution error (IllegalArgumentException) at clj-reload.core/files->namespaces$fn (core.clj:56).
Don't know how to create ISeq from: java.io.File

This works:

(reload/init {:dirs ["src"]})

minor issue with faux cyclic dependency

Had some legacy code whereby

(ns blah 
   (:require [foo bar blah]))  ;;accidental self-reference

clojure compiler is smart enough to silently ignore this and not load self-references in the ns form; e.g. no cycle is detected when using legacy reload-all behavior or any loading. clj-reload sees the form and (rightly, or wrongly depending preferred semantics) claims there's an effective cycle in the dependency. I opted to side with clj-reload and prune the cycle, posting issue for reference.

Large codebase that fails with clj-reload but not tools namespace.

Hey I have large codebase at 'megacorp', that I can't share, but it failing to be loaded on initial start-up via clj-reload, but works fine with tools namespace, do you have any tips on what to post here to help you diagnose the issue, i haven't had much time to dive into it, i'll take a longer look at the weekend, but it looks like it could be an issue with clj-reload. i'm getting errors like 'foo' alias does not exist when its clearly required. I can't share code, or filenames, but I can anonymize the data if you tell me what to send.

Lock

Parallel code reloading isn't safe.

So it would seem a good idea to add a lock so that one cannot reload concurrently?

This is a plausible scenario when using clj-reload via CIDER.

We could add a lock ourselves (as we do with t.n), but having it here would seem best.

WDYT?

Cheers - V

Fails to parse files with aliased keywords

  (require '[clj-reload.parse])

  (defn read-str [s]
    (clj-reload.parse/read-file (java.io.PushbackReader. (java.io.StringReader. s)) nil))

  (read-str "(ns broken (:require [clojure.string :as string])) ::string/foo")
  ; (err) Execution error at clj-reload.parse/read-file$fn (parse.clj:79).
  ; (err) Invalid token: ::string/foo

When given a namespace that uses an aliased keyword read-file throws an exception "Invalid token: ::string/foo".

I can see that this uses clojure.core/read (with *read-eval* set to false) which is where the exception comes from. clojure.core/read will use *ns* and the aliases of the current namespace to resolve the aliased keyword. But as the file is read with *read-eval* set to false the namespace form is not evaluated and no aliases are created, so the keyword cannot be resolved.

I'm not sure how to fix this without using another reader (like clojure.tools.reader). It could work by creating namespaces and adding aliases into them.

  (binding [*read-eval* false
            *ns* (create-ns 'hacky)]
    (alias 'string 'clojure.string)
    (read (java.io.PushbackReader. (java.io.StringReader. "::string/foo"))))

But this obviously has an impact on the current environment which might not be ideal.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.