From 8f9342c0949e2ed08600166f04f128ac4c856aad Mon Sep 17 00:00:00 2001 From: Serhii Aleksandrov Date: Thu, 24 Oct 2024 21:06:57 +0200 Subject: [PATCH] feat: refactoring, fixed ts, update rockpack --- CHANGELOG.md | 14 + .../1-simple-without-backend/package.json | 2 +- examples/10-redux-sagas/package.json | 8 +- examples/11-redux-thunk/package.json | 6 +- examples/12-apollo-graphql/package.json | 5 +- examples/13-dom-manipulations/package.json | 2 +- .../14-nested-data-redux-graphql/package.json | 9 +- examples/15-nested-async-effect/package.json | 2 +- examples/16-mobx/package.json | 2 +- examples/19-react-18/package.json | 2 +- examples/2-simple-express/package.json | 2 +- .../package.json | 2 +- examples/3-simple-koa/package.json | 2 +- examples/4-koa-react-router/package.json | 2 +- .../build.js | 0 .../package.json | 6 +- .../rockpack.babel.js | 0 .../src/App.jsx | 0 .../src/assets/favicon.ico | Bin .../src/client.jsx | 0 .../src/server.jsx | 0 examples/5-meta-tags/src/App.jsx | 49 - examples/5-meta-tags/src/client.jsx | 16 - examples/5-meta-tags/src/server.jsx | 58 - examples/5.1-meta-tags-helmet/build.js | 16 - examples/5.1-meta-tags-helmet/package.json | 25 - .../5.1-meta-tags-helmet/rockpack.babel.js | 5 - .../src/assets/favicon.ico | Bin 15406 -> 0 bytes .../6-css-modules-other-styles/package.json | 3 +- .../6-css-modules-other-styles/src/App.jsx | 5 - .../6-css-modules-other-styles/src/server.jsx | 13 +- examples/7-loadable-components/package.json | 3 +- examples/8-error-handling/package.json | 2 +- examples/9-live-reload/package.json | 2 +- package.json | 3 +- packages/babel-plugin/.eslintignore | 32 - packages/babel-plugin/.prettierrc | 9 + .../{.eslintrc.js => eslint.config.js} | 4 +- packages/babel-plugin/index.js | 7 +- packages/babel-plugin/package.json | 10 +- packages/core/.eslintignore | 39 - packages/core/.eslintrc.js | 13 - packages/core/.prettierrc | 9 + packages/core/build.js | 32 +- packages/core/eslint.config.js | 5 + packages/core/jest.setup.js | 7 - packages/core/package.json | 27 +- packages/core/src/effect-collection.ts | 14 +- packages/core/src/effect.ts | 34 +- packages/core/src/hooks.spec.tsx | 41 +- packages/core/src/hooks.ts | 51 +- packages/core/src/i-ssr.tsx | 26 +- packages/core/src/index.ts | 6 +- packages/core/src/server.spec.tsx | 25 +- packages/core/src/server.tsx | 12 +- packages/core/src/utils.spec.ts | 2 +- packages/core/src/utils.ts | 4 +- .../package.json | 2 +- .../package.json | 2 +- yarn.lock | 20742 ---------------- 60 files changed, 221 insertions(+), 21200 deletions(-) create mode 100644 CHANGELOG.md rename examples/{5-meta-tags => 5-meta-tags-helmet}/build.js (100%) rename examples/{5-meta-tags => 5-meta-tags-helmet}/package.json (83%) rename examples/{5-meta-tags => 5-meta-tags-helmet}/rockpack.babel.js (100%) rename examples/{5.1-meta-tags-helmet => 5-meta-tags-helmet}/src/App.jsx (100%) rename examples/{5-meta-tags => 5-meta-tags-helmet}/src/assets/favicon.ico (100%) rename examples/{5.1-meta-tags-helmet => 5-meta-tags-helmet}/src/client.jsx (100%) rename examples/{5.1-meta-tags-helmet => 5-meta-tags-helmet}/src/server.jsx (100%) delete mode 100644 examples/5-meta-tags/src/App.jsx delete mode 100644 examples/5-meta-tags/src/client.jsx delete mode 100644 examples/5-meta-tags/src/server.jsx delete mode 100644 examples/5.1-meta-tags-helmet/build.js delete mode 100644 examples/5.1-meta-tags-helmet/package.json delete mode 100644 examples/5.1-meta-tags-helmet/rockpack.babel.js delete mode 100644 examples/5.1-meta-tags-helmet/src/assets/favicon.ico delete mode 100644 packages/babel-plugin/.eslintignore create mode 100644 packages/babel-plugin/.prettierrc rename packages/babel-plugin/{.eslintrc.js => eslint.config.js} (50%) delete mode 100644 packages/core/.eslintignore delete mode 100644 packages/core/.eslintrc.js create mode 100644 packages/core/.prettierrc create mode 100644 packages/core/eslint.config.js delete mode 100644 yarn.lock diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..fc379a7 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,14 @@ +# Changelog + +## [2.3.0] + +- Refactoring +- Fixed a few typescript issues +- Updated styleguide and build system +- Dropped old examples + +## [2.0.0] + +- React 18 support +- The new approach to handle asynchronous actions +- A few fixes diff --git a/examples/1-simple-without-backend/package.json b/examples/1-simple-without-backend/package.json index 3c11dd3..05caee9 100644 --- a/examples/1-simple-without-backend/package.json +++ b/examples/1-simple-without-backend/package.json @@ -13,6 +13,6 @@ }, "devDependencies": { "@types/lodash": "^4.14.149", - "@rockpack/compiler": "3.0.0-next.2" + "@rockpack/compiler": "4.5.2" } } diff --git a/examples/10-redux-sagas/package.json b/examples/10-redux-sagas/package.json index edd0685..45aad19 100644 --- a/examples/10-redux-sagas/package.json +++ b/examples/10-redux-sagas/package.json @@ -15,14 +15,14 @@ "koa-static": "5.0.0", "react": "17.0.2", "react-dom": "17.0.2", - "react-redux": "7.1.1", - "redux": "4.0.4", + "react-redux": "8.1.3", + "redux": "4.2.1", "redux-logger": "3.0.6", - "redux-saga": "1.1.1", + "redux-saga": "1.3.0", "serialize-javascript": "3.0.0" }, "devDependencies": { "@issr/babel-plugin": "2.0.0", - "@rockpack/compiler": "3.0.0-next.2" + "@rockpack/compiler": "4.5.2" } } diff --git a/examples/11-redux-thunk/package.json b/examples/11-redux-thunk/package.json index 989791c..21fb297 100644 --- a/examples/11-redux-thunk/package.json +++ b/examples/11-redux-thunk/package.json @@ -15,14 +15,14 @@ "koa-static": "5.0.0", "react": "17.0.2", "react-dom": "17.0.2", - "react-redux": "7.1.1", - "redux": "4.0.4", + "react-redux": "8.1.3", + "redux": "4.2.1", "redux-logger": "3.0.6", "redux-thunk": "2.3.0", "serialize-javascript": "3.0.0" }, "devDependencies": { "@issr/babel-plugin": "2.0.0", - "@rockpack/compiler": "3.0.0-next.2" + "@rockpack/compiler": "4.5.2" } } diff --git a/examples/12-apollo-graphql/package.json b/examples/12-apollo-graphql/package.json index 4cbce4e..2fc0f27 100644 --- a/examples/12-apollo-graphql/package.json +++ b/examples/12-apollo-graphql/package.json @@ -6,7 +6,7 @@ "build": "cross-env NODE_ENV=production node build" }, "dependencies": { - "@apollo/react-hooks": "3.1.5", + "@apollo/client": "^3.11.8", "@issr/core": "2.0.0", "apollo-cache-inmemory": "1.6.5", "apollo-client": "2.6.8", @@ -17,12 +17,11 @@ "koa-static": "5.0.0", "node-fetch": "2.6.0", "react": "17.0.2", - "react-apollo": "3.1.5", "react-dom": "17.0.2", "serialize-javascript": "3.0.0" }, "devDependencies": { "@issr/babel-plugin": "2.0.0", - "@rockpack/compiler": "3.0.0-next.2" + "@rockpack/compiler": "4.5.2" } } diff --git a/examples/13-dom-manipulations/package.json b/examples/13-dom-manipulations/package.json index f46bc20..fb11ec0 100644 --- a/examples/13-dom-manipulations/package.json +++ b/examples/13-dom-manipulations/package.json @@ -17,6 +17,6 @@ }, "devDependencies": { "@issr/babel-plugin": "2.0.0", - "@rockpack/compiler": "3.0.0-next.2" + "@rockpack/compiler": "4.5.2" } } diff --git a/examples/14-nested-data-redux-graphql/package.json b/examples/14-nested-data-redux-graphql/package.json index ea90538..ab77ba4 100644 --- a/examples/14-nested-data-redux-graphql/package.json +++ b/examples/14-nested-data-redux-graphql/package.json @@ -6,7 +6,7 @@ "build": "cross-env NODE_ENV=production node build" }, "dependencies": { - "@apollo/react-hooks": "3.1.5", + "@apollo/client": "^3.11.8", "@issr/core": "2.0.0", "@reduxjs/toolkit": "1.1.0", "apollo-cache-inmemory": "1.6.5", @@ -19,16 +19,15 @@ "koa-static": "5.0.0", "node-fetch": "2.6.0", "react": "17.0.2", - "react-apollo": "3.1.5", "react-dom": "17.0.2", - "react-redux": "7.1.1", - "redux": "4.0.4", + "react-redux": "8.1.3", + "redux": "4.2.1", "redux-logger": "3.0.6", "redux-saga": "1.1.1", "serialize-javascript": "3.0.0" }, "devDependencies": { "@issr/babel-plugin": "2.0.0", - "@rockpack/compiler": "3.0.0-next.2" + "@rockpack/compiler": "4.5.2" } } diff --git a/examples/15-nested-async-effect/package.json b/examples/15-nested-async-effect/package.json index 20a8db2..af17369 100644 --- a/examples/15-nested-async-effect/package.json +++ b/examples/15-nested-async-effect/package.json @@ -16,6 +16,6 @@ }, "devDependencies": { "@issr/babel-plugin": "2.0.0", - "@rockpack/compiler": "3.0.0-next.2" + "@rockpack/compiler": "4.5.2" } } diff --git a/examples/16-mobx/package.json b/examples/16-mobx/package.json index 7179ba2..c915acd 100644 --- a/examples/16-mobx/package.json +++ b/examples/16-mobx/package.json @@ -18,6 +18,6 @@ }, "devDependencies": { "@issr/babel-plugin": "2.0.0", - "@rockpack/compiler": "3.0.0-next.2" + "@rockpack/compiler": "4.5.2" } } diff --git a/examples/19-react-18/package.json b/examples/19-react-18/package.json index 884e6ab..5135d4b 100644 --- a/examples/19-react-18/package.json +++ b/examples/19-react-18/package.json @@ -17,6 +17,6 @@ }, "devDependencies": { "@issr/babel-plugin": "2.0.0", - "@rockpack/compiler": "3.0.0-next.2" + "@rockpack/compiler": "4.5.2" } } diff --git a/examples/2-simple-express/package.json b/examples/2-simple-express/package.json index 94ffebb..75f500a 100644 --- a/examples/2-simple-express/package.json +++ b/examples/2-simple-express/package.json @@ -14,6 +14,6 @@ }, "devDependencies": { "@issr/babel-plugin": "2.0.0", - "@rockpack/compiler": "3.0.0-next.2" + "@rockpack/compiler": "4.5.2" } } diff --git a/examples/2.1-simple-express-only-client/package.json b/examples/2.1-simple-express-only-client/package.json index be35ca4..628d489 100644 --- a/examples/2.1-simple-express-only-client/package.json +++ b/examples/2.1-simple-express-only-client/package.json @@ -15,6 +15,6 @@ }, "devDependencies": { "@issr/babel-plugin": "2.0.0", - "@rockpack/compiler": "3.0.0-next.2" + "@rockpack/compiler": "4.5.2" } } diff --git a/examples/3-simple-koa/package.json b/examples/3-simple-koa/package.json index 659afb9..65b4d4d 100644 --- a/examples/3-simple-koa/package.json +++ b/examples/3-simple-koa/package.json @@ -16,6 +16,6 @@ }, "devDependencies": { "@issr/babel-plugin": "2.0.0", - "@rockpack/compiler": "3.0.0-next.2" + "@rockpack/compiler": "4.5.2" } } diff --git a/examples/4-koa-react-router/package.json b/examples/4-koa-react-router/package.json index c3f0044..e66c20c 100644 --- a/examples/4-koa-react-router/package.json +++ b/examples/4-koa-react-router/package.json @@ -19,6 +19,6 @@ }, "devDependencies": { "@issr/babel-plugin": "2.0.0", - "@rockpack/compiler": "3.0.0-next.2" + "@rockpack/compiler": "4.5.2" } } diff --git a/examples/5-meta-tags/build.js b/examples/5-meta-tags-helmet/build.js similarity index 100% rename from examples/5-meta-tags/build.js rename to examples/5-meta-tags-helmet/build.js diff --git a/examples/5-meta-tags/package.json b/examples/5-meta-tags-helmet/package.json similarity index 83% rename from examples/5-meta-tags/package.json rename to examples/5-meta-tags-helmet/package.json index ed4ce14..51edec3 100644 --- a/examples/5-meta-tags/package.json +++ b/examples/5-meta-tags-helmet/package.json @@ -1,5 +1,5 @@ { - "name": "@issr/example-5", + "name": "@issr/example-5.1", "version": "1.0.0", "scripts": { "start": "cross-env NODE_ENV=development node build", @@ -13,13 +13,13 @@ "koa-static": "5.0.0", "react": "17.0.2", "react-dom": "17.0.2", - "react-meta-tags": "0.7.4", + "react-helmet-async": "2.0.5", "react-router": "5.1.2", "react-router-dom": "5.1.2", "serialize-javascript": "3.0.0" }, "devDependencies": { "@issr/babel-plugin": "2.0.0", - "@rockpack/compiler": "3.0.0-next.2" + "@rockpack/compiler": "4.5.2" } } diff --git a/examples/5-meta-tags/rockpack.babel.js b/examples/5-meta-tags-helmet/rockpack.babel.js similarity index 100% rename from examples/5-meta-tags/rockpack.babel.js rename to examples/5-meta-tags-helmet/rockpack.babel.js diff --git a/examples/5.1-meta-tags-helmet/src/App.jsx b/examples/5-meta-tags-helmet/src/App.jsx similarity index 100% rename from examples/5.1-meta-tags-helmet/src/App.jsx rename to examples/5-meta-tags-helmet/src/App.jsx diff --git a/examples/5-meta-tags/src/assets/favicon.ico b/examples/5-meta-tags-helmet/src/assets/favicon.ico similarity index 100% rename from examples/5-meta-tags/src/assets/favicon.ico rename to examples/5-meta-tags-helmet/src/assets/favicon.ico diff --git a/examples/5.1-meta-tags-helmet/src/client.jsx b/examples/5-meta-tags-helmet/src/client.jsx similarity index 100% rename from examples/5.1-meta-tags-helmet/src/client.jsx rename to examples/5-meta-tags-helmet/src/client.jsx diff --git a/examples/5.1-meta-tags-helmet/src/server.jsx b/examples/5-meta-tags-helmet/src/server.jsx similarity index 100% rename from examples/5.1-meta-tags-helmet/src/server.jsx rename to examples/5-meta-tags-helmet/src/server.jsx diff --git a/examples/5-meta-tags/src/App.jsx b/examples/5-meta-tags/src/App.jsx deleted file mode 100644 index 880191b..0000000 --- a/examples/5-meta-tags/src/App.jsx +++ /dev/null @@ -1,49 +0,0 @@ -import { Switch, Route, Link } from 'react-router-dom'; -import MetaTags from 'react-meta-tags'; -import { useSsrState, useSsrEffect, useRegisterEffect } from '@issr/core'; - -const asyncFn = () => new Promise((resolve) => setTimeout(() => resolve('Hello world'), 1000)); - -const Home = () => { - const [state, setState] = useSsrState('i am test'); - const registerEffect = useRegisterEffect(); - - useSsrEffect(() => { - registerEffect(asyncFn).then(data => { - setState(data); - }); - }, []); - - return ( - <> - - Home - - -
-

