Cannot call another worklet from worklet
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- babel, react-native, typescript
Hướng nghiên cứu
Reproduce the nested-worklet case with react-native-worklets-core 0.2.4 and react-native-reanimated 3.5.4, then compare it with the version where the worklet is hoisted. Inspect the Babel transformation and determine why an inlined worklet passed between contexts fails; done means the nested example runs correctly without requiring the workaround.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Calling an inlined worklet from an existing worklet breaks, presumably because of some mistake in the babel plugin.
This code breaks:
const context1 = Worklets.createContext('context1')
const context2 = Worklets.createContext('context2')
const runAsync = Worklets.createRunInContextFn((func: () => void) => {
'worklet'
try {
// Call long-running function
func()
} catch (e) {
// Re-throw error on JS Thread
throwJSError(e)
}
}, context2)
const runNormalWorklet = Worklets.createRunInContextFn(() => {
'worklet'
console.log('running from context1!')
runAsync(() => {
'worklet'
console.log('running from context2!')
})
}, context1)
runNormalWorklet()
But when we lift out the nested worklet function outside from the existing worklet, it works:
+ const fn = () => {
+ 'worklet'
+ console.log('running from context2')
+ }
const runNormalWorklet = Worklets.createRunInContextFn(() => {
'worklet'
console.log('running from context1!')
- runAsync(() => {
- 'worklet'
- console.log('running from context2!')
- })
+ runAsync(fn)
}, context1)
I'm guessing this is an incompatibility with the Reanimated plugin again.
"react-native-worklets-core": "0.2.4",
"react-native-reanimated": "^3.5.4",
- Ngôn ngữ chính
- C++
- Star
- 792
- Fork
- 65
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của margelo/react-native-worklets-core
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
margelo/react-native-worklets-core#271 · 1 bình luận ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
margelo/react-native-worklets-core#269 · 2 reaction ·
-
Unable to download JS bundleĐang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
margelo/react-native-worklets-core#268 · 2 bình luận ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 72/100
margelo/react-native-worklets-core#267 · 1 bình luận · 1 reaction ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
margelo/react-native-worklets-core#266 · 1 bình luận · 2 reaction ·
Tất cả issue của margelo/react-native-worklets-core
Issue tương tự
-
`enzymexla.linalg.lu` lowering fails for a tall matrix: the permutation is built with the pivot typeĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
EnzymeAD/Enzyme-JAX#3286 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
apache/iceberg-cpp#973 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Add c++23 mapping to nvccĐang mởfeature request
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 86/100
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
Maintainer thường phản hồi trong vòng 1 ngày