Skip to content

Commit

Permalink
Merge pull request #75 from lineupjs/release/v2.5.1
Browse files Browse the repository at this point in the history
Release v2.5.1
  • Loading branch information
sgratzl authored Jan 21, 2024
2 parents 5350854 + cc4c036 commit 6f9e346
Show file tree
Hide file tree
Showing 26 changed files with 6,722 additions and 6,286 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
name: ci

on: [push]
on:
- push
- pull_request

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: 16
node-version: 20
- run: npm i -g yarn
- run: yarn config set checksumBehavior ignore
- name: Cache Node.js modules
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/create_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
echo -n "::set-output name=next_tag::"
npm version --no-git-tag-version ${{ github.event.inputs.versionName }} --preid ${{ github.event.inputs.preid }}
- name: Create pull request into main
uses: peter-evans/create-pull-request@v4
uses: peter-evans/create-pull-request@v5
with:
branch: release/${{ steps.version.outputs.next_tag }}
commit-message: 'chore: release ${{ steps.version.outputs.next_tag }}'
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/release_main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ jobs:
steps:
- name: Check out code
uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: 16
node-version: 20
- name: Extract version
id: extract_version
run: |
Expand Down Expand Up @@ -52,9 +52,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: 16
node-version: 20
- run: npm i -g yarn
- run: yarn config set checksumBehavior ignore
- name: Cache Node.js modules
Expand Down
5 changes: 0 additions & 5 deletions .stylelintrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,9 @@
"stylelint-config-standard-scss"
],
"rules": {
"string-quotes": "single",
"no-descending-specificity": null,
"value-list-comma-newline-after": null,
"declaration-colon-newline-after": null,
"at-rule-no-unknown": null,
"at-rule-empty-line-before": null,
"block-closing-brace-newline-after": null,
"selector-id-pattern": null,
"scss/at-rule-no-unknown": true,
"scss/no-global-function-names": null,
Expand All @@ -21,7 +17,6 @@
"scss/at-function-pattern": null,
"scss/at-if-closing-brace-newline-after": "always-last-in-chain",
"scss/at-if-closing-brace-space-after": "always-intermediate",
"scss/at-import-no-partial-leading-underscore": true,
"scss/at-import-partial-extension-blacklist": null,
"scss/at-import-partial-extension-whitelist": null,
"scss/at-mixin-argumentless-call-parentheses": "always",
Expand Down
783 changes: 0 additions & 783 deletions .yarn/releases/yarn-3.2.2.cjs

This file was deleted.

893 changes: 893 additions & 0 deletions .yarn/releases/yarn-4.0.2.cjs

Large diffs are not rendered by default.

10 changes: 1 addition & 9 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1 @@
packageExtensions:
eslint-config-airbnb-typescript@*:
dependencies:
eslint-config-airbnb-base: "*"
eslint-module-utils@*:
dependencies:
eslint-import-resolver-node: "*"

yarnPath: .yarn/releases/yarn-3.2.2.cjs
yarnPath: .yarn/releases/yarn-4.0.2.cjs
2 changes: 1 addition & 1 deletion demo/cell.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html>
<head lang="en">
<meta charset="UTF-8" />
Expand Down
2 changes: 1 addition & 1 deletion demo/frozen.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html>
<head lang="en">
<meta charset="UTF-8" />
Expand Down
2 changes: 1 addition & 1 deletion demo/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html>
<head lang="en">
<meta charset="UTF-8" />
Expand Down
2 changes: 1 addition & 1 deletion demo/table.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html>
<head lang="en">
<meta charset="UTF-8" />
Expand Down
83 changes: 42 additions & 41 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "lineupengine",
"description": "a fast engine for rendering large tables consisting of rows, rows+columns, multiple rows+columns instances.",
"homepage": "https://lineupengine.js.org",
"version": "2.5.0",
"version": "2.5.1",
"author": {
"name": "Samuel Gratzl",
"email": "[email protected]",
Expand Down Expand Up @@ -61,49 +61,50 @@
"prepare": "echo 'dummy prepare since prepack has no dev dependencies'",
"prepack": "npm run clean && npm run compile && npm run build"
},
"resolutions": {
"@typescript-eslint/eslint-plugin": "^6.19.0",
"@typescript-eslint/parser": "^6.19.0"
},
"devDependencies": {
"@types/jest": "^28.1.6",
"@typescript-eslint/eslint-plugin": "^5.30.7",
"@typescript-eslint/parser": "^5.30.7",
"@yarnpkg/sdks": "^2.6.2",
"css-loader": "^6.7.1",
"eslint": "^8.20.0",
"eslint-config-airbnb-typescript": "^17.0.0",
"eslint-config-prettier": "^8.5.0",
"@types/jest": "^29.5.11",
"@typescript-eslint/eslint-plugin": "^6.19.0",
"@typescript-eslint/parser": "^6.19.0",
"@yarnpkg/sdks": "^3.1.0",
"css-loader": "^6.9.1",
"eslint": "^8.56.0",
"eslint-config-airbnb-typescript": "^17.1.0",
"eslint-config-prettier": "^9.1.0",
"eslint-config-react-app": "^7.0.1",
"eslint-plugin-flowtype": "^8.0.3",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-jsx-a11y": "^6.6.1",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-react": "^7.30.1",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-jsx-a11y": "^6.8.0",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-react-hooks": "^4.6.0",
"fork-ts-checker-webpack-plugin": "^7.2.13",
"jest": "^28.1.3",
"jest-environment-jsdom": "^28.1.3",
"mini-css-extract-plugin": "^2.6.1",
"mkdirp": "^1.0.4",
"postcss": "^8.4.14",
"prettier": "^2.7.1",
"rimraf": "^3.0.2",
"sass": "^1.53.0",
"sass-loader": "^13.0.2",
"style-loader": "^3.3.1",
"stylelint": "^14.9.1",
"stylelint-config-prettier-scss": "^0.0.1",
"stylelint-config-standard-scss": "^5.0.0",
"stylelint-prettier": "^2.0.0",
"stylelint-scss": "^4.3.0",
"thread-loader": "^3.0.4",
"ts-jest": "^28.0.7",
"ts-loader": "^9.3.1",
"typedoc": "^0.23.8",
"typescript": "^4.7.4",
"webpack": "^5.73.0",
"webpack-cli": "^4.10.0",
"webpack-dev-server": "^4.9.3"
},
"dependencies": {
"tslib": "^2.4.0"
"fork-ts-checker-webpack-plugin": "^9.0.2",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"mini-css-extract-plugin": "^2.7.7",
"mkdirp": "^3.0.1",
"postcss": "^8.4.33",
"prettier": "^3.2.4",
"rimraf": "^5.0.5",
"sass": "^1.70.0",
"sass-loader": "^14.0.0",
"style-loader": "^3.3.4",
"stylelint": "^16.2.0",
"stylelint-config-prettier-scss": "^1.0.0",
"stylelint-config-standard-scss": "^13.0.0",
"stylelint-prettier": "^5.0.0",
"stylelint-scss": "^6.1.0",
"thread-loader": "^4.0.2",
"ts-jest": "^29.1.1",
"ts-loader": "^9.5.1",
"typedoc": "^0.25.7",
"typescript": "^5.3.3",
"webpack": "^5.89.0",
"webpack-cli": "^5.1.4",
"webpack-dev-server": "^4.15.1"
},
"packageManager": "yarn@3.2.2"
"packageManager": "yarn@4.0.2"
}
6 changes: 5 additions & 1 deletion src/ACellRenderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@ export abstract class ACellRenderer<T extends IColumn> extends ARowRenderer {

private readonly cell: ACellAdapter<T>;

constructor(protected readonly root: HTMLElement, htmlId: string, options: Partial<IRowRendererOptions> = {}) {
constructor(
protected readonly root: HTMLElement,
htmlId: string,
options: Partial<IRowRendererOptions> = {}
) {
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
super(setTemplate(root, htmlId).querySelector<HTMLElement>('main > article')!, options);
root.classList.add(cssClass(), 'lineup-engine');
Expand Down
5 changes: 4 additions & 1 deletion src/ARowRenderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,10 @@ export abstract class ARowRenderer {
viewportOversize: 200,
};

constructor(protected readonly body: HTMLElement, options: Partial<IRowRendererOptions> = {}) {
constructor(
protected readonly body: HTMLElement,
options: Partial<IRowRendererOptions> = {}
) {
this.adapter = this.createAdapter();
Object.assign(this.options, options);
this.mixins = this.options.mixins.map((MixinClass) => new MixinClass(this.adapter));
Expand Down
6 changes: 3 additions & 3 deletions src/abortAble.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ export function abortAbleAll<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(
T7 | IAAP<T7>,
T8 | IAAP<T8>,
T9 | IAAP<T9>,
T10 | IAAP<T10>
T10 | IAAP<T10>,
]
): IAAP<[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]>;
export function abortAbleAll<T1, T2, T3, T4, T5, T6, T7, T8, T9>(
Expand All @@ -142,7 +142,7 @@ export function abortAbleAll<T1, T2, T3, T4, T5, T6, T7, T8, T9>(
T6 | IAAP<T6>,
T7 | IAAP<T7>,
T8 | IAAP<T8>,
T9 | IAAP<T9>
T9 | IAAP<T9>,
]
): IAAP<[T1, T2, T3, T4, T5, T6, T7, T8, T9]>;
export function abortAbleAll<T1, T2, T3, T4, T5, T6, T7, T8>(
Expand All @@ -154,7 +154,7 @@ export function abortAbleAll<T1, T2, T3, T4, T5, T6, T7, T8>(
T5 | IAAP<T5>,
T6 | IAAP<T6>,
T7 | IAAP<T7>,
T8 | IAAP<T8>
T8 | IAAP<T8>,
]
): IAAP<[T1, T2, T3, T4, T5, T6, T7, T8]>;
export function abortAbleAll<T1, T2, T3, T4, T5, T6, T7>(
Expand Down
5 changes: 4 additions & 1 deletion src/animation/KeyFinder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ export default class KeyFinder {
* @param {IExceptionContext} context context to use
* @param {(rowIndex: number) => string} key key function
*/
constructor(public readonly context: IExceptionContext, public readonly key: (rowIndex: number) => string) {
constructor(
public readonly context: IExceptionContext,
public readonly key: (rowIndex: number) => string
) {
this.context.exceptions.forEach((e) => {
this.cache[e.index] = e.y;
this.key2index.set(key(e.index), e.index);
Expand Down
6 changes: 5 additions & 1 deletion src/logic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@ export interface IRowHeightException {
}

class RowHeightException implements IRowHeightException {
constructor(public readonly index: number, public readonly y: number, public readonly height: number) {}
constructor(
public readonly index: number,
public readonly y: number,
public readonly height: number
) {}

get y2() {
return this.y + this.height;
Expand Down
5 changes: 4 additions & 1 deletion src/mixin/PrefetchMixin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@ export default class PrefetchMixin implements IMixin {
delay: 200,
};

constructor(private readonly adapter: IMixinAdapter, options?: Partial<IPrefetchRendererOptions>) {
constructor(
private readonly adapter: IMixinAdapter,
options?: Partial<IPrefetchRendererOptions>
) {
Object.assign(this.options, options);
return this;
}
Expand Down
4 changes: 3 additions & 1 deletion src/styles/_animation.scss
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@
> main.#{$engine_css_prefix}-scrolling {
background-image: $engine_loading_static_image, $engine_loading_static_image;
background-repeat: repeat-x;
background-position: top 10px left, bottom 30px left;
background-position:
top 10px left,
bottom 30px left;
position: relative;
}
}
Expand Down
7 changes: 5 additions & 2 deletions src/styles/_mixins.scss
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
/* stylelint-disable value-list-comma-newline-after */
@mixin collapsing-row-border($border-width, $border-color) {
// use box-shadow to create collapsing border (@see https://stackoverflow.com/a/28807765)
box-shadow: $border-width 0 0 0 $border-color, 0 $border-width 0 0 $border-color,
$border-width $border-width 0 0 $border-color /* Just to fix the corner */, $border-width 0 0 0 $border-color inset,
box-shadow:
$border-width 0 0 0 $border-color,
0 $border-width 0 0 $border-color,
$border-width $border-width 0 0 $border-color /* Just to fix the corner */,
$border-width 0 0 0 $border-color inset,
0 0 0 $border-width $border-color;
}
/* stylelint-enable value-list-comma-newline-after */
6 changes: 5 additions & 1 deletion src/table/MultiTableRowRenderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,11 @@ export default class MultiTableRowRenderer {
minScrollDelta: 30,
};

constructor(public readonly node: HTMLElement, htmlId: string, options: Partial<IMultiTableRowRendererOptions> = {}) {
constructor(
public readonly node: HTMLElement,
htmlId: string,
options: Partial<IMultiTableRowRendererOptions> = {}
) {
Object.assign(this.options, options);
const cleanHTMLId = htmlId.startsWith('#') ? htmlId.slice(1) : htmlId;
// eslint-disable-next-line no-param-reassign
Expand Down
4 changes: 2 additions & 2 deletions src/table/internal/ACellAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -262,12 +262,12 @@ export abstract class ACellAdapter<T extends IColumn> {
row: number,
column: number,
columns: T[]
): { item: HTMLElement; ready: IAbortAblePromise<void> | void } {
): { item: HTMLElement; ready: IAbortAblePromise<void> | undefined } {
const pool = this.cellPool[column];
const columnObj = columns[column];

let item: HTMLElement;
let ready: IAbortAblePromise<void> | void;
let ready: IAbortAblePromise<void> | undefined = undefined;
const pooled = pool.pop();

const r = pooled
Expand Down
21 changes: 12 additions & 9 deletions tests/logic.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,18 @@ describe('logic', () => {
function expectExceptionLookups(ex: IRowHeightExceptionLookup, ...indexAndHeight: number[]) {
expect(indexAndHeight.length % 2).toBe(0); //even

const checks = indexAndHeight.reduce((acc, indexOrHeight, i) => {
const isIndex = i % 2 === 0;
if (isIndex) {
acc.push({ index: indexOrHeight, height: 0 });
} else {
acc[acc.length - 1].height = indexOrHeight;
}
return acc;
}, [] as { index: number; height: number }[]);
const checks = indexAndHeight.reduce(
(acc, indexOrHeight, i) => {
const isIndex = i % 2 === 0;
if (isIndex) {
acc.push({ index: indexOrHeight, height: 0 });
} else {
acc[acc.length - 1].height = indexOrHeight;
}
return acc;
},
[] as { index: number; height: number }[]
);

expect(ex.size).toBe(checks.length);

Expand Down
2 changes: 1 addition & 1 deletion tsconfig.dev.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"target": "es6"
"target": "ES2022"
},
"typedocOptions": {
"name": "Lineupengine",
Expand Down
Loading

0 comments on commit 6f9e346

Please sign in to comment.