Skip to content

Commit e6d37ac

Browse files
committedFeb 12, 2021
feat: using springtype-types instead of internal ones; version bump
1 parent 30af1c9 commit e6d37ac

22 files changed

+39
-1739
lines changed
 

‎README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ For a more complex demo, see:
6262

6363
- ✅ React-like VDOM supporting native DOM access via `ref`
6464
- ✅ HTML/SVG-compatible `TSX` - supports standard `class`
65-
-~1k bundle size: `991 byte` (best, brotli) - `1244 byte` (worst, umd, gz)
65+
-~1k bundle size: `1140 byte` (best, brotli) - `1323 byte` (worst, umd, gz)
6666
- ✅ Zero dependencies
6767
- ✅ Purely functional
6868
- ✅ First class TypeScript support

‎jest.config.js

+15-15
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
process.env.BASE_PATH = __dirname;
22

33
module.exports = {
4-
globals: {
5-
"ts-jest": {
6-
diagnostics: false,
7-
tsconfig: "tsconfig.json"
8-
}
9-
},
10-
transform: {
11-
"^.+\\.tsx?$": "ts-jest"
12-
},
13-
testRegex: "(/(__test__)/.*|(\\.|/))\\.test\\.tsx?$",
14-
modulePathIgnorePatterns: ["/modules", "/_modules"],
15-
testPathIgnorePatterns: ["node_modules/", "dist/"],
16-
maxConcurrency: 25,
17-
moduleFileExtensions: ["ts", "tsx", "js", "jsx", "node", "json"],
18-
coveragePathIgnorePatterns: []
4+
globals: {
5+
'ts-jest': {
6+
diagnostics: false,
7+
tsconfig: 'tsconfig.json',
8+
},
9+
},
10+
transform: {
11+
'^.+\\.tsx?$': 'ts-jest',
12+
},
13+
testRegex: '(/(__test__)/.*|(\\.|/))\\.test\\.tsx?$',
14+
modulePathIgnorePatterns: ['/modules', '/_modules'],
15+
testPathIgnorePatterns: ['node_modules/', 'dist/'],
16+
maxConcurrency: 25,
17+
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'node', 'json'],
18+
coveragePathIgnorePatterns: [],
1919
};

‎package.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "springtype",
3-
"version": "3.2.3",
3+
"version": "3.2.4",
44
"publishConfig": {
55
"access": "public"
66
},
@@ -84,5 +84,8 @@
8484
"ts-jest": "^26.5.0",
8585
"ts-node": "^9.1.1",
8686
"typescript": "^4.1.3"
87+
},
88+
"dependencies": {
89+
"springtype-types": "^3.2.4"
8790
}
8891
}

‎src/global.dt.ts

-7
This file was deleted.

‎src/index.ts

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1+
export * from 'springtype-types';
2+
13
export * from './st/st';
24
export * from './vdom/tsx';
35
export * from './vdom/render';
4-
export * from './vdom/interface/props';
5-
export * from './vdom/interface/ref';
6-
export * from './vdom/interface/ivirtual-node';
7-
export * from './vdom/interface/ielement';

‎src/st/interface/i$st.ts

-19
This file was deleted.

‎src/st/st.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { I$st } from './interface/i$st';
1+
import { I$st } from 'springtype-types';
22

33
export const ST_KEY = '$st';
44

‎src/vdom/__test__/create-operations.test.tsx

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import { tsx, render } from '../..';
2-
import { IElement } from '../interface/ielement';
1+
import { tsx, render, IElement } from '../..';
32

43
describe('Renderer create operation', () => {
54
let parentDOMElement: IElement;

‎src/vdom/__test__/fnc.test.tsx

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import { render, tsx, st, ST_KEY } from '../..';
2-
import { IElement } from '../interface/ielement';
1+
import { render, tsx, st, ST_KEY, IElement } from '../..';
32

43
describe('Functional component', () => {
54
let parentDOMElement: IElement;

‎src/vdom/__test__/fragment.test.tsx

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import { render, tsx } from '../..';
2-
import { IElement } from '../interface/ielement';
1+
import { render, tsx, IElement } from '../..';
32

43
describe('Renderer an fragment', () => {
54
let parentDOMElement: IElement;

‎src/vdom/constants.ts

+3
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,6 @@ export const CLASS_ATTRIBUTE_NAME = 'class';
33
export const STYLE_ATTRIBUTE_NAME = 'style';
44
export const CLASS_NAME_ATTRIBUTE_NAME = 'className';
55
export const XLINK_ATTRIBUTE_NAME = 'xlink';
6+
export const REF_ATTRIBUTE_NAME = 'ref';
7+
8+
export const SVG_NAMESPACE = 'http://www.w3.org/2000/svg';

‎src/vdom/dom.ts

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
1-
import { IVirtualChildren, IVirtualNode, IVirtualNodeAttributes } from './interface/ivirtual-node';
1+
import { IElement, IVirtualChildren, IVirtualNode, IVirtualNodeAttributes } from 'springtype-types';
22
import { st, ST_KEY } from '../st/st';
3-
import { REF_ATTRIBUTE_NAME } from './interface/iattributes';
4-
import { IElement } from './interface/ielement';
53
import {
64
CLASS_ATTRIBUTE_NAME,
75
CLASS_NAME_ATTRIBUTE_NAME,
6+
REF_ATTRIBUTE_NAME,
87
STYLE_ATTRIBUTE_NAME,
8+
SVG_NAMESPACE,
99
XLINK_ATTRIBUTE_NAME,
1010
} from './constants';
1111

12-
const SVG_NAMESPACE = 'http://www.w3.org/2000/svg';
13-
1412
// istanbul ignore else
1513
if (!st.dom) {
1614
// DOM abstraction layer for manipulation

‎src/vdom/interface/iattributes.ts

-13
This file was deleted.

‎src/vdom/interface/idom.ts

-26
This file was deleted.

‎src/vdom/interface/ielement.ts

-5
This file was deleted.

‎src/vdom/interface/ivirtual-node.ts

-19
This file was deleted.

0 commit comments

Comments
 (0)
Please sign in to comment.