DPDK Architecture  ->  Guide (stable)

Javascript

Bundle Size

During development different packages (like the ones listed below) might be required. It's important for performance and usability to keep track of the bundle size. We measure this as the total Javascript bundle size after gzip compression. After a build or on a production environment this is also visible.

Tip: If you'd like to see if a package is worth its size check out https://bundlephobia.com/

Objects

It might sound easy, but using objects (and in particular data from an external source) can often lead to bugs. The reason for this is looking for a property in something that's undefined will break the application. To read and write objects with a default value and handling errors, two libraries can be used (these are small so don't be afraid to import them):

  • https://github.com/developit/dlv: Safely get a dot-notated path within a nested object.
  • https://github.com/lukeed/dset: Safely write deep object values.

Packages & Libraries

To work in a time efficient way we can use the same functions and components in multiple projects. To keep these in one place they can be published as packages under the DPDK NPM Registry. This way they can be installed / updated in any project. Please ask the DevOps Team before releasing a package on how it should be done.

Last modifiedWednesday, March 31, 2021, 8:53:08 AM UTC
Last authorColin van Eenige
Commit ID1fb38ab