Skip to content

Commit 602dca0

Browse files
committed
Merge branch 'release/2.3.0'
2 parents 3207ac5 + 6b32ebf commit 602dca0

25 files changed

Lines changed: 650 additions & 302 deletions

.bomlint.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"@types/react": "^16.7.22",
3+
"tea-cup-core": "2.3.0",
4+
"react-tea-cup": "2.3.0",
5+
"ts-jest": "^24.1.0",
6+
"bomlint": "1.2.3"
7+
}

.circleci/config.yml

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1-
version: 2
1+
version: 2.1
2+
orbs:
3+
browser-tools: circleci/browser-tools@1.1.1
24

35
defaults: &defaults
46
working_directory: ~/repo
57
docker:
6-
- image: circleci/node:erbium
8+
- image: circleci/node:gallium
79

810
jobs:
911
build:
@@ -16,6 +18,31 @@ jobs:
1618
root: ~/repo
1719
paths: .
1820

21+
webtests:
22+
working_directory: ~/repo
23+
docker:
24+
- image: circleci/openjdk:11-jdk-browsers
25+
environment:
26+
DISPLAY: :99
27+
28+
steps:
29+
- run: sudo Xvfb :99 -screen 0 1920x1200x24 > /dev/null 2>&1 &
30+
- attach_workspace:
31+
at: ~/repo
32+
- browser-tools/install-chrome
33+
- browser-tools/install-chromedriver
34+
- run:
35+
command: |
36+
google-chrome --version
37+
chromedriver --version
38+
ps -efa | grep Xvfb
39+
name: Check install
40+
- run: cd webtests && export DISPLAY=:99 && mvn clean install -Dwebdriver.chrome.driver=/usr/local/bin/chromedriver
41+
- store_artifacts:
42+
path: ~/repo/webtests/target/surefire-reports
43+
- store_artifacts:
44+
path: ~/repo/webtests/target/videos
45+
1946
deploy:
2047
<<: *defaults
2148
steps:
@@ -34,9 +61,13 @@ workflows:
3461
filters:
3562
tags:
3663
only: /\d+\.\d+\.\d+/
64+
- webtests:
65+
requires:
66+
- build
3767
- deploy:
3868
requires:
3969
- build
70+
- webtests
4071
filters:
4172
tags:
4273
only: /\d+\.\d+\.\d+/

CHANGELOG.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,27 @@
11
# Changelog
22

3+
## v2.2.2 (24/04/2023)
4+
5+
#### closed
6+
7+
- [**closed**] DocSub async dispatch [#93](https://github.com/vankeisb/react-tea-cup/pull/93)
8+
- [**closed**] Fix model undef check, update README [#88](https://github.com/vankeisb/react-tea-cup/pull/88)
9+
10+
#### dependencies
11+
12+
- [**dependencies**] Bump decode-uri-component from 0.2.0 to 0.2.2 [#89](https://github.com/vankeisb/react-tea-cup/pull/89)
13+
- [**dependencies**] Bump qs from 6.5.2 to 6.5.3 [#90](https://github.com/vankeisb/react-tea-cup/pull/90)
14+
- [**dependencies**] Bump express from 4.17.1 to 4.18.2 [#91](https://github.com/vankeisb/react-tea-cup/pull/91)
15+
- [**dependencies**] Bump json5 from 1.0.1 to 1.0.2 [#92](https://github.com/vankeisb/react-tea-cup/pull/92)
16+
- [**dependencies**] Bump async from 2.6.3 to 2.6.4 [#80](https://github.com/vankeisb/react-tea-cup/pull/80)
17+
- [**dependencies**] Bump minimist from 1.2.5 to 1.2.6 [#79](https://github.com/vankeisb/react-tea-cup/pull/79)
18+
- [**dependencies**] Bump cross-fetch from 2.2.3 to 2.2.6 [#81](https://github.com/vankeisb/react-tea-cup/pull/81)
19+
- [**dependencies**] Bump eventsource from 1.0.7 to 1.1.1 [#82](https://github.com/vankeisb/react-tea-cup/pull/82)
20+
- [**dependencies**] Bump jsdom from 16.4.0 to 16.5.0 [#84](https://github.com/vankeisb/react-tea-cup/pull/84)
21+
- [**dependencies**] Bump terser from 4.8.0 to 4.8.1 [#85](https://github.com/vankeisb/react-tea-cup/pull/85)
22+
23+
---
24+
325
## v2.2.1 (02/09/2022)
426

527
#### closed

build.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
yarn install && \
2+
yarn bomlint && \
23
cd core && \
34
./build.sh && \
45
cd ../tea-cup && \
56
./build.sh && \
67
cd ../samples && \
7-
yarn test --watchAll=false
8+
yarn test --watchAll=false && \
9+
yarn build

bump-version.js

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,25 @@ const fs = require('fs');
22

33
const VERSION = process.env.VERSION;
44

5-
console.log("Bumping to " + VERSION);
5+
console.log('Bumping to ' + VERSION);
66

77
function withJsonFile(name, callback) {
8-
const text = fs.readFileSync(name);
9-
const json = JSON.parse(text);
10-
callback(json)
11-
fs.writeFileSync(name, JSON.stringify(json, null, " "))
8+
const text = fs.readFileSync(name);
9+
const json = JSON.parse(text);
10+
callback(json);
11+
fs.writeFileSync(name, JSON.stringify(json, null, ' '));
1212
}
1313

14-
withJsonFile("./core/package.json", j => {
15-
j.version = VERSION;
14+
withJsonFile('./core/package.json', (j) => {
15+
j.version = VERSION;
1616
});
1717

18-
withJsonFile("./tea-cup/package.json", j => {
19-
j.version = VERSION;
20-
j.peerDependencies['tea-cup-core'] = '^' + VERSION;
18+
withJsonFile('./tea-cup/package.json', (j) => {
19+
j.version = VERSION;
20+
j.peerDependencies['tea-cup-core'] = VERSION;
2121
});
2222

23-
withJsonFile('./samples/package.json', j => {
24-
j.dependencies['tea-cup-core'] = VERSION;
25-
j.dependencies['react-tea-cup'] = VERSION;
23+
withJsonFile('./samples/package.json', (j) => {
24+
j.dependencies['tea-cup-core'] = VERSION;
25+
j.dependencies['react-tea-cup'] = VERSION;
2626
});
27-

core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "tea-cup-core",
3-
"version": "2.2.2",
3+
"version": "2.3.0",
44
"description": "react-tea-cup core classes and utilities (Maybe etc)",
55
"author": "Rémi Van Keisbelck <remi@rvkb.com>",
66
"license": "MIT",

core/src/TeaCup/Animation.ts

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -25,20 +25,6 @@
2525

2626
import { Sub } from './Sub';
2727

28-
let subs: Array<RafSub<any>> = [];
29-
30-
let ticking = false;
31-
32-
function tick() {
33-
if (!ticking) {
34-
ticking = true;
35-
requestAnimationFrame((t: number) => {
36-
subs.forEach((s) => s.trigger(t));
37-
ticking = false;
38-
});
39-
}
40-
}
41-
4228
class RafSub<M> extends Sub<M> {
4329
readonly mapper: (t: number) => M;
4430

@@ -49,13 +35,9 @@ class RafSub<M> extends Sub<M> {
4935

5036
protected onInit() {
5137
super.onInit();
52-
subs.push(this);
53-
tick();
54-
}
55-
56-
protected onRelease() {
57-
super.onRelease();
58-
subs = subs.filter((s) => s !== this);
38+
setTimeout(() => {
39+
this.isActive() && requestAnimationFrame((t) => this.trigger(t));
40+
});
5941
}
6042

6143
trigger(t: number) {

core/src/TeaCup/Sub.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import { Dispatcher } from './Dispatcher';
2727

2828
export abstract class Sub<Msg> {
2929
protected dispatcher: Dispatcher<Msg> | undefined;
30+
private active: boolean = false;
3031

3132
static none<Msg>(): Sub<Msg> {
3233
return new SubNone();
@@ -38,16 +39,21 @@ export abstract class Sub<Msg> {
3839

3940
init(dispatch: Dispatcher<Msg>): void {
4041
this.dispatcher = dispatch;
42+
this.active = true;
4143
this.onInit();
4244
}
4345

4446
release(): void {
45-
this.dispatcher = undefined;
47+
this.active = false;
4648
this.onRelease();
4749
}
4850

51+
isActive() {
52+
return this.active;
53+
}
54+
4955
protected dispatch(m: Msg): void {
50-
this.dispatcher && this.dispatcher(m);
56+
this.dispatcher?.(m);
5157
}
5258

5359
protected onInit() {}

package.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,13 @@
1111
"jest": "24.9.0",
1212
"prettier": "2.0.5",
1313
"rimraf": "^2.6.3",
14-
"ts-jest": "24.0.2",
15-
"typescript": "~3.9.7"
14+
"ts-jest": "^24.1.0",
15+
"typescript": "~3.9.7",
16+
"bomlint": "1.2.3"
1617
},
1718
"scripts": {
1819
"release:gh": "gren release",
19-
"release:changelog": "gren changelog --tags all --generate --override"
20+
"release:changelog": "gren changelog --tags all --generate --override",
21+
"bomlint": "bomlint --allow-conflicts react package.json ./core/package.json ./tea-cup/package.json ./samples/package.json"
2022
}
2123
}

samples/package.json

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
"proxy": "https://api.github.com",
66
"dependencies": {
77
"@types/node": "10.12.19",
8-
"@types/react": "16.7.22",
8+
"@types/react": "^16.7.22",
99
"@types/react-dom": "16.0.11",
1010
"jest-enzyme": "^7.1.1",
1111
"react": "^16.7.0",
1212
"react-dom": "^16.7.0",
1313
"react-scripts": "3.4.3",
14-
"react-tea-cup": "2.2.2",
15-
"tea-cup-core": "2.2.2"
14+
"react-tea-cup": "2.3.0",
15+
"tea-cup-core": "2.3.0"
1616
},
1717
"scripts": {
1818
"start": "react-scripts start",
@@ -36,7 +36,6 @@
3636
"enzyme": "^3.10.0",
3737
"enzyme-adapter-react-16": "^1.15.1",
3838
"enzyme-to-json": "^3.4.2",
39-
"jest-fetch-mock": "^2.1.2",
40-
"ts-jest": "^24.1.0"
39+
"jest-fetch-mock": "^2.1.2"
4140
}
4241
}

0 commit comments

Comments
 (0)