Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename :asset-path #99

Open
martinklepsch opened this issue Oct 31, 2016 · 3 comments
Open

Rename :asset-path #99

martinklepsch opened this issue Oct 31, 2016 · 3 comments

Comments

@martinklepsch
Copy link
Contributor

Asset path has been confusing many esp. since it's also overlapping with a compiler option. I recently "discovered" that what it's doing is actually conceptually similar to the :root option in compojure's resource handler. So with that in mind maybe :resource-root would make sense?

Just a thought in any case we should definitely hear from users if this would have cleared things up.

@Deraen
Copy link
Contributor

Deraen commented Oct 31, 2016

Resource-root sounds good!

We could also change the implementation a bit to be more similar to it:

If I recall correctly current asset-path removes the path from start of the URL being reloaded, if the URL doesn't start with asset-path, it is used as is.

Resource-root could work so that ONLY files inside those paths are reloaded.

Resource-root could perhaps also be a collection?

@arichiardi
Copy link
Contributor

My 2c, a resource path in Java is something very particular, at the moment I don't recall the use of :asset-path option exactly, just saying that it might be confusing as well...

@js-choi
Copy link

js-choi commented Nov 16, 2016

As @arichiardi says, the word “resource” does mean something different in Java parlance—and, indeed, Boot’s API itself uses the word in that other way too. This overloading of “resource” may be unnecessarily confusing to many users of Java and Boot.

My preference would be to alias :asset-path to :output-dir, like @esessoms’s original proposal in #65. I think this would match the mental model of the typical ClojureScript user better. After all, every ClojureScript user is familiar with the standard compiler options. I don’t seem much of a downside to aliasing :asset-path to :output-dir, which would maintain backwards compatibility (as opposed to also renaming :cljs-asset-path to :asset-path, which would also be nice but would be a breaking change.)

Eventually, as @Deraen says, it would be great if boot-reload inferred the compiler’s output directory and asset URL paths. When I have time, I might try to contribute an implementation of that myself…though I’d probably have to finally properly learn how Boot pods work, heh.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants