Skip to content

Clean up/remove unnecessary packages

MS requested to merge CleanUp/remove-unnecessary-packages into master

What does this MR do?

This request removes, unnecessary packages.

Packages

  • removed lodash.pickby – used to pick values out of an object – swapped to native
  • removed popper.js – not used
  • removed twemoji – not used
  • removed underscore – used to map an array, merge an object but never used the function and to group an array by key – swapped to native
  • removed tinysort – not used
  • removed install – not used
  • removed typeface-alfa-slab-one – imported font – swapped to CSS
  • removed object-path – used to pick values out of an object by a string.path – swapped to native
  • removed javascript-time-ago – used to show a short relative time – swapped to native
  • removed date-fns – used for nearly every time to visual – swapped to native
  • updated vue-tel-input from 4.4.2 to 5.11.0 which dropped awesome-phonenumber (Closes #600 (closed))
  • added libphonenumber-js – to test phone numbers also used by vue-tel-input (Closes #600 (closed))
  • removed @sum.cumo/vue-datepicker – used in the registration to pick a date – swapped to bootstrap-vue-datepicker
Screenshot of the BETA bundlesize: https://beta.foodsharing.de/assets/bundlesize.html beta.foodsharing.de_assets_bundlesize.html__1_

Helper (located at @/helper/... and bind to Vue $url, $i18n or $dateFormatter)

  • moved urls to helper/urls
  • moved i18n to helper/i18n
  • created date-formatter with functions relativeTime base date dateBasic dateTime time and more
  • created phone-numbers with functions callableNumber isValid

Where was date-fns used (pages)

  • Registrations (Birthday)
  • Navigation (Basket, Conversations, Notifications)
  • Conversations (Messages, Overview)
  • Dashboard (Basket, Pickups, Activity Posts, Events, Chat)
  • Store (Pickups, Pickup History, Team Info, Leave team Modal, Store Info)
  • Regions/Groups (Forum, Events, Polls)
  • Blog (Post administration)
  • Profil (Banana, Pickups)

Small fixes

  • https://sentry.io/share/issue/b97c84c80c4344cb9e7e3efe1fa5c583/ – a not logged-in user is on the map and the backend checked only for an is location available
  • Index Page font adjusted and images reduced
  • Test user creation is forcing to one static number because the faker package doesn't provide stable German phone number generation which collide with libphonenumber-js
  • Chat should now open the correct conversation

How confident are you it won't break things if deployed?

🔢

How to test

./scripts/docker-compose run --rm --no-deps app php -f run.php Stats betriebe

  1. Checkout branch locally
  2. Clean node-modules and cache before starting
  • sudo ./scripts/clean
  • git clean -dfX for a good clean start
  • ./scripts/start
  1. Check if the font is correct loaded (typeface-alfa-slab-one)
  2. Check if the localization is correct loaded (object-path)
  3. Create a new account and check the birthday and phone number (date-fns, vue-tel-input, @sum.cumo/vue-datepicker)
  4. Login
  5. Go to the Navigation check messages and/or notifications, if the time is relative (javascript-time-ago
  6. Go to the forum and try to add a reaction (lodash.pickby)
  7. All used reaction symbols should not be visible in the reaction menu, but on the thread post (lodash.pickby)
  8. Go to a store and check is the team visible (underscore)
  9. Check if the store team info, only shows valid phone numbers (libphonenumber-js)
  10. Create some pickup
  11. Check if you can create a poll (date-fns)
  12. Check if you can see pickups in the history (date-fns)
  13. Check if store wall posts are correct sorted (date-fns)
  14. Check if the time is, on each page, nearly correct compared to the beta (date-fns)

Checklist

  • added a test, or explain why one is not needed/possible...
  • no unrelated changes
  • asked someone for a code review
  • set a "for:" label to indicate who will be affected by this change
  • [?] added to the next milestone (see https://gitlab.com/foodsharing-dev/foodsharing/-/milestones, unless it has a "for:Dev" label)
  • added an entry to CHANGELOG.md
  • added a short text that can be used in the release notes
  • Once your MR has been merged, you are responsible to create a testing issue in the Beta Testing forum: https://foodsharing.de/?page=bezirk&bid=734&sub=forum. Please change the MRs label to "state:Beta testing".
    • Consider writing a detailed description in German.
    • Describe in a few sentences, what should be tested from a user perspective.
    • Also mention different settings (e.g. different browsers, roles, ...) how this change can be tested.
    • Be aware, that also non technical people should understand.

Release notes text in German

Edited by MS

Merge request reports