1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-28 00:06:53 +01:00
unleash.unleash/website/docs/contributing/backend/ADR/preferred-export.md
Fredrik Strand Oseberg 50fb671b66
Docs/dev docs (#2134)
* docs: add ADRs

* docs/adrs

* fix: update developer guide

* fix: add space

* Update website/docs/contributing/backend/overview.md

Co-authored-by: Ivar Conradi Østhus <ivar@getunleash.ai>

* docs: remove auto-generated sidebar

This should've been in .gitignore, but has only been ignored to the
ignore file for the website subdirectory. (This has been fixed on main.)

* docs: delete empty file

* Revert "docs: delete empty file"

This reverts commit 2435f173ff.

* docs: add frontmatter to new dev docs

* Docs(fix): add quotes around page titles

In yaml, the colon is a special character, so we need to use quotes.

* docs: fix remaining titles

* Update website/docs/contributing/backend/overview.md

Co-authored-by: Ivar Conradi Østhus <ivar@getunleash.ai>

* fix: update empty ADR

* fix: update text to reflect postgres 12

* fix: update backend overview

* fix: remove link

* fix: add form ADR

Co-authored-by: Ivar Conradi Østhus <ivar@getunleash.ai>
Co-authored-by: Thomas Heartman <thomas@getunleash.ai>
2022-10-19 14:32:37 +02:00

840 B

title
ADR: Preferred export

Background

In the codebase, we have discovered that default exports create multiple problems. One is that you can rename the component when importing it, which can cause confusion. Another is that it is harder to find the component when you are looking for it, as you have to look for the file name instead of the component name (solved by ADR for naming, but still relevant).

Decision

We have decided to use named exports. This will allow us to eliminate the possiblity of exporting a component and renaming it in another file. It also allows us easy access to advanced refactors across the project, because renaming in one place will propagate to all the other places where that import is referenced. This resolves the issues described in the background without any significant downsides.