slackblock 2.0.0-beta.3 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +41 -59
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,67 +1,49 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
## 2.0.0
|
|
4
|
-
|
|
5
|
-
### Patch Changes
|
|
6
|
-
|
|
7
|
-
- fbb431b: Rendering updates to be more compatible
|
|
8
|
-
|
|
9
|
-
## 2.0.0-beta.2
|
|
10
|
-
|
|
11
|
-
### Patch Changes
|
|
12
|
-
|
|
13
|
-
- 787b509: Fix issue with any[] types
|
|
14
|
-
|
|
15
|
-
## 2.0.0-beta.1
|
|
16
|
-
|
|
17
|
-
### Patch Changes
|
|
18
|
-
|
|
19
|
-
- 2dc3b09: Fixes included files
|
|
20
|
-
|
|
21
|
-
## 2.0.0-beta.0
|
|
3
|
+
## 2.0.0
|
|
22
4
|
|
|
23
5
|
### Major Changes
|
|
24
6
|
|
|
25
|
-
- e243699:
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
-
|
|
39
|
-
-
|
|
40
|
-
- render(
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
-
|
|
48
|
-
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
-
|
|
59
|
-
-
|
|
60
|
-
-
|
|
61
|
-
-
|
|
62
|
-
-
|
|
63
|
-
-
|
|
64
|
-
- Changesets-based release automation with npm provenance
|
|
7
|
+
- e243699: ### Breaking Changes
|
|
8
|
+
- **React dependency removed** — change `"jsxImportSource": "react"` to `"jsxImportSource": "slackblock"` in your `tsconfig.json`. Remove `react` / `react-dom` from your dependencies. No JSX syntax changes required.
|
|
9
|
+
- **`@slack/web-api` runtime dependency removed** — Slack types are now bundled locally. No API surface changes; remove the package if it was only a transitive dependency.
|
|
10
|
+
- **Node.js >=20 required.**
|
|
11
|
+
- **`render()` validates by default** — output is checked against Slack Block Kit limits and a `console.warn` is emitted on violations. Pass `{ validate: 'off' }` to suppress all warnings.
|
|
12
|
+
|
|
13
|
+
### New API
|
|
14
|
+
|
|
15
|
+
**Render functions**
|
|
16
|
+
- `renderToBlocks(element, options?)` — returns `Block[]` directly. Use for modals and home tabs where no `<Message>` wrapper is needed; top-level Fragments are unwrapped automatically.
|
|
17
|
+
- `renderToMessage(element, options?)` — named alias for `render()`; both are equivalent.
|
|
18
|
+
|
|
19
|
+
**Typed `render()` overloads for Bolt**
|
|
20
|
+
- `render(el)` → `BoltCompatiblePayload` — for `say()` / `respond()`, no cast needed.
|
|
21
|
+
- `render(el, { channel })` → `SlackPostMessagePayload` — directly assignable to `client.chat.postMessage()`.
|
|
22
|
+
- `render(el, { channel, user })` → `SlackPostEphemeralPayload` — directly assignable to `client.chat.postEphemeral()`.
|
|
23
|
+
|
|
24
|
+
**Helpers**
|
|
25
|
+
- `blockKitBuilderUrl(blocks)` — generates a Block Kit Builder preview URL for a block array.
|
|
26
|
+
- `escapeMrkdwn(text)` — escapes Slack mrkdwn special characters in a plain-text string.
|
|
27
|
+
|
|
28
|
+
**Validation**
|
|
29
|
+
- `validate` option on all render functions: `'warn'` (default), `'strict'` (throws), `'off'` (silent).
|
|
30
|
+
- `SlackblockValidationError` — structured error class with `.path`, `.rule`, and `.message` fields.
|
|
31
|
+
|
|
32
|
+
**Exported types**
|
|
33
|
+
- `BoltCompatiblePayload`, `SlackPostMessagePayload`, `SlackPostEphemeralPayload`
|
|
34
|
+
- `SlackMessageDraft`, `SerializedBlock`, `SerializedElement`, `SerializedOption`
|
|
35
|
+
- `RenderOptions`, `ValidationMode`
|
|
36
|
+
|
|
37
|
+
### Other Improvements
|
|
38
|
+
- `strictNullChecks` enabled throughout; zero `any` types in source.
|
|
39
|
+
- All public components and render functions documented with JSDoc.
|
|
40
|
+
- Component reference at `docs/components.md`.
|
|
41
|
+
- Validation guide at `docs/validation.md`.
|
|
42
|
+
- Migration guides from jsx-slack and slack-block-builder at `docs/migrating-*.md`.
|
|
43
|
+
- Practical Bolt example app at `examples/bolt-app/`.
|
|
44
|
+
- 12 Block Kit JSON samples in `examples/block-kit/` covering all validatable components.
|
|
45
|
+
- Golden test suite with full pipeline coverage.
|
|
46
|
+
- Changesets-based release automation with npm provenance.
|
|
65
47
|
|
|
66
48
|
### 1.1.0
|
|
67
49
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "slackblock",
|
|
3
|
-
"version": "2.0.0
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "JSX-based Slack message renderer",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=20"
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
"homepage": "https://github.com/kolyaventuri/block#readme",
|
|
76
76
|
"devDependencies": {
|
|
77
77
|
"@changesets/cli": "^2.30.0",
|
|
78
|
-
"@types/node": "25.3.
|
|
78
|
+
"@types/node": "25.3.5",
|
|
79
79
|
"@typescript-eslint/eslint-plugin": "^8.56.1",
|
|
80
80
|
"@typescript-eslint/parser": "^8.56.1",
|
|
81
81
|
"@vitest/coverage-v8": "^4.0.18",
|