global-exports do not work with 'scoped' ns names

Description

Foreign-libs that provides an ns which is in the npm scoped format like "@foo/bar" can be required and used
in cljs, but global-exports for such nss do not work.

Repro:

in my-foreign-lib.js

var Something = {foo : "bar"}

in cljs file

(ns myns.x (:require ["@scoped/foreignlib" :as lib]))

(def foo-ref (str "test: " lib/foo))

in compiler-opts-scoped.cljs.edn

{:foreign-libs [{:file "src/my-foreign-lib.js" :provides ["@scoped/foreignlib"] :global-exports { "@scoped/foreignlib" Something} }]}

at the cmd line:

clj -m cljs.main -co compiler-opts-scoped.cljs.edn -re node --repl

at the repl:

(require 'myns.x)

=> ReferenceError: _CIRCA_scoped is not defined

The above repro can be found in this repository, please see the README there: https://github.com/henryw374/cljs-global-exports-problems

Environment

None

Activity

Show:
David Nolen
April 13, 2020, 4:18 PM

Thanks for circling back

Henry Widd
April 13, 2020, 11:00 AM

testing on the sha below, this problem appears to be fixed!

 

David Nolen
July 24, 2019, 6:15 PM

Thanks!

Henry Widd
July 24, 2019, 4:50 PM

sure, hopefully a suitable description there now

David Nolen
July 23, 2019, 8:16 PM

Please put the reproduction inline into the issue thanks, it saves a lot of time and preserves more context.

Cannot Reproduce

Assignee

Unassigned

Reporter

Henry Widd

Labels

None

Approval

None

Patch

None

Priority

Major