Skip to content

Latest commit

 

History

History
77 lines (50 loc) · 1.41 KB

MIGRATION.md

File metadata and controls

77 lines (50 loc) · 1.41 KB

Migration Guide

Upgrade to v2

In v2 axios and supertest has moved to peerDependencies. If you are using one of these requests see the next instructions:

supertest

install supertest package:

    npm i -D supertest

axios

install axios package:

    npm i -D axios
  1. if you've used default axios export:
    import { axios } from 'rest-chronicle';

    const response = await axios({
        method : 'GET',
        url    : `https://example.com/users`,
        with   : { title: 'List of Users', group: 'Users' }
    });

use constructor instead:

    import { Axios } from 'rest-chronicle';
    const axios = new Axios();

    const response = await axios({
        method : 'GET',
        url    : `https://example.com/users`,
        with   : { title: 'List of Users', group: 'Users' }
    });
  1. if you've used Axios class without chronicle:
import { Axios } from 'rest-chronicle';

const axios = new Axios();

use explicit null instead:

import { Axios } from 'rest-chronicle';

const axios = new Axios(null);
  1. if you've used Axios class with explicit chronicle:
import chronicle, { Axios } from 'rest-chronicle';

const axios = new Axios(chronicle);

keep using, without additional interventions

Changelog

See detailed Changelog for a list of changes.