ash-bergs / pantry-pal

Keep track of your shopping list and pantry stock
0 stars 0 forks source link

chore: Split JS with native modules #3

Closed ash-bergs closed 3 months ago

ash-bergs commented 3 months ago

This work splits up the javascript code into modules. I tried to focus on splitting the code up according to component where I could- like form itemsControl and so on.

This uses native Javascript Modules to get the job done, and keeps in line with approach of building with some of the most low level APIs and options I have available.

The fun thing about this work was getting a reminder of scope - especially module scope, and what needs to be on the window so the inline html had access. Working in large React/Next projects with further configs on top of them, a lot of these things get taken care of for us and I got momentarily held up wondering why one module couldn't find one variable or function or another.