Skip to content
This repository was archived by the owner on Oct 31, 2024. It is now read-only.

Commit c5369a2

Browse files
committed
docs: Updates changelog for release + faq
1 parent 2f1028d commit c5369a2

File tree

2 files changed

+49
-2
lines changed

2 files changed

+49
-2
lines changed

CHANGELOG.md

+48-2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,44 @@ All notable changes to this project will be documented in this file. This projec
44

55
## [Unreleased]
66

7+
### Breaking Changes
8+
9+
### Added
10+
11+
### Fixed
12+
13+
### Changed
14+
15+
### Removed
16+
17+
## [0.2.0] - 2023-05-02
18+
19+
### Breaking Changes
20+
21+
##### `fetch` is now a standard fetch function, and no longer an object requiring `Request`, `Response`, and `Headers`
22+
23+
When providing a custom `fetch()` function, it's no longer required to also pass the other elements such as `Request`, `Response` and `Headers`. This increases the number of libraries you can use with fetch.
24+
25+
```ts
26+
// OLD
27+
const c = new MongoClient({
28+
endpoint: BASE_URL,
29+
dataSource: "test-datasource",
30+
auth: { apiKey: "validApiKey" },
31+
fetch: {
32+
// fetch interface
33+
},
34+
});
35+
36+
// NEW
37+
const c = new MongoClient({
38+
endpoint: BASE_URL,
39+
dataSource: "test-datasource",
40+
auth: { apiKey: "validApiKey" },
41+
fetch: ponyfillFetch, // "as typeof fetch" may be required for some fetch libraries
42+
});
43+
```
44+
745
### Added
846

947
- Created a `CHANGELOG.md` for changelog tracking
@@ -36,7 +74,15 @@ Older releases are available via github releases: https://github.com/taskless/mo
3674
<!-- Releases -->
3775

3876
[unreleased]: https://github.com/taskless/mongo-data-api/compare/0.1.2...HEAD
77+
[0.2.0]: https://github.com/taskless/mongo-data-api/compare/0.1.2...0.2.0
78+
[0.1.2]: https://github.com/taskless/mongo-data-api/compare/320744af834ca94e450e2a129283e5c7500b763d...0.1.2
3979

40-
<!-- Past Releases -->
80+
<!--
81+
Template:
4182
42-
[0.1.2]: https://github.com/taskless/mongo-data-api/compare/320744af834ca94e450e2a129283e5c7500b763d...0.1.2
83+
### Breaking Changes
84+
### Added
85+
### Fixed
86+
### Changed
87+
### Removed
88+
-->

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,7 @@ Requests via `fetch()` have their resposne codes checked against the [Data API E
301301
# FAQ
302302

303303
- **Why is `mongodb` in the dependencies?** The short answer is [TypeScript requires it](https://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html#dependencies). The mongodb dependency is types-only and will not be included in your built lambda when using `tsc`, `rollup`, `webpack`, and other bundling tools. Unfortunately, to re-export the types, it must be included as a regular dependency instead of dev-dependency. You can verify that mongo is not included by looking at the [CommonJS build](https://www.npmjs.com/package/@taskless/mongo-data-api?activeTab=code).
304+
- **Why is `node-fetch`'s `fetch` not of the correct type?** The short answer is that `node-fetch`'s `fetch` isn't a true `fetch`. To work around this, you can either use [`cross-fetch`](https://github.com/lquixada/cross-fetch) which types the `fetch` API through a type assertion, or [perform the type assertion yourself](https://github.com/lquixada/cross-fetch/blob/main/index.d.ts): `fetch: _fetch as typeof fetch`. It's not ideal, but with proper `fetch` coming to node.js, it's a small inconvienence in the short term.
304305

305306
# License
306307

0 commit comments

Comments
 (0)