Library Types with Nx

Damaris Göbel
2 min readMar 23, 2023

There are many types of libraries in a workspace.

In order to maintain a certain sense of order, it is recommend having a small number of types, such as the below four (4) types of libraries.

Feature libraries:

Developers should consider feature libraries as libraries that implement smart UI (with access to data sources) for specific business use cases or pages in an application.

A feature library contains a set of files that configure a business use case or a page in an application. Most of the components in such a library are smart components that interact with data sources. This type of library also contains most of the UI logic, form validation code, etc. Feature libraries are almost always app-specific and are often lazy-loaded.

UI libraries:

A UI library contains only presentational components (also called “dumb” components).

A UI library is a collection of related presentational components. There are generally no services injected into these components (all of the data they need should come from Inputs).

Data-access libraries:

A data-access library contains code for interacting with a back-end system. It also includes all the code related to state management.

Data-access libraries contain code that function as client-side delegate layers to server tier APIs.

All files related to state management also reside in a data-access folder (by convention, they can be grouped under a +state folder under src/lib).

Utility libraries:

A utility library contains low-level utilities used by many libraries and applications.

A utility library contains low level code used by many libraries. Often there is no framework-specific code and the library is simply a collection of utilities or pure functions.

Further reading here: https://nx.dev/more-concepts/library-types

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

Damaris Göbel
Damaris Göbel

Written by Damaris Göbel

I like to do crazy things with CSS & JavaScript. My brain occasionally runs out of memory so I need to write down my thoughts.

No responses yet

Write a response