Commit 83abe04
fix: stream-feeds-react-tutorial-related adjustments (#191)
🎫 Ticket: https://linear.app/stream/issue/REACT-690
### 💡 Overview
React tutorial sample application had troubles running on React v18 and
lower for seemingly unknown reasons and errors that kept popping up
weren't really telling anything useful either.
The issue was in the monorepo setup and Vite's inability to bundle only
one (specified) version of React into the final application's bundle.
While exploring different approaches and solutions I decided to clean
things up a bit and get rid of some annoying parts, here's the full list
of changes.
- adjusted tsconfig setup in the client, different files with different
purposes
- `tsconfig.lib.json` - for client types
- `tsconfig.test.json` - for test files (excluding the source files)
- `tsconfig.node.json` - for `vite.config.ts`
- removed @self alias imports as a part of the investigation (`tsc` does
not really resolve these when it's compiling declarations and that's why
I had to use `vite-plugin-dts` which is still in beta), they require
some extra setup and are generally not that useful
- Vite does not externalize imports with different entrypoints other
than `"."`, `@stream-io/state-store` is externalized while
`@stream-io/state-store/react-bindings` is treated like a separate
package and gets imported, added regular expressions to prevent subpaths
from being bundled
- ✨main course✨: upgraded Yarn to v4 to be able to use catalog protocol
and cataloged `react`/`react-dom` (types too) versions across the
monorepo to prevent Vite from bundling different React versions and
breaking the dev setup, published SDK works well with React >=v17
Fixes: REACT-690
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **New Features**
* Broadened React support to include v17 and made file/image upload
parameters optional for more flexible usage.
* **Build & Dependencies**
* Upgraded Yarn to 4.12.0 and updated workspace build/test scripts.
* Reworked TypeScript project layout and build configs for improved
library declaration output and Node builds.
* **Refactor**
* Internal module/type import and packaging config cleanup;
bundling/export settings adjusted for consistent outputs.
<sub>✏️ Tip: You can customize this high-level summary in your review
settings.</sub>
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---------
Co-authored-by: Zita Szupera <[email protected]>
Co-authored-by: Ivan Sekovanikj <[email protected]>1 parent dad0ac3 commit 83abe04
File tree
56 files changed
+7866
-10121
lines changed- .yarn
- plugins/@yarnpkg
- releases
- packages
- feeds-client
- src
- activity-with-state-updates
- bindings/react
- contexts
- hooks
- client-state-hooks
- feed-state-hooks
- search-state-hooks
- wrappers
- common/real-time
- feeds-client
- feed/event-handlers
- activity
- comment/utils
- utils/throttling
- react-native-sdk
- react-sdk
- sample-apps
- react-native/ExpoTikTokApp
- react-sample-app
- react-tutorial
- src
- pages
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
56 files changed
+7866
-10121
lines changedThis file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
1 | 7 | | |
2 | 8 | | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
3 | 13 | | |
4 | 14 | | |
5 | 15 | | |
6 | 16 | | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
| 17 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
14 | | - | |
| 13 | + | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
19 | | - | |
| 18 | + | |
| 19 | + | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
23 | | - | |
24 | | - | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
16 | | - | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
26 | | - | |
| 27 | + | |
27 | 28 | | |
28 | 29 | | |
29 | | - | |
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
34 | | - | |
| 33 | + | |
| 34 | + | |
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
59 | | - | |
| 59 | + | |
60 | 60 | | |
| 61 | + | |
61 | 62 | | |
62 | 63 | | |
63 | | - | |
64 | 64 | | |
65 | | - | |
66 | | - | |
67 | | - | |
| 65 | + | |
| 66 | + | |
68 | 67 | | |
69 | 68 | | |
70 | 69 | | |
71 | | - | |
| 70 | + | |
72 | 71 | | |
73 | 72 | | |
74 | 73 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
164 | 164 | | |
165 | 165 | | |
166 | 166 | | |
167 | | - | |
| 167 | + | |
168 | 168 | | |
169 | 169 | | |
170 | 170 | | |
| |||
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| |||
0 commit comments