Skip to content

Commit 4b4dc74

Browse files
committed
update to solid 0.19.0
1 parent e72b06b commit 4b4dc74

8 files changed

Lines changed: 391 additions & 334 deletions

File tree

package-lock.json

Lines changed: 376 additions & 319 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,19 +25,19 @@
2525
"homepage": "https://github.com/ryansolid/solid-realworld#readme",
2626
"dependencies": {
2727
"marked": "^0.8.0",
28-
"solid-js": "0.18.12"
28+
"solid-js": "0.19.0"
2929
},
3030
"devDependencies": {
31-
"@babel/core": "7.10.3",
32-
"@babel/plugin-proposal-optional-chaining": "7.10.3",
31+
"@babel/core": "7.11.4",
32+
"@babel/plugin-proposal-optional-chaining": "7.11.0",
3333
"@babel/plugin-syntax-dynamic-import": "7.8.3",
34-
"@rollup/plugin-commonjs": "13.0.0",
34+
"@rollup/plugin-commonjs": "15.0.0",
3535
"@rollup/plugin-node-resolve": "8.1.0",
36-
"babel-preset-solid": "0.18.12",
37-
"rollup": "2.18.1",
38-
"rollup-plugin-babel": "4.4.0",
36+
"babel-preset-solid": "0.19.0",
37+
"rollup": "2.26.5",
38+
"@rollup/plugin-babel": "5.2.0",
3939
"rollup-plugin-delete": "^2.0.0",
40-
"rollup-plugin-terser": "^6.1.0",
40+
"rollup-plugin-terser": "^7.0.0",
4141
"serve": "^11.3.2"
4242
}
4343
}

rollup.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import resolve from "@rollup/plugin-node-resolve";
22
import commonjs from "@rollup/plugin-commonjs";
3-
import babel from "rollup-plugin-babel";
3+
import babel from "@rollup/plugin-babel";
44
import del from "rollup-plugin-delete";
55
import { terser } from "rollup-plugin-terser";
66

src/store/createArticles.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export default function createArticles(agent, store, loadState, setState, loadAr
66
...actions,
77
setPage: page => setState({ page }),
88
loadArticles(predicate) {
9-
const articles = $req(predicate).then(({ articles, articlesCount }) => {
9+
const articles = () => $req(predicate).then(({ articles, articlesCount }) => {
1010
setState({ totalPagesCount: Math.ceil(articlesCount / LIMIT) });
1111
return articles.reduce((memo, article) => {
1212
memo[article.slug] = article;
@@ -20,7 +20,7 @@ export default function createArticles(agent, store, loadState, setState, loadAr
2020
const article = state.articles[slug];
2121
if (article) return article;
2222
}
23-
loadArticle({ [slug]: agent.Articles.get(slug) });
23+
loadArticle({ [slug]: () => agent.Articles.get(slug) });
2424
},
2525
async makeFavorite(slug) {
2626
const article = state.articles[slug];

src/store/createAuth.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export default function createAuth(agent, store, loadState, setState) {
1919
},
2020
pullUser() {
2121
let p;
22-
loadState({ currentUser: (p = agent.Auth.current()) });
22+
loadState({ currentUser: () => (p = agent.Auth.current()) });
2323
return p;
2424
},
2525
async updateUser(newUser) {

src/store/createComments.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export default function createComments(agent, store, loadState, setState) {
88
if (state.articleSlug !== articleSlug) {
99
setState({ articleSlug });
1010
}
11-
loadState({ comments: agent.Comments.forArticle(articleSlug) });
11+
loadState({ comments: () => agent.Comments.forArticle(articleSlug) });
1212
},
1313
async createComment(comment) {
1414
const { errors } = await agent.Comments.create(state.articleSlug, comment);

src/store/createCommon.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { createEffect } from "solid-js";
33
export default function createCommon(agent, store, loadState, setState) {
44
const [state, actions] = store;
55
loadState({
6-
tags: agent.Tags.getAll().then(tags => tags.map(t => t.toLowerCase()))
6+
tags: () => agent.Tags.getAll().then(tags => tags.map(t => t.toLowerCase()))
77
});
88
createEffect(() => {
99
state.token ? localStorage.setItem("jwt", state.token) : localStorage.removeItem("jwt");

src/store/createProfile.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ export default function createProfile(agent, store, loadState, setState) {
33
store[1] = {
44
...actions,
55
loadProfile(username) {
6-
loadState({ profile: agent.Profile.get(username) });
6+
loadState({ profile: () => agent.Profile.get(username) });
77
},
88
async follow() {
99
if (state.profile && !state.profile.following) {

0 commit comments

Comments
 (0)