#langracket/base;; Function to get the runtime library.
;;
;; The resulting Javascript will produce a file that loads:
;;
;;
;; jquery at the the toplevel
;; HashTable at the toplevel
;; jsnums at the toplevel
;;
;; followed by the base library
;;
(requireracket/contractracket/runtime-pathracket/port)
(provide/contract [get-runtime (->string?)])
(define-runtime-pathbase-path"runtime-src")
;; The order matters here. link needs to come near the top, because
;; the other modules below have some circular dependencies that are resolved
;; by link.
(definefiles'(
;; jquery is special: we need to make sure it's resilient against
;; multiple invokation and inclusion.
jquery-protect-header.jsjquery.jsjquery-protect-footer.jsjshashtable-2.1_src.jsjs-numbers.jsbaselib.jsbaselib-frames.jsbaselib-unionfind.jsbaselib-equality.jsbaselib-format.jsbaselib-constants.jsbaselib-numbers.jsbaselib-lists.jsbaselib-vectors.jsbaselib-chars.jsbaselib-symbols.jsbaselib-strings.jsbaselib-bytes.jsbaselib-hashes.jsbaselib-regexps.jsbaselib-paths.jsbaselib-boxes.jsbaselib-placeholders.jsbaselib-keywords.jsbaselib-structs.jsbaselib-ports.jsbaselib-functions.jsbaselib-modules.jsbaselib-arity.jsbaselib-inspectors.jsbaselib-exceptions.jsbaselib-readergraph.js;; baselib-check has to come after the definitions of types,
;; since it uses the type predicates immediately on init time.
baselib-check.jsruntime.js))
(define (path->stringp)
(call-with-input-filep
(lambda (ip)
(port->stringip))))
(definetext (applystring-append
(map (lambda (n)
(path->string
(build-pathbase-path (symbol->stringn))))
files)))
(define (get-runtime)
text)