diff --git a/main-imports.rkt b/main-imports.rkt new file mode 100644 index 0000000..f82f2ac --- /dev/null +++ b/main-imports.rkt @@ -0,0 +1,16 @@ +#lang racket + +;; These are separated from main.rkt as a performance improvement: +;; so they can be imported into the render.rkt namespace +;; and cached for the benefit of the render eval function. + + +(require racket/list) +(require (planet mb/pollen/tools) (planet mb/pollen/main-helper)) +(require (only-in (planet mb/pollen/ptree-decode) ptree-source-decode)) +(require (only-in (planet mb/pollen/predicates) ptree?)) + +(provide (all-from-out + racket/list + (planet mb/pollen/tools) (planet mb/pollen/main-helper) + (planet mb/pollen/ptree-decode)(planet mb/pollen/predicates))) \ No newline at end of file diff --git a/main-preproc-imports.rkt b/main-preproc-imports.rkt new file mode 100644 index 0000000..4a9c9d2 --- /dev/null +++ b/main-preproc-imports.rkt @@ -0,0 +1,14 @@ +#lang racket + +;; These are separated from main-preproc.rkt as a performance improvement: +;; so they can be imported into the render.rkt namespace +;; and cached for the benefit of the render eval function. + +(require (only-in (planet mb/pollen/readability) ->list) + (only-in (planet mb/pollen/tools) trim) + (only-in (planet mb/pollen/predicates) whitespace?)) + +(provide (all-from-out + (planet mb/pollen/readability) + (planet mb/pollen/tools) + (planet mb/pollen/predicates))) \ No newline at end of file diff --git a/main-preproc.rkt b/main-preproc.rkt index 627304d..e6aeb0c 100644 --- a/main-preproc.rkt +++ b/main-preproc.rkt @@ -1,9 +1,6 @@ #lang racket -(require (only-in (planet mb/pollen/readability) ->list) - (only-in (planet mb/pollen/tools) trim) - (only-in (planet mb/pollen/predicates) whitespace?)) - +(require "main-preproc-imports.rkt") (provide (except-out (all-from-out racket) #%module-begin) (rename-out [module-begin #%module-begin])) diff --git a/main.rkt b/main.rkt index 747df65..4d8d8c3 100644 --- a/main.rkt +++ b/main.rkt @@ -1,8 +1,5 @@ #lang racket -(require racket/list) -(require (planet mb/pollen/tools) (planet mb/pollen/main-helper)) -(require (only-in (planet mb/pollen/ptree-decode) ptree-source-decode)) -(require (only-in (planet mb/pollen/predicates) ptree?)) +(require "main-imports.rkt") (provide (except-out (all-from-out racket) #%module-begin) (rename-out [module-begin #%module-begin])) diff --git a/render.rkt b/render.rkt index 4a49018..3496848 100644 --- a/render.rkt +++ b/render.rkt @@ -293,6 +293,8 @@ (planet mb/pollen/debug) (planet mb/pollen/decode) (planet mb/pollen/file-tools) + (planet mb/pollen/main-imports) + (planet mb/pollen/main-preproc-imports) (planet mb/pollen/predicates) (planet mb/pollen/ptree-nav) (planet mb/pollen/ptree-decode) @@ -337,6 +339,8 @@ (planet mb/pollen/debug) (planet mb/pollen/decode) (planet mb/pollen/file-tools) + (planet mb/pollen/main-imports) + (planet mb/pollen/main-preproc-imports) (planet mb/pollen/predicates) (planet mb/pollen/ptree-nav) (planet mb/pollen/ptree-decode)