refactor: react-redux and aliases

This commit is contained in:
cha0s 2024-01-25 23:49:55 -06:00
parent ab39d74d64
commit fb98053c8d
15 changed files with 20 additions and 30 deletions

View File

@ -1 +1 @@
exports.dependencies = ['@flecks/react'];
exports.dependencies = ['@flecks/react-redux'];

View File

@ -28,7 +28,7 @@
"@babel/parser": "^7.13.13",
"@flecks/core": "^3.0.0",
"@flecks/react": "^3.0.0",
"@flecks/redux": "^3.0.0",
"@flecks/react-redux": "^3.0.0",
"babeler": "^1.0.0",
"lodash.get": "^4.4.2",
"lodash.set": "^4.3.2",

View File

@ -5,14 +5,14 @@ import {
React,
useContext,
} from '@flecks/react';
import {useDispatch} from '@flecks/redux';
import {useDispatch} from '@flecks/react-redux';
import locals from './component.module.scss';
const ScriptComponent = ({
function ScriptComponent({
path,
resource,
}) => {
}) {
const dispatch = useDispatch();
const {uri, uuid} = useContext(Context);
return (
@ -26,7 +26,7 @@ const ScriptComponent = ({
}}
/>
);
};
}
ScriptComponent.defaultProps = {
path: '/',

View File

@ -1,9 +0,0 @@
module.exports = async (env, argv, flecks) => {
// eslint-disable-next-line import/no-extraneous-dependencies, global-require
const config = await require('@flecks/fleck/build/fleck.webpack.config')(env, argv, flecks);
config.module.rules.push({
test: /\.(frag|glsl|vert)$/,
use: ['webpack-glsl-loader'],
});
return config;
};

View File

@ -1,4 +1,4 @@
export const hooks = {
exports.hooks = {
'@flecks/build.config': (target, config) => {
config.module.rules.push({
test: /\.(frag|glsl|vert)$/,

View File

@ -9,8 +9,7 @@
"test": "flecks test"
},
"files": [
"client.js",
"server.js"
"client.js"
],
"dependencies": {
"@flecks/core": "^3.0.0",

View File

@ -2,6 +2,6 @@ exports.dependencies = ['@flecks/react'];
exports.stubs = {
server: [
/^@pixi/,
'@pixi',
],
};

View File

@ -1,5 +1,5 @@
exports.stubs = {
server: [
/^gamepads/,
'gamepads',
],
};

View File

@ -24,5 +24,5 @@ export const hooks = {
Input: InputPacket,
TraitInteractive,
}),
'@flecks/web.config': (flecks) => flecks.get('@avocado/input.actions'),
'@flecks/web.config': (req, flecks) => flecks.get('@avocado/input'),
};

View File

@ -2,6 +2,6 @@ exports.dependencies = ['@flecks/react'];
exports.stubs = {
server: [
/^ace-builds/,
'ace-builds',
],
};

View File

@ -1 +1 @@
exports.dependencies = ['@flecks/react'];
exports.dependencies = ['@flecks/react-redux'];

View File

@ -24,6 +24,7 @@
"@avocado/react": "^4.0.0",
"@flecks/core": "^3.0.0",
"@flecks/react": "^3.0.0",
"@flecks/react-redux": "^3.0.0",
"@flecks/redux": "^3.0.0",
"deepmerge": "^4.2.2",
"fast-json-patch": "^3.0.0-1",

View File

@ -1,5 +1,5 @@
import {useContext} from '@flecks/react';
import {useDispatch} from '@flecks/redux';
import {useDispatch} from '@flecks/react-redux';
import {compare} from 'fast-json-patch';
import Context from '../context/json-patcher';

View File

@ -31,6 +31,7 @@
"@avocado/traits": "^4.0.0",
"@flecks/core": "^3.0.0",
"@flecks/react": "^3.0.0",
"@flecks/react-redux": "^3.0.0",
"@flecks/redux": "^3.0.0",
"@flecks/socket": "^3.0.0",
"@flecks/web": "^3.0.0",

View File

@ -26,17 +26,15 @@ import {
usePrevious,
useState,
} from '@flecks/react';
import {
useDispatch,
} from '@flecks/redux';
import {useDispatch} from '@flecks/react-redux';
import styles from './component.module.scss';
const renderer = new Renderer();
const RoomComponent = ({
function RoomComponent({
resource,
}) => {
}) {
const {uri, uuid} = useContext(Context);
const dispatch = useDispatch();
const flecks = useFlecks();
@ -249,7 +247,7 @@ const RoomComponent = ({
</div>
</div>
);
};
}
RoomComponent.defaultProps = {};