You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(sdk): Add automatic polyfill for AbortSignal.timeout and improve docs
Address code review feedback:
- Add built-in polyfill for AbortSignal.timeout (Chrome 90+, Firefox 90+, Safari 15+)
- Replace AbortSignal.timeout calls with helper function for universal compatibility
- Update README to use CDN imports instead of direct node_modules paths
- Update documentation to reflect automatic polyfill
- Remove manual polyfill from browser example (now built-in)
- Improve browser compatibility from 103+ to 90+
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Copy file name to clipboardExpand all lines: examples/browser/README.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -75,18 +75,18 @@ The example shows how to:
75
75
- ✅ Create new records
76
76
- ✅ Count records with filters
77
77
- ✅ Handle errors and loading states
78
-
- ✅ Use polyfill for `AbortSignal.timeout` for older browsers
78
+
- ✅ Works in all modern browsers (polyfill built-in!)
79
79
80
80
## 🌐 Browser Compatibility
81
81
82
82
This example works in all modern browsers:
83
83
84
-
- Chrome 103+
85
-
- Firefox 100+
86
-
- Safari 16.4+
87
-
- Edge 103+
84
+
- Chrome 90+
85
+
- Firefox 90+
86
+
- Safari 15+
87
+
- Edge 90+
88
88
89
-
For older browsers, the example includes a polyfill for `AbortSignal.timeout`.
89
+
**Note:** The `@objectql/sdk` package automatically includes a polyfill for `AbortSignal.timeout()`, so it works seamlessly in older browsers without any additional configuration!
If you need to support older browsers, add a polyfill for `AbortSignal.timeout`:
303
+
The SDK **automatically includes a polyfill** for `AbortSignal.timeout()` that activates when running in older browsers. You don't need to add any polyfills manually - the SDK works universally out of the box!
300
304
301
-
```javascript
302
-
// Simple polyfill for AbortSignal.timeout
303
-
if (!AbortSignal.timeout) {
304
-
AbortSignal.timeout=function(ms) {
305
-
constcontroller=newAbortController();
306
-
setTimeout(() =>controller.abort(), ms);
307
-
returncontroller.signal;
308
-
};
309
-
}
310
-
```
311
-
312
-
Or use a timeout implementation without AbortSignal:
0 commit comments