Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

All notable changes to this project will be documented in this file.

## [Unreleased]
## [1.4.0]

Release as **1.4.0**, not a patch: `flush()` and `close()` now resolve with `{ unsent }`
Minor version, not a patch: `flush()` and `close()` now resolve with `{ unsent }`
instead of `void` (see Changed).

### Fixed
Expand All @@ -20,7 +20,7 @@ instead of `void` (see Changed).
- **`flush()` had no time bound** and could wait through every retry of every event. It now
waits at most `flushTimeout` (new, default 30 s).
- **`import Datalyr from '@datalyr/api'` threw "Datalyr is not a constructor" in Node ESM.** With no `exports` map, Node loaded the CommonJS build for `import`, so the default import was the whole module object. An `exports` map now sends `import` to `dist/index.mjs` (types `dist/index.d.mts`) and `require` to `dist/index.js` (types `dist/index.d.ts`). `main`, `module` and `types` are unchanged, and deep imports under `dist/` still work.
- **Release as a minor version (1.4.0).** Two narrow cases change: an ESM workaround for the old bug (`new Datalyr.default()`, `Datalyr.Datalyr`, `(await import('@datalyr/api')).default.default`) no longer works, because the default import is now the class; use `import Datalyr from '@datalyr/api'` or `import { Datalyr } from '@datalyr/api'`. A deep import without a file extension (`@datalyr/api/dist/index`) no longer resolves; add `.js` or `.mjs`.
- **Minor version.** Two narrow cases change: an ESM workaround for the old bug (`new Datalyr.default()`, `Datalyr.Datalyr`, `(await import('@datalyr/api')).default.default`) no longer works, because the default import is now the class; use `import Datalyr from '@datalyr/api'` or `import { Datalyr } from '@datalyr/api'`. A deep import without a file extension (`@datalyr/api/dist/index`) no longer resolves; add `.js` or `.mjs`.

### Changed
- **Breaking for typed code:** `flush()` and `close()` return `Promise<FlushResult>`
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@datalyr/api",
"version": "1.3.4",
"version": "1.4.0",
"description": "DATALYR Node SDK for server-side event, identity and revenue tracking",
"main": "dist/index.js",
"module": "dist/index.mjs",
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ function generateAnonymousId(): string {
return 'anon_' + randomUUID();
}

const SDK_VERSION = '1.3.4'; // keep in sync with package.json
const SDK_VERSION = '1.4.0'; // keep in sync with package.json

// Hard cap on drain passes per flush (a producer that keeps enqueuing during a drain must
// not keep one flush running forever).
Expand Down