Skip to content

Code reloading fails if you use goog namespace #734

@danskarda

Description

@danskarda

Example code:

(ns foo.bar
  (:require [goog]))

(js/console.log (goog/Uri. js/window.location.href))

When you change foo.bar namespace, figwheel triggers reloading of foo.bar.

Reload also refreshes goog namespace which has been already patched by figwheel. This reload removes patched function like goog.isProvided_. Consequently goog.provide("foo.bar") fails because original goog.isProvided_ correctly reports that foo.bar is already there. Since then code reloading will not work at all.

Correct behavior should be to call again boostrap-goog-base after goog reload or prevent goog reloading.

This is not huge issue however it can become a nasty surprise. When reloading suddenly stops working, your first reaction is to suspect your latest upgrade of figwheel/cider/nrepl/... rather then change in your namespace dependencies.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions