This repo is for the purpose of debugging mithril issue when importing components from another npm package
I am refactoring my large monolithic application into smaller front-end web-apps based on domain. I have created a UI Kit for and common components eg Header, UserDropDown, Notifications to use across these frontends
eg.
my-project
├── shared_ui
│ ├── header
│ └── footer
│ └── navigation
│ └── notifications
├── catalog_domain
├── payments_domain
└── journey_domain
For components that reside within my UI Kit, Mithril is not acting as expected in two regards:
- routing (m.route.Link)
- rendering (redraw)
I have staged a simplified example that replicates the issue within this repo.
When using m.route.Link
within the shared_ui/nav.js
the url ends up as
follows:
http://localhost:8080/hello#!/world
instead of the expected:
http://localhost:8080/world
When using m.request
within the shared_ui/notifications.js
the success function is suppose to trigger a redraw but it does not.
Adding an explicit redraw()
does nothing with the component.
open up my_app/package.json
and modify the absolute path of shared_ui
"shared_ui": "/Users/andrewbrown/Desktop/mithril_debug/shared_ui"
cd shared_ui
npm install
cd ..
cd my_app
npm install
This will start webpack dev server on port 8080
npm start