Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Improve section on Google Closure import and require

Aperta
#60 4 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Documentazione
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
javascript
Ambito
documentation

Direzione di ricerca

Inizia esaminando la documentazione esistente e i post del blog collegati che trattano Google Closure import e require. Chiarisci la sintassi dei namespace, le importazioni multiple, le collisioni di nomi, l’interoperabilità JavaScript, le classi Closure e i compromessi pratici tra import e require, con esempi per ciascun aspetto; il lavoro è completato quando queste domande dei principianti ricevono una risposta diretta nella documentazione.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

major

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.Vector and ol.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. or goog.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.

Lingua principale
Shell
Stelle
107
Fork
130
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di clojure/clojurescript-site

Tutte le issue di clojure/clojurescript-site

Issue simili

Altre issue su Shell/Bash

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.