* fix: use an iframe to preserve head and body
* fix: remove unnecessary parsing of html
The contents gets inserted into the DOM during transformHtml, which
is always part of the build pipeline
* fix: pipe contents through iframe
* refactor: use the same code for both transforms
* fix: try to handle test errors better
Co-authored-by: moT01 <20648924+moT01@users.noreply.github.com>
* fix: replace index with script/styles as needed
* fix: remove redundant fileKey
It's overwritten by createPoly, so the parser does not need to create it
* fix: curriculum test suite
* Update client/src/templates/Challenges/classic/MultifileEditor.js
Co-authored-by: Shaun Hamilton <shauhami020@gmail.com>
Co-authored-by: Shaun Hamilton <shauhami020@gmail.com>
* fix: remove circular dependency
redux depended on templates/Challenges/redux and vice versa. This
meant that import order mattered and confusing bugs could arise.
(cherry picked from commit 7d67a4e70922bbb3051f2f9982dcc69e240d43dc)
* feat: require imports to be in alphabetical order
Import order generally does not matter, but there are edge cases
(circular imports and css imports, for example) where changing order
changes behaviour
(cherry picked from commit b8d1393a91ec6e068caf8e8498a5c95df68c2b2c)
* chore: order imports
* fix: lift up challenge description + title comps
This brings the classic Show closer to the others as they
now all create the description and title components
* fix: remove donation-saga/index circular import
(cherry picked from commit 51a44ca668a700786d2744feffeae4fdba5fd207)
* refactor: extract action-types from settings
(cherry picked from commit 25e26124d691c84a0d0827d41dafb761c686fadd)
* fix: lint errors
* feat: prevent useless renames
In rare cases, loadPresetReact could get into a race with itself. In
these cases the first call would set presetReact and the second call
would exit early as a result. This would mean babelOptionsJSX would be
undefined and the transformation would fail.
Prior to this, if a user first loaded a React challenge and then
navigated to a JS challenge, they would see
TypeError: Cannot read property 'presets' of undefined
in the console and be unable to run tests or evaluate code until they
reloaded the page.
The interview prep section includes many challenges that require long
running calculations which can be mistaken for infinite loops. This
removes the loop protection from those challenges, while the tests are
being evaluated.
It keeps the protection for the preview, since it is easy to create
broken code while working on a challenge and that should not crash the
site.
Code like `var xs = []; while(true){ xs.push(1) }` can quickly run the
browser out of memory causing it to crash. These changes stop user loops
from running indefinitely so that common mistakes will no longer cause
the browser to crash.
Also, the user is informed if a long running loop is detected (js and
jsx challenges) during preview or testing. Before this there was no
protection for js challenges and no information was given to the
user if they had created such a loop.
Co-Authored-By: Tom <20648924+moT01@users.noreply.github.com>
Co-Authored-By: mrugesh <1884376+raisedadead@users.noreply.github.com>
Co-Authored-By: Randell Dawson <5313213+RandellDawson@users.noreply.github.com>
Certain challenges involve code that is not run until the user
interacts with the preview (typically via a click listener). This uses
consoleProxy to report those errors.
Error logging has been simplified, reducing the number of places errors
can be reported from.
Some of the redux-saga code has been renamed in an attempt to improve
clarity.
* fix(client): add cache-busting hashes to chunks
* fix: create cache-busting names for the workers
Prior to this PR the first webpack compilation gave the workers static
names. This can cause caching problems, so this PR adds hashes to
their names to invalidate the cache.
In order for Gatsby to find them, the names are added to the
config directory.