{state}

- secondary -
- - ); -}; - -const Secondary = () => ( - <> - - Secondary - - -
-

Secondary

- Home -
- -); - -export const App = () => ( - - - - -); diff --git a/examples/5-meta-tags/src/client.jsx b/examples/5-meta-tags/src/client.jsx deleted file mode 100644 index 490ffd9..0000000 --- a/examples/5-meta-tags/src/client.jsx +++ /dev/null @@ -1,16 +0,0 @@ -import { hydrate } from 'react-dom'; -import { Router } from 'react-router-dom'; -import { createBrowserHistory } from 'history'; -import { App } from './App'; -import { createSsr } from '@issr/core'; - -const SSR = createSsr(window.SSR_DATA); - -hydrate( - - - - - , - document.getElementById('root') -); diff --git a/examples/5-meta-tags/src/server.jsx b/examples/5-meta-tags/src/server.jsx deleted file mode 100644 index 1b4d290..0000000 --- a/examples/5-meta-tags/src/server.jsx +++ /dev/null @@ -1,58 +0,0 @@ -import path from 'path'; -import Koa from 'koa'; -import serve from 'koa-static'; -import Router from 'koa-router'; -import { StaticRouter } from 'react-router'; -import serialize from 'serialize-javascript'; -import MetaTagsServer from 'react-meta-tags/server'; -import { MetaTagsContext } from 'react-meta-tags'; - -import { App } from './App'; -import { serverRender } from '@issr/core'; - -const app = new Koa(); -const router = new Router(); - -app.use(serve(path.resolve(__dirname, '../public'))); - -router.get('/*', async (ctx) => { - const { url } = ctx.request; - const routerParams = { - location: url, - context: {} - }; - const metaTagsInstance = MetaTagsServer(); - - const { html, state } = await serverRender.string(() => ( - - - - - - )); - const meta = metaTagsInstance.renderToString(); - - ctx.body = ` - - - - ${meta} - - - -
${html}
- - - -`; -}); - -app - .use(router.routes()) - .use(router.allowedMethods()); - -const server = app.listen(4000, () => { - console.log(`Server is listening ${4000} port`); -}); diff --git a/examples/5.1-meta-tags-helmet/build.js b/examples/5.1-meta-tags-helmet/build.js deleted file mode 100644 index 9edf3b5..0000000 --- a/examples/5.1-meta-tags-helmet/build.js +++ /dev/null @@ -1,16 +0,0 @@ -const path = require('path'); -const { isomorphicCompiler, backendCompiler, frontendCompiler } = require('@rockpack/compiler'); - -isomorphicCompiler( - backendCompiler({ - src: 'src/server.jsx', - dist: 'dist', - }), - frontendCompiler({ - src: 'src/client.jsx', - dist: 'public', - copy: [ - { from: path.resolve(__dirname, './src/assets/favicon.ico'), to: './' } - ] - }) -); diff --git a/examples/5.1-meta-tags-helmet/package.json b/examples/5.1-meta-tags-helmet/package.json deleted file mode 100644 index c0abef9..0000000 --- a/examples/5.1-meta-tags-helmet/package.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "name": "@issr/example-5.1", - "version": "1.0.0", - "scripts": { - "start": "cross-env NODE_ENV=development node build", - "build": "cross-env NODE_ENV=production node build" - }, - "dependencies": { - "@issr/core": "2.0.0", - "history": "4.10.1", - "koa": "2.11.0", - "koa-router": "8.0.8", - "koa-static": "5.0.0", - "react": "16.13.1", - "react-dom": "16.13.1", - "react-helmet-async": "1.0.7", - "react-router": "5.1.2", - "react-router-dom": "5.1.2", - "serialize-javascript": "3.0.0" - }, - "devDependencies": { - "@issr/babel-plugin": "2.0.0", - "@rockpack/compiler": "3.0.0-next.2" - } -} diff --git a/examples/5.1-meta-tags-helmet/rockpack.babel.js b/examples/5.1-meta-tags-helmet/rockpack.babel.js deleted file mode 100644 index 006fdfc..0000000 --- a/examples/5.1-meta-tags-helmet/rockpack.babel.js +++ /dev/null @@ -1,5 +0,0 @@ -module.exports = { - plugins: [ - '@issr/babel-plugin' - ] -} diff --git a/examples/5.1-meta-tags-helmet/src/assets/favicon.ico b/examples/5.1-meta-tags-helmet/src/assets/favicon.ico deleted file mode 100644 index c4ae0f58c844d653d5ba0bff51a2018eeb4aa97d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 15406 zcmeHOX^fOu6=8msWuLKN{RZ_BIX5Ry$c z*Am!}gd`-9%}J7#5Fm+xBpf+5n3LVz&1WxD2WC^fS89*bTiy9{hGOl# zJLu~iUc=j5{TM5+`%=)J#B24jU-Q1T7q|NT7QBfux6VAL%X{kU&-I?gG>1sW7`jz^~}Q5@#@m|P=Alr&+g%UDv#X6$5%Ga3C2K1NwkZ$#^^Id zr^ECIKgJrRLwvlk?MIno#8^Dd-GB7QJbDYWo?gIe$G7lz^QpfVf&m^NC-aFv^Zx3> zw{m(QM|IIV3c)a+_$$e&Kj`aPB~F9B;uAqzm}XJ0Zoic|$NtUdS-bC2rY?RbtM2+8 zAB#Cu``?l|9&oBVZ)2V{#>a?1u0BFAZ^#`h=qSyfLF?pdR(|+;rZ4{pjmuoSkv$N= zD7GIbvIqIt#6zKtMw~M}^t+6HIG@rA`=#>A(R+JuBmPdd$zyT3$7OaBI63Zl9QQX}p>KqXj30VSxEPyn4sey%-N?MU$v29XjhU2Y{;$ypL&1XLFqgXRx^I1P$0PMR8>J>m_^fFWlA^ zu=AcS=|b3>*>H>N0DuGgvPSkJBRQlM=ppbgsEgj#QQToZ)Ftm?u=&m1eq}X^Ji|44VuA2 zQ|{*u?JXJF!J28cb?uJo(%eq(^`0l!>AY9-Xn$FLr`Qt3CrV^zcWFI$4{qN@%=+)W z48E({i`y7tMLBVX2raN@D?>MN|3Z1gS4j@t(`S=p3tQH$M*WWUQ;$*Hiu^cP@e<;@ zvhiEwhj=NXqI>l!vkwh$9lo^S;s~!v_$S&1TivS}5gOpXaE`2t`NzVzz+c#pD*@m# zG56dtA%A8VUs@fpQrVsZEv|8r?9dOU$`3y0+(NNF_(RpD?@oo2Mpx1H>hSH!^xHa1 z@*DVYdnqRRY%=-q|9LI{6FSvSY|os_qO>OUGq&GCc7N2T1)OdM{fK80)94l{uu0)7 zLu^_0lf#!$>W{}0l4xqD4SNtVRk>u*UtW8i+?~H8=FHDvino{7lRvu|@5M*NIsCJ& zJzGAH7x=B<%altN{nZ^mmAlh^Jst7e059T64ebc1=lyy7pLolosh#iem$rO$EwZxc z$9*9e_&a2OKIWqQ@C{8KXdlr10v~xh^yT)Y_(@~*X_=hN_3s?r5baNUmiyzA?r&;C zu7*c*TpJl89*gB3ZH>=6@_?+e7`l3-3|Ta{v< z;+zwVAU5lt7ro5b{B7Fjb<%hXw=z0}G1!Py;-PYNRKL(8}x7t?o0H>}Tk6 z$T18G>B(995-}F9Rt>thDqd^eqI>LE(v_nd4;%tS}`8|aaZYwePnF^iGO~O&!C|lC12bZLcl6bn;{$=7Ht`zCP?pZqvh;R-nLEhJQ+5aTQZL>>tULd6;&&PWLcu z66iPZjo|+&U<2S+A3Z?6kgX)^xn#G`nRK7|_;{l86aH}S6HhoxW&Y2 { return ( <> - - Home - -

{state}

secondary diff --git a/examples/6-css-modules-other-styles/src/server.jsx b/examples/6-css-modules-other-styles/src/server.jsx index c18fc02..4eeb967 100644 --- a/examples/6-css-modules-other-styles/src/server.jsx +++ b/examples/6-css-modules-other-styles/src/server.jsx @@ -4,8 +4,6 @@ import serve from 'koa-static'; import Router from 'koa-router'; import { StaticRouter } from 'react-router'; import serialize from 'serialize-javascript'; -import MetaTagsServer from 'react-meta-tags/server'; -import { MetaTagsContext } from 'react-meta-tags'; import { App } from './App'; import { serverRender } from '@issr/core'; @@ -21,22 +19,17 @@ router.get('/*', async (ctx) => { location: url, context: {} }; - const metaTagsInstance = MetaTagsServer(); const { html, state } = await serverRender.string(() => ( - - - - - + + + )); - const meta = metaTagsInstance.renderToString(); ctx.body = ` - ${meta}