You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I attempted to use the rum/require-lazy macro for code-splitting modules but ran into some unexpected behavior with the module-loading logic. I have the following (simplified) build config and namespace structure:
When I load the some-other-page component, I expect the module loader to load the :room module specified in my build config
Actual behavior
However, the code emitted by the require-lazy macro attempts to load a nonexistent :components module (see screenshot), which creates a runtime exception because I don't have a :components module.
, where the regex grabs components from [my-app.components.room] and ignores room. If I were specifying modules, I would assume that we grab the last token from a required namespace e.g. room from [my-app.components.room]. If it was intentional to resolve to components with your regex, could you share your reasoning?
Otherwise if you agree that extracting room makes more sense, I wonder if we could simplify the regex to make things a bit more explicit. I'm happy to create a PR
(-> (str module)
(clojure.string/split #"\.")
last
keyword)
Screenshot of error loading components module:
The text was updated successfully, but these errors were encountered:
Hi there!
I attempted to use the
rum/require-lazy
macro for code-splitting modules but ran into some unexpected behavior with the module-loading logic. I have the following (simplified) build config and namespace structure:Expected behavior
When I load the
some-other-page
component, I expect the module loader to load the:room
module specified in my build configActual behavior
However, the code emitted by the
require-lazy
macro attempts to load a nonexistent:components
module (see screenshot), which creates a runtime exception because I don't have a:components
module.Other notes
The source of this issue is at
rum/src/rum/lazy_loader.cljc
Lines 40 to 43 in 9feb2a1
components
from[my-app.components.room]
and ignoresroom
. If I were specifying modules, I would assume that we grab the last token from a required namespace e.g.room
from[my-app.components.room]
. If it was intentional to resolve tocomponents
with your regex, could you share your reasoning?Otherwise if you agree that extracting
room
makes more sense, I wonder if we could simplify the regex to make things a bit more explicit. I'm happy to create a PRScreenshot of error loading
components
module:The text was updated successfully, but these errors were encountered: