Cannot call another worklet from worklet
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 35/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Estancado
- Stack tecnológico
- babel, react-native, typescript
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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",
- Lenguaje dominante
- C++
- Estrellas
- 792
- Forks
- 65
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de margelo/react-native-worklets-core
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
margelo/react-native-worklets-core#271 · 1 comentario ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
margelo/react-native-worklets-core#269 · 2 reacciones ·
-
Unable to download JS bundleAbierto
Dificultad 3/5 1-2 días Aptitud para principiantes 35/100
margelo/react-native-worklets-core#268 · 2 comentarios ·
-
Dificultad 3/5 1-2 días Aptitud para principiantes 72/100
margelo/react-native-worklets-core#267 · 1 comentario · 1 reacción ·
-
Dificultad 3/5 1-2 días Aptitud para principiantes 45/100
margelo/react-native-worklets-core#266 · 1 comentario · 2 reacciones ·
Todos los issues de margelo/react-native-worklets-core
Issues similares
-
bug
Dificultad 1/5 1-3 horas Aptitud para principiantes 88/100
isl-org/Open3D#7585 · 1 comentario ·
Los mantenedores suelen responder en 2 días
-
Unconfirmed bug
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
luanti-org/luanti#17605 · 1 comentario ·
Los mantenedores suelen responder en 2 días
-
area: config area: firmware priority: P2 - medium size: S type: bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Mizithra/ActiveTerrain#16 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
grumpycoders/pcsx-redux#2171 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
Los mantenedores suelen responder en 2 días