npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@axa-ch/alt-pod-havarie

v1.1.0

Published

The havarie pod of axa.ch

Downloads

3

Readme

Pod havarie

Migration of old Frontend lib to its own pod.

This is a pure migration from my side 😇!

Main issues in design

  • Incorrect use of redux. One connection for the whole application instead of multiple sub-store connects. It will trigger a react props comparison on every store change!
  • Overengineering: Redux totally not needed for such a small application
  • Logic very complex and abstract. To understand what something is meant to do you have to debug every line of code
  • Unnecessary API requests for getting the json. Is a hard coupled and bidirectional coupling between frontend and server as the server needs frontend and frontend needs sever in order to get countries data, which are static.
  • jQuery only used for DOM selection, not needed at all.
  • Superagent and superagentpromise ajax/fetch wrapper absolutly not needed.
  • Styling in completely different location

Refcatoring done so far:

  • Json loaded on buildtime and incoroporated as a bundle
  • From Frontendlib to POD architecture
  • PLIB v1 to PLIB v2
  • Correct usage of connect and redux
  • Add more debugging tools to the store
  • Externalise store
  • Styling per component
  • Get rid of jQuery
  • Get rid of superagent and superagentpromise
  • Self contained components (action, reducer and component in one place)

Keeping as technical depth:

  • Redux
  • Own implemented translating system
  • Helpers file
  • Semantic incorrect elements (<a> instead of <button> as example)
  • Hard coupling of the setAgents action between <HavarieFilter> and <HavarieList>
  • ~~Agent component has no own data or store. <HavarieList> keeps state of <HavarieAgent> such as areDetailsVisible.~~ -> Fixed

Other refactorings: From WTF code to normal code

WTF:

const dummy = Array.apply(null, { length: Math.max(comTypes.length, communications.length) })

return dummy.map((item, index) => {
  const comType = comTypes[index]

  return {
    type: comTypeMap[comType] || comType,
    communication: communications[index],
  }
})

Normalised:

  const dummy = [];

  for (let i = 0; i < Math.max(comTypes.length, communications.length); i++) {
    const comType = comTypes[i];

    dummy.push({
      type: comTypeMap[comType] || comType,
      communication: communications[i],
    });
  }

  return dummy;

how to release

  1. update package.json in the "version": "1.0.0" field. Please follow semver best practices
  2. run npm run release
  3. commit to develop, add git tag containg the same version as in step 1 and push
  4. Execute jenkins job promote with the version added in point 1