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 e786c70 commit f5e37a2
Show file tree
Hide file tree
Showing 67 changed files with 2,749 additions and 2,150 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 @@ -195,7 +195,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 @@ -60,7 +60,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 @@ -253,7 +253,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 @@ -160,7 +160,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 @@ -132,7 +132,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 @@ -137,7 +137,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 @@ -306,7 +306,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 @@ -97,7 +97,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 @@ -144,7 +144,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 @@ -53,7 +53,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 @@ -151,7 +151,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 @@ -47,7 +47,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 @@ -187,7 +187,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 @@ -112,7 +112,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 @@ -102,7 +102,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 @@ -112,7 +112,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 @@ -239,7 +239,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 @@ -72,7 +72,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 @@ -160,7 +160,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 @@ -47,7 +47,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 f5e37a2

Please sign in to comment.