stable

Clone or download

Read-only

feat: fetch-result returns JSON payload of response

Part of story #26799 associate a Tuleap project and a GitLab group No functional change expected: putJSON and patchJSON are not yet used in the codebase. Notes: Given that our REST routes return a JSON payload most of the time, it makes sense to make it the default behaviour of the lib to try and parse it. Some methods (head, options and delete) don't do that and return a Response, either because there cannot be a payload (head, options) or because we usually never send one (delete). Additionally, I noticed that fetch-result was not tree-shaken. getAllJSON was included even when it wasn't used. This contribution changes that, it should now only be included when actually imported. This should slightly decrease the bundle size of apps that aren't using it (for example gitlab/linked-group goes from 52.04 KiB to 51.45 KiB). Change-Id: I2f92694842f6290d396fcf3ccd092084eb252e8b

Modified Files

Name
M lib/frontend/fetch-result/README.md +13 −5 Go to diff View file
M lib/frontend/fetch-result/src/ResultFetcher.test.ts +35 −28 Go to diff View file
M lib/frontend/fetch-result/src/ResultFetcher.ts +26 −22 Go to diff View file
M lib/frontend/fetch-result/src/main.ts +10 −7 Go to diff View file