These challenges have an "ok" quality of tests. It was somewhat challenging to develop robust tests, since the UI is being rendered through react-native-web which is effectively translating React Native UI primitives into DOM elements.
Allow the Workspace Console content to be scrollable.
Try/catch compileCodeString after investigating Sentry issues to find that Babel.transform could throw errors for invalid syntax which it cannot parse. I caught these errors and handled them as invalid syntax errors so the Workspace responds appropriately and the user is aware of what happened.
Discovered and fixed issue with logging in React challenges: #253... where two things were happening:
1) The test code was duplicating the React code and re-rendering the components using ReactDOM.render (this was sort of intentional, but resulted in un-mounting the original components which created the user preview which had the side-effect of invalidating whatever console calls existed there).
2) The Workspace was ignoring console messages from the iframe environment unless the tests were currently running (I don't think this is necessary now, and was left over from early Workspace development).
This PR:
react-native-web
which is effectively translating React Native UI primitives into DOM elements.Console
content to be scrollable.compileCodeString
after investigating Sentry issues to find thatBabel.transform
could throw errors for invalid syntax which it cannot parse. I caught these errors and handled them as invalid syntax errors so the Workspace responds appropriately and the user is aware of what happened.ReactDOM.render
(this was sort of intentional, but resulted in un-mounting the original components which created the user preview which had the side-effect of invalidating whateverconsole
calls existed there). 2) The Workspace was ignoring console messages from the iframe environment unless the tests were currently running (I don't think this is necessary now, and was left over from early Workspace development).Demo:
Todo: