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.
Files changed (2) hide show
  1. package/CHANGELOG.md +41 -59
  2. package/package.json +2 -2
package/CHANGELOG.md CHANGED
@@ -1,67 +1,49 @@
1
1
  # Changelog
2
2
 
3
- ## 2.0.0-beta.3
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
- React dependency removed — migrate jsxImportSource to "slackblock"
28
-
29
- In your tsconfig.json, change:
30
- "jsxImportSource": "react" → "jsxImportSource": "slackblock"
31
-
32
- Remove react / react-dom from your dependencies. No JSX syntax changes required.
33
-
34
- ***
35
-
36
- Breaking changes:
37
- - React peer dependency dropped; replaced with a zero-dependency custom JSX runtime
38
- - @slack/web-api runtime dependency removed; Slack types are now bundled locally
39
- - Node.js >=20 required (previously >=18 was tolerated in practice)
40
- - render() now defaults to validate: 'warn', emitting console warnings when output
41
- would violate Slack Block Kit limits (text too long, too many options, etc.).
42
- Pass { validate: 'off' } to suppress all warnings.
43
-
44
- New API:
45
- - renderToBlocks(element, options?) — returns Block[] directly; use for modals and
46
- home tabs where no <Message> wrapper is needed. Fragments are unwrapped transparently.
47
- - renderToMessage(element, options?) named alias for render(); both are equivalent.
48
- - blockKitBuilderUrl(blocks)generates a Block Kit Builder preview URL for a block array.
49
- - escapeMrkdwn(text) — escapes Slack mrkdwn special characters in plain text strings.
50
- - validate option on render() / renderToBlocks() / renderToMessage():
51
- 'warn' (default) console.warn on limit violations
52
- 'strict' throws SlackblockValidationError on any violation
53
- 'off' no validation
54
- - SlackblockValidationError — structured error with .path, .rule, and .message fields.
55
- - RenderOptions and ValidationMode types exported from package root.
56
-
57
- Other improvements:
58
- - strictNullChecks enabled; zero `any` types in source
59
- - All public components and render functions have JSDoc
60
- - Component reference at docs/components.md
61
- - Validation guide at docs/validation.md
62
- - Migration guides from jsx-slack and slack-block-builder at docs/migrating-\*.md
63
- - 12 Block Kit JSON samples in examples/block-kit/ covering all validatable components
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-beta.3",
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.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",