Skip to content

Commit

Permalink
Update React dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
jdnichollsc committed Aug 11, 2020
1 parent 3ade3b9 commit b66f432
Show file tree
Hide file tree
Showing 9 changed files with 1,744 additions and 3,272 deletions.
12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@
"lint": "eslint src/**/*{.ts,.tsx}"
},
"devDependencies": {
"@stencil/core": "^1.17.2",
"@stencil/core": "^1.17.3",
"@stencil/eslint-plugin": "^0.3.1",
"@stencil/react-output-target": "^0.0.8",
"@typescript-eslint/eslint-plugin": "^3.7.1",
"@typescript-eslint/parser": "^3.7.1",
"eslint": "^7.6.0",
"eslint-plugin-react": "^7.20.5",
"gh-pages": "^3.1.0",
"@stencil/react-output-target": "^0.0.7"
"gh-pages": "^3.1.0"
},
"license": "MIT",
"repository": {
Expand Down
4,786 changes: 1,707 additions & 3,079 deletions react/package-lock.json

Large diffs are not rendered by default.

33 changes: 16 additions & 17 deletions react/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@proyecto26/animatable-component-react",
"sideEffects": false,
"version": "1.0.3",
"version": "1.0.4",
"description": "React specific wrapper for animatable-component",
"repository": {
"type": "git",
Expand All @@ -12,7 +12,7 @@
"clean": "rm -rf dist",
"compile": "npm run tsc",
"tsc": "tsc -p .",
"lint": "tsc --noEmit && eslint 'src/**/*.{js,ts,tsx}' --quiet --fix --ignore-pattern 'src/react-component-lib/*'"
"lint": "tsc --noEmit && eslint 'src/**/*.{js,ts,tsx}' --quiet --fix --ignore-pattern 'src/react-component-lib/*' --resolve-plugins-relative-to ."
},
"main": "./dist/index.js",
"module": "./dist/index.js",
Expand All @@ -21,21 +21,20 @@
"dist/"
],
"devDependencies": {
"@types/jest": "23.3.9",
"@types/node": "13.13.0",
"@types/react": "16.7.6",
"@types/react-dom": "16.0.9",
"@typescript-eslint/eslint-plugin": "^2.28.0",
"@typescript-eslint/parser": "^2.28.0",
"eslint": "^6.8.0",
"eslint-plugin-react": "^7.19.0",
"jest": "^25.4.0",
"jest-dom": "^3.0.2",
"react": "^16.7.0",
"react-dom": "^16.7.0",
"rollup": "^1.21.2",
"rollup-plugin-node-resolve": "^5.2.0",
"typescript": "^3.3.4000"
"@stencil/core": "^1.17.3",
"@types/jest": "^26.0.0",
"@types/node": "^14.0.0",
"@types/react": "^16.9.0",
"@types/react-dom": "^16.9.0",
"@typescript-eslint/eslint-plugin": "^3.7.0",
"@typescript-eslint/parser": "^3.7.0",
"eslint": "^7.0.0",
"eslint-plugin-react": "^7.0.0",
"jest": "^26.0.0",
"jest-dom": "^4.0.0",
"react": "^16.0.0",
"react-dom": "^16.0.0",
"typescript": "^3.0.0"
},
"dependencies": {
"@proyecto26/animatable-component": "^1.1.8"
Expand Down
4 changes: 2 additions & 2 deletions react/src/hocs/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export type AnimatableComponentType = ComponentType<AnimatableProps>;
*/
export function createAnimatableComponent<T> (
WrappedComponent: ComponentType<T>
) {
): ComponentType<T & AnimatableProps> {
return function WrappedWithAnimatable (props: T & AnimatableProps) {
const {
ref,
Expand Down Expand Up @@ -74,4 +74,4 @@ export function createAnimatableComponent<T> (
</AnimatableComponent>
);
};
};
}
12 changes: 6 additions & 6 deletions react/src/react-component-lib/createComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
import { HTMLStencilElement } from '@stencil/core/internal/stencil-public-runtime';

interface StencilReactInternalProps<ElementType> extends React.HTMLAttributes<ElementType> {
forwardedRef?: React.RefObject<ElementType>;
forwardedRef: React.RefObject<ElementType>;
ref?: React.Ref<any>;
}

Expand All @@ -22,15 +22,15 @@ export const createReactComponent = <
>(
tagName: string,
ReactComponentContext?: React.Context<ContextStateType>,
manipulatePropsFunction: (
manipulatePropsFunction?: (
originalProps: StencilReactInternalProps<ElementType>,
propsToPass: any,
) => ExpandedPropsTypes = undefined,
) => ExpandedPropsTypes,
) => {
const displayName = dashToPascalCase(tagName);

const ReactComponent = class extends React.Component<StencilReactInternalProps<ElementType>> {
componentEl: ElementType;
componentEl!: ElementType;

setComponentElRef = (element: ElementType) => {
this.componentEl = element;
Expand All @@ -54,7 +54,7 @@ export const createReactComponent = <
let propsToPass = Object.keys(cProps).reduce((acc, name) => {
if (name.indexOf('on') === 0 && name[2] === name[2].toUpperCase()) {
const eventName = name.substring(2).toLowerCase();
if (isCoveredByReact(eventName)) {
if (typeof document !== "undefined" && isCoveredByReact(eventName)) {
(acc as any)[name] = (cProps as any)[name];
}
}
Expand All @@ -65,7 +65,7 @@ export const createReactComponent = <
propsToPass = manipulatePropsFunction(this.props, propsToPass);
}

let newProps: StencilReactInternalProps<ElementType> = {
const newProps: Omit<StencilReactInternalProps<ElementType>, 'forwardedRef'> = {
...propsToPass,
ref: mergeRefs(forwardedRef, this.setComponentElRef),
style,
Expand Down
71 changes: 0 additions & 71 deletions react/src/react-component-lib/createControllerComponent.tsx

This file was deleted.

5 changes: 4 additions & 1 deletion react/src/react-component-lib/interfaces.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import { EventEmitter } from '@stencil/core';
// General types important to applications using stencil built components
export interface EventEmitter<T = any> {
emit: (data?: T) => CustomEvent<T>;
}

export interface StyleReactProps {
class?: string;
Expand Down
87 changes: 0 additions & 87 deletions react/src/react-component-lib/utils/attachEventProps.ts

This file was deleted.

0 comments on commit b66f432

Please sign in to comment.