Uploaded image for project: 'tools.namespace'
  1. TNS-45

File in invalid path will mark namespace for reload

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Labels:
      None
    • Patch:
      Code and Test

      Description

      Having a cljc file at path public/js/out/foo/bar.cljc with ns form (ns foo.bar) will result in namespace foo.bar being reloaded.

      This is problematic because ClojureScript compiler will copy all the input files to :output-dir for source-map use. Lately as more libraries have started using cljc, and this has started causing problems in cases where library is used on Clojure env. Cljs compilation will result in reload of the library code, which can redefine protocols etc. and break the Clojure env.

      I think it would make sense for tools.namespace to ignore changes where file path and namespace don't match.
      Another question and perhaps way to fix this, is to understand why dependency resolution doesn't work in this case: namespaces which depend on the protocols at a cljc file on output-dir aren't reloaded.

        Attachments

        1. TNS-42-3.patch
          12 kB
        2. TNS-45-2.patch
          4 kB
        3. TNS-45-4.patch
          35 kB
        4. TNS-45-5.patch
          24 kB

          Activity

            People

            • Assignee:
              stuart.sierra Stuart Sierra
              Reporter:
              deraen Juho Teperi
            • Votes:
              3 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated: