Merge remote-tracking branch 'upstream/master'

# Conflicts:
#	index.tsx
#	package-lock.json
#	package.json
This commit is contained in:
ttsah
2019-02-19 19:30:54 +02:00
9 changed files with 1026 additions and 7826 deletions
+27
View File
@@ -0,0 +1,27 @@
# Javascript Node CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-javascript/ for more details
#
version: 2
jobs:
build:
docker:
- image: circleci/node:8.9
steps:
- checkout
- restore_cache:
keys:
- v1-dependencies-{{ checksum "package.json" }}
# fallback to using the latest cache if no exact match is found
- v1-dependencies-
- run: yarn install
- save_cache:
paths:
- node_modules
key: v1-dependencies-{{ checksum "package.json" }}
# run tests!
- run: yarn test
+1 -1
View File
@@ -1,6 +1,6 @@
.idea
.DS_Store
circle.yml
.circleci
node_modules
test.js
test.d.ts
-3
View File
@@ -1,3 +0,0 @@
machine:
node:
version: 6.7.0
+5 -2
View File
@@ -16,7 +16,7 @@ import { render, unmountComponentAtNode } from 'react-dom'
* ```
*/
export function react2angular<Props>(
Class: React.ComponentClass<Props> | React.SFC<Props>,
Class: React.ComponentType<Props>,
bindingNames: (keyof Props)[] | null = null,
injectNames: string[] = []
): IComponentOptions {
@@ -41,7 +41,10 @@ export function react2angular<Props>(
}
render() {
if (!this.isDestroyed) {
render(<Class {...this.props} {...this.injectedProps} />, this.$element[0])
render(
<Class {...this.props} {...this.injectedProps as any} />,
this.$element[0]
)
}
}
componentWillUnmount() {
-6401
View File
File diff suppressed because it is too large Load Diff
+22 -22
View File
@@ -1,6 +1,6 @@
{
"name": "react2angular",
"version": "4.0.4",
"version": "4.0.5",
"description": "The easiest way to embed React components in Angular 1 apps!",
"main": "index.js",
"main:esnext": "index.es2015.js",
@@ -45,33 +45,33 @@
"react-dom": ">=15"
},
"devDependencies": {
"@types/angular": "^1.6.47",
"@types/angular-mocks": "^1.6.0",
"@types/jasmine": "^2.8.8",
"@types/jquery": "^3.3.4",
"@types/prop-types": "^15.5.3",
"@types/react": "^16.4.1",
"@types/react-dom": "^16.0.6",
"angular-mocks": "^1.7.2",
"angular-resource": "^1.7.2",
"browserify": "^16.2.2",
"jasmine": "^3.1.0",
"jasmine-core": "^3.1.0",
"karma": "^2.0.3",
"karma-browserify": "^5.3.0",
"@types/angular": "^1.6.53",
"@types/angular-mocks": "^1.7.0",
"@types/jasmine": "^3.3.8",
"@types/jquery": "^3.3.29",
"@types/prop-types": "^15.5.8",
"@types/react": "^16.8.1",
"@types/react-dom": "^16.0.11",
"angular-mocks": "^1.7.6",
"angular-resource": "^1.7.6",
"browserify": "^16.2.3",
"jasmine": "^3.3.1",
"jasmine-core": "^3.3.0",
"karma": "^4.0.0",
"karma-browserify": "^6.0.0",
"karma-chrome-launcher": "^2.2.0",
"karma-jasmine": "^1.1.2",
"karma-jasmine": "^2.0.1",
"karma-mocha-reporter": "^2.2.5",
"karma-source-map-support": "^1.3.0",
"ngimport": "^1.0.0",
"npm-run-all": "^4.1.3",
"npm-run-all": "^4.1.5",
"prop-types": "^15.6.2",
"react": "^16.4.1",
"react-dom": "^16.4.1",
"react": "^16.7.0",
"react-dom": "^16.7.0",
"rimraf": "^2.6.3",
"rollupify": "^0.5.0",
"tslint": "^5.10.0",
"typescript": "^2.9.2",
"rollupify": "^0.5.1",
"tslint": "^5.12.1",
"typescript": "^3.3.1",
"watchify": "^3.11.0"
},
"dependencies": {
+6 -11
View File
@@ -1,4 +1,5 @@
import { bootstrap, element as $, IAugmentedJQuery, ICompileService, IHttpService, IQService, mock, module } from 'angular'
import { bootstrap, element as $, IAugmentedJQuery, ICompileService, IHttpService, IQService, module } from 'angular'
import * as angular from 'angular'
import 'angular-mocks'
import { $http, $q, $rootScope } from 'ngimport'
import * as PropTypes from 'prop-types'
@@ -97,14 +98,8 @@ class TestSix extends React.Component<Props & DIProps> {
}
}
class TestSeven extends React.Component<Props> {
static propTypes = {
foo: PropTypes.string.isRequired
}
render() {
return <p>{this.props.foo}</p>
}
function TestSeven(props: Props) {
return <p>{props.foo}</p>
}
interface TestEightProps {
@@ -156,8 +151,8 @@ describe('react2angular', () => {
let $compile: any
beforeEach(() => {
mock.module('test')
mock.inject(function(_$compile_: ICompileService) {
angular.mock.module('test')
angular.mock.inject(function(_$compile_: ICompileService) {
$compile = _$compile_
})
})
-1
View File
@@ -29,7 +29,6 @@
"no-reference": true,
"no-trailing-whitespace": true,
"no-unused-expression": true,
"no-unused-variable": true,
"no-var-keyword": true,
"object-literal-key-quotes": [
true,
+965 -1385
View File
File diff suppressed because it is too large Load Diff