Improve section on Google Closure import and require
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Documentation
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- javascript
- Domain
- documentation
Research direction
Start by reviewing the existing documentation and linked blog posts covering Google Closure import and require. Clarify namespace syntax, multiple imports, name collisions, JavaScript interop, Closure classes, and the practical tradeoffs between import and require, with examples for each; done means these beginner questions are answered directly in the documentation.
Written by the indexing model from the issue text.
Description
I've just had to use Google Closure directly for the first time, and I found it difficult to understand the nuances in order to get things working properly on a real project even after reading all the documentation and linked blog posts. The areas that were unclear to me:
- Format to import in a namespace - surround with
[ ],( ), or nothing - particularly when importing multiple dependencies. - How to use import when importing multiple namespaces -
(:import [goog URI OtherNS])- the examples didn't explain this clearly to me. - Name collisions - for example, OpenLayers has classes
ol.source.Vectorandol.layer.Vector- What is the recommended way to work with these? Is there a way to import classes with a namespace to distinguish these? - How to use things after importing or requiring them in JS interop -
URI.orgoog.URI.- this is laid out in a limited form, but I think an example of more extended interop would be very useful. - More specific documentation, perhaps with examples, of how to tell whether things are a Closure class or not.
I also think it would be worthwhile to better explain the benefits of using import over require, but with the caveat that everything will still work fine if you just require everything - it may allow other beginners to this part of ClojureScript to get thing working quickly and improve or experiment as they understand things better.
I'm planning to work on a PR for this.
- Dominant language
- Shell
- Stars
- 107
- Forks
- 130
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from clojure/clojurescript-site
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
clojure/clojurescript-site#413 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
clojure/clojurescript-site#392 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 20/100
clojure/clojurescript-site#390 · 1 comment ·
-
clojure/clojurescript-site#388 · 4 comments · 1 assignee ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 35/100
clojure/clojurescript-site#387 · 3 comments ·
All issues in clojure/clojurescript-site
Similar issues
-
Bob Shell support Openenhancement
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
tooling
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
openSUSE/python-rpm-macros#219 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
YunoHost-Apps/adguardhome_ynh#258 ·
-
steam-short-session-tracker: incorrect registry backup path resets settings during automatic repair Open
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
ValveSoftware/SteamOS#2829 ·