refactor: react-redux and aliases
This commit is contained in:
parent
ab39d74d64
commit
fb98053c8d
|
@ -1 +1 @@
|
||||||
exports.dependencies = ['@flecks/react'];
|
exports.dependencies = ['@flecks/react-redux'];
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
"@babel/parser": "^7.13.13",
|
"@babel/parser": "^7.13.13",
|
||||||
"@flecks/core": "^3.0.0",
|
"@flecks/core": "^3.0.0",
|
||||||
"@flecks/react": "^3.0.0",
|
"@flecks/react": "^3.0.0",
|
||||||
"@flecks/redux": "^3.0.0",
|
"@flecks/react-redux": "^3.0.0",
|
||||||
"babeler": "^1.0.0",
|
"babeler": "^1.0.0",
|
||||||
"lodash.get": "^4.4.2",
|
"lodash.get": "^4.4.2",
|
||||||
"lodash.set": "^4.3.2",
|
"lodash.set": "^4.3.2",
|
||||||
|
|
|
@ -5,14 +5,14 @@ import {
|
||||||
React,
|
React,
|
||||||
useContext,
|
useContext,
|
||||||
} from '@flecks/react';
|
} from '@flecks/react';
|
||||||
import {useDispatch} from '@flecks/redux';
|
import {useDispatch} from '@flecks/react-redux';
|
||||||
|
|
||||||
import locals from './component.module.scss';
|
import locals from './component.module.scss';
|
||||||
|
|
||||||
const ScriptComponent = ({
|
function ScriptComponent({
|
||||||
path,
|
path,
|
||||||
resource,
|
resource,
|
||||||
}) => {
|
}) {
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
const {uri, uuid} = useContext(Context);
|
const {uri, uuid} = useContext(Context);
|
||||||
return (
|
return (
|
||||||
|
@ -26,7 +26,7 @@ const ScriptComponent = ({
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
};
|
}
|
||||||
|
|
||||||
ScriptComponent.defaultProps = {
|
ScriptComponent.defaultProps = {
|
||||||
path: '/',
|
path: '/',
|
||||||
|
|
|
@ -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;
|
|
||||||
};
|
|
|
@ -1,4 +1,4 @@
|
||||||
export const hooks = {
|
exports.hooks = {
|
||||||
'@flecks/build.config': (target, config) => {
|
'@flecks/build.config': (target, config) => {
|
||||||
config.module.rules.push({
|
config.module.rules.push({
|
||||||
test: /\.(frag|glsl|vert)$/,
|
test: /\.(frag|glsl|vert)$/,
|
|
@ -9,8 +9,7 @@
|
||||||
"test": "flecks test"
|
"test": "flecks test"
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
"client.js",
|
"client.js"
|
||||||
"server.js"
|
|
||||||
],
|
],
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@flecks/core": "^3.0.0",
|
"@flecks/core": "^3.0.0",
|
||||||
|
|
|
@ -2,6 +2,6 @@ exports.dependencies = ['@flecks/react'];
|
||||||
|
|
||||||
exports.stubs = {
|
exports.stubs = {
|
||||||
server: [
|
server: [
|
||||||
/^@pixi/,
|
'@pixi',
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
exports.stubs = {
|
exports.stubs = {
|
||||||
server: [
|
server: [
|
||||||
/^gamepads/,
|
'gamepads',
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
|
@ -24,5 +24,5 @@ export const hooks = {
|
||||||
Input: InputPacket,
|
Input: InputPacket,
|
||||||
TraitInteractive,
|
TraitInteractive,
|
||||||
}),
|
}),
|
||||||
'@flecks/web.config': (flecks) => flecks.get('@avocado/input.actions'),
|
'@flecks/web.config': (req, flecks) => flecks.get('@avocado/input'),
|
||||||
};
|
};
|
||||||
|
|
|
@ -2,6 +2,6 @@ exports.dependencies = ['@flecks/react'];
|
||||||
|
|
||||||
exports.stubs = {
|
exports.stubs = {
|
||||||
server: [
|
server: [
|
||||||
/^ace-builds/,
|
'ace-builds',
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
exports.dependencies = ['@flecks/react'];
|
exports.dependencies = ['@flecks/react-redux'];
|
||||||
|
|
|
@ -24,6 +24,7 @@
|
||||||
"@avocado/react": "^4.0.0",
|
"@avocado/react": "^4.0.0",
|
||||||
"@flecks/core": "^3.0.0",
|
"@flecks/core": "^3.0.0",
|
||||||
"@flecks/react": "^3.0.0",
|
"@flecks/react": "^3.0.0",
|
||||||
|
"@flecks/react-redux": "^3.0.0",
|
||||||
"@flecks/redux": "^3.0.0",
|
"@flecks/redux": "^3.0.0",
|
||||||
"deepmerge": "^4.2.2",
|
"deepmerge": "^4.2.2",
|
||||||
"fast-json-patch": "^3.0.0-1",
|
"fast-json-patch": "^3.0.0-1",
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import {useContext} from '@flecks/react';
|
import {useContext} from '@flecks/react';
|
||||||
import {useDispatch} from '@flecks/redux';
|
import {useDispatch} from '@flecks/react-redux';
|
||||||
import {compare} from 'fast-json-patch';
|
import {compare} from 'fast-json-patch';
|
||||||
|
|
||||||
import Context from '../context/json-patcher';
|
import Context from '../context/json-patcher';
|
||||||
|
|
|
@ -31,6 +31,7 @@
|
||||||
"@avocado/traits": "^4.0.0",
|
"@avocado/traits": "^4.0.0",
|
||||||
"@flecks/core": "^3.0.0",
|
"@flecks/core": "^3.0.0",
|
||||||
"@flecks/react": "^3.0.0",
|
"@flecks/react": "^3.0.0",
|
||||||
|
"@flecks/react-redux": "^3.0.0",
|
||||||
"@flecks/redux": "^3.0.0",
|
"@flecks/redux": "^3.0.0",
|
||||||
"@flecks/socket": "^3.0.0",
|
"@flecks/socket": "^3.0.0",
|
||||||
"@flecks/web": "^3.0.0",
|
"@flecks/web": "^3.0.0",
|
||||||
|
|
|
@ -26,17 +26,15 @@ import {
|
||||||
usePrevious,
|
usePrevious,
|
||||||
useState,
|
useState,
|
||||||
} from '@flecks/react';
|
} from '@flecks/react';
|
||||||
import {
|
import {useDispatch} from '@flecks/react-redux';
|
||||||
useDispatch,
|
|
||||||
} from '@flecks/redux';
|
|
||||||
|
|
||||||
import styles from './component.module.scss';
|
import styles from './component.module.scss';
|
||||||
|
|
||||||
const renderer = new Renderer();
|
const renderer = new Renderer();
|
||||||
|
|
||||||
const RoomComponent = ({
|
function RoomComponent({
|
||||||
resource,
|
resource,
|
||||||
}) => {
|
}) {
|
||||||
const {uri, uuid} = useContext(Context);
|
const {uri, uuid} = useContext(Context);
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
const flecks = useFlecks();
|
const flecks = useFlecks();
|
||||||
|
@ -249,7 +247,7 @@ const RoomComponent = ({
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
}
|
||||||
|
|
||||||
RoomComponent.defaultProps = {};
|
RoomComponent.defaultProps = {};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user