Skip to content

Commit

Permalink
chore: Backport much of #793
Browse files Browse the repository at this point in the history
Co-authored-by: Marvin Hagemeister <[email protected]>
  • Loading branch information
rschristian and marvinhagemeister committed Feb 5, 2024
1 parent 1b131bb commit 089b99e
Show file tree
Hide file tree
Showing 64 changed files with 1,671 additions and 1,289 deletions.
2 changes: 1 addition & 1 deletion content/en/tutorial/01-vdom.md
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ useResult(function(result) {
var p = result.output.querySelector('p');
var hasColor = p && p.style && p.style.color === 'purple';
if (hasEm && hasColor) {
store.setState({ solved: true });
solutionCtx.setSolved(true);
}
}, []);
```
Expand Down
2 changes: 1 addition & 1 deletion content/en/tutorial/02-events.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ useRealm(function (realm) {
var win = realm.globalThis;
var prevConsoleLog = win.console.log;
win.console.log = function() {
store.setState({ solved: true });
solutionCtx.setSolved(true);
return prevConsoleLog.apply(win.console, arguments);
};
Expand Down
2 changes: 1 addition & 1 deletion content/en/tutorial/03-components.md
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ useRealm(function (realm) {
win.console.log = function() {
if (hasComponent && check) {
store.setState({ solved: true });
solutionCtx.setSolved(true);
}
return prevConsoleLog.apply(win.console, arguments);
};
Expand Down
2 changes: 1 addition & 1 deletion content/en/tutorial/04-state.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ useResult(function () {
}
if (Number(text2[1]) === Number(text[1]) + 1) {
store.setState({ solved: true });
solutionCtx.setSolved(true);
}
}, 10);
}
Expand Down
2 changes: 1 addition & 1 deletion content/en/tutorial/05-refs.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ function patch(input) {
input.__patched = true;
var old = input.focus;
input.focus = function() {
store.setState({ solved: true });
solutionCtx.setSolved(true);
return old.call(this);
};
}
Expand Down
2 changes: 1 addition & 1 deletion content/en/tutorial/07-side-effects.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ useRealm(function (realm) {
var prevConsoleLog = win.console.log;
win.console.log = function(m, s) {
if (/Count is now/.test(m) && s === 1) {
store.setState({ solved: true });
solutionCtx.setSolved(true);
}
return prevConsoleLog.apply(win.console, arguments);
};
Expand Down
2 changes: 1 addition & 1 deletion content/en/tutorial/08-keys.md
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ useRealm(function (realm) {
/learn preact/i.test(c[0].textContent) &&
/make an awesome app/i.test(c[1].textContent)
) {
store.setState({ solved: true });
solutionCtx.setSolved(true);
}
}
Expand Down
2 changes: 1 addition & 1 deletion content/en/tutorial/09-error-handling.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ useResult(function(result) {
oe.apply(this, arguments);
setTimeout(function() {
if (result.output.textContent.match(/error/i)) {
store.setState({ solved: true });
solutionCtx.setSolved(true);
}
}, 10);
};
Expand Down
2 changes: 1 addition & 1 deletion content/kr/tutorial/01-vdom.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ useResult(function(result) {
var p = result.output.querySelector('p');
var hasColor = p && p.style && p.style.color === 'purple';
if (hasEm && hasColor) {
store.setState({ solved: true });
solutionCtx.setSolved(true);
}
}, []);
```
Expand Down
2 changes: 1 addition & 1 deletion content/kr/tutorial/02-events.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ useRealm(function (realm) {
var win = realm.globalThis;
var prevConsoleLog = win.console.log;
win.console.log = function() {
store.setState({ solved: true });
solutionCtx.setSolved(true);
return prevConsoleLog.apply(win.console, arguments);
};
Expand Down
2 changes: 1 addition & 1 deletion content/ru/tutorial/01-vdom.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ useResult(function(result) {
var p = result.output.querySelector('p');
var hasColor = p && p.style && p.style.color === 'purple';
if (hasEm && hasColor) {
store.setState({ solved: true });
solutionCtx.setSolved(true);
}
}, []);
```
Expand Down
2 changes: 1 addition & 1 deletion content/ru/tutorial/02-events.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ useRealm(function (realm) {
var win = realm.globalThis;
var prevConsoleLog = win.console.log;
win.console.log = function() {
store.setState({ solved: true });
solutionCtx.setSolved(true);
return prevConsoleLog.apply(win.console, arguments);
};
Expand Down
2 changes: 1 addition & 1 deletion content/ru/tutorial/03-components.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ useRealm(function (realm) {
win.console.log = function() {
if (hasComponent && check) {
store.setState({ solved: true });
solutionCtx.setSolved(true);
}
return prevConsoleLog.apply(win.console, arguments);
};
Expand Down
2 changes: 1 addition & 1 deletion content/ru/tutorial/04-state.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ useResult(function () {
}
if (Number(text2[1]) === Number(text[1]) + 1) {
store.setState({ solved: true });
solutionCtx.setSolved(true);
}
}, 10);
}
Expand Down
2 changes: 1 addition & 1 deletion content/ru/tutorial/05-refs.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ function patch(input) {
input.__patched = true;
var old = input.focus;
input.focus = function() {
store.setState({ solved: true });
solutionCtx.setSolved(true);
return old.call(this);
};
}
Expand Down
2 changes: 1 addition & 1 deletion content/ru/tutorial/07-side-effects.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ useRealm(function (realm) {
var prevConsoleLog = win.console.log;
win.console.log = function(m, s) {
if (/Счётчик: /.test(m) && s === 1) {
store.setState({ solved: true });
solutionCtx.setSolved(true);
}
return prevConsoleLog.apply(win.console, arguments);
};
Expand Down
2 changes: 1 addition & 1 deletion content/ru/tutorial/08-keys.md
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ useRealm(function (realm) {
/изучить preact/i.test(c[0].textContent) &&
/сделать крутое приложение/i.test(c[1].textContent)
) {
store.setState({ solved: true });
solutionCtx.setSolved(true);
}
}
Expand Down
2 changes: 1 addition & 1 deletion content/ru/tutorial/09-error-handling.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ useResult(function(result) {
oe.apply(this, arguments);
setTimeout(function() {
if (result.output.textContent.match(/ошибка/i)) {
store.setState({ solved: true });
solutionCtx.setSolved(true);
}
}, 10);
};
Expand Down
2 changes: 1 addition & 1 deletion content/zh/tutorial/01-vdom.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ useResult(function(result) {
var p = result.output.querySelector('p');
var hasColor = p && p.style && p.style.color === 'purple';
if (hasEm && hasColor) {
store.setState({ solved: true });
solutionCtx.setSolved(true);
}
}, []);
```
Expand Down
2 changes: 1 addition & 1 deletion content/zh/tutorial/02-events.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ useRealm(function (realm) {
var win = realm.globalThis;
var prevConsoleLog = win.console.log;
win.console.log = function() {
store.setState({ solved: true });
solutionCtx.setSolved(true);
return prevConsoleLog.apply(win.console, arguments);
};
Expand Down
4 changes: 2 additions & 2 deletions jsconfig.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"compilerOptions": {
"target": "ESNext",
"module": "NodeNext",
"moduleResolution": "NodeNext",
"module": "ESNext",
"moduleResolution": "Node",
"resolveJsonModule": true,
"jsx": "react-jsx",
"jsxImportSource": "preact",
Expand Down
Loading

0 comments on commit 089b99e

Please sign in to comment.