- Add `webpack` as a devDependency in `package.json`.
- Update `build-bookmarklet.sh` to run `npm install --silent` and `npx webpack` automatically, ensuring the required `dist/kantine.bundle.js` is generated before packaging.
Co-authored-by: TauNeutrino <1600410+TauNeutrino@users.noreply.github.com>
Removed the 100ms artificial delay in `loadMenuDataFromAPI` and switched from sequentially awaiting fetch requests to concurrently awaiting requests in batches of 5 using `Promise.all`. Preserved original chronological ordering of array elements.
Co-authored-by: TauNeutrino <1600410+TauNeutrino@users.noreply.github.com>
Replaced an inefficient `.innerHTML +=` operation with `.insertAdjacentHTML('beforeend', ...)` in `src/ui_helpers.js`.
Co-authored-by: TauNeutrino <1600410+TauNeutrino@users.noreply.github.com>
Moved `kantine.js` into a `src/` directory with multiple modularized files:
- `api.js`: All API calls and constants
- `state.js`: State management (auth, cache, theme, tags, etc.)
- `utils.js`: Helpers for UI and Date formatting
- `ui.js`: DOM manipulation logic
- `events.js`: Initial DOM event listeners and logic hooks
- `actions.js`: Data fetching actions, local processing logic
- `ui_helpers.js`: UI helper functions (rendering modals, handling DOM injections)
Updated the `build-bookmarklet.sh` to compile with Webpack via newly created `webpack.config.js`. Updated all relevant test scripts to use the new output `dist/kantine.bundle.js` and modified logic to work within Webpack scopes.
Co-authored-by: TauNeutrino <1600410+TauNeutrino@users.noreply.github.com>