I feel like I might have left you a bit in the dark with what we're trying to achieve with this Menu class from the get-go (partially cause I'm not entirely sure what our "hand-rolled" UI framework ought to look like at the end). Feel free to ask questions here so we can get a good log going.
But basically, what I see with the initial Menu class is providing a class that can be instantiated and inserted into the beans.html DOM. We won't be providing any new outward functionality (the final HTML will be exactly the same as it was before). But instead of allowing that HTML to be expressed within our beans.html file, we'll be initializing a Menu instance and adding the Menu's html structure to the DOM via this class. So we don't need to worry about extra functionality right now - just move the menu's HTML from the HTML side of things to JavaScript.
Later on, when we start to pull in data to the frontend from our backend, we'll add new methods that allows us to update and change the Menu.
To do this, I'm planning on creating a StateManager of some sort. It'll be a app-global object that holds data and notifies listeners of changes in data. After creating the connection routes I'll start to work on this.
I feel like I might have left you a bit in the dark with what we're trying to achieve with this Menu class from the get-go (partially cause I'm not entirely sure what our "hand-rolled" UI framework ought to look like at the end). Feel free to ask questions here so we can get a good log going.
But basically, what I see with the initial Menu class is providing a class that can be instantiated and inserted into the
beans.html
DOM. We won't be providing any new outward functionality (the final HTML will be exactly the same as it was before). But instead of allowing that HTML to be expressed within ourbeans.html
file, we'll be initializing aMenu
instance and adding theMenu
's html structure to the DOM via this class. So we don't need to worry about extra functionality right now - just move the menu's HTML from the HTML side of things to JavaScript.Later on, when we start to pull in data to the frontend from our backend, we'll add new methods that allows us to update and change the
Menu
.To do this, I'm planning on creating a
StateManager
of some sort. It'll be a app-global object that holds data and notifies listeners of changes in data. After creating the connection routes I'll start to work on this.