flint-compiler 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +54 -0
- package/dist/errors/index.d.ts +34 -0
- package/dist/errors/index.d.ts.map +1 -0
- package/dist/errors/index.js +110 -0
- package/dist/errors/index.js.map +1 -0
- package/dist/index.d.ts +31 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +61 -0
- package/dist/index.js.map +1 -0
- package/dist/optimizer/index.d.ts +178 -0
- package/dist/optimizer/index.d.ts.map +1 -0
- package/dist/optimizer/index.js +1045 -0
- package/dist/optimizer/index.js.map +1 -0
- package/dist/parser/index.d.ts +25 -0
- package/dist/parser/index.d.ts.map +1 -0
- package/dist/parser/index.js +93 -0
- package/dist/parser/index.js.map +1 -0
- package/dist/transformer/index.d.ts +32 -0
- package/dist/transformer/index.d.ts.map +1 -0
- package/dist/transformer/index.js +566 -0
- package/dist/transformer/index.js.map +1 -0
- package/package.json +54 -0
package/README.md
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# @flint/compiler
|
|
2
|
+
|
|
3
|
+
> The Flint JSX compiler — transforms JSX with auto-imports and optimizations
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @flint/compiler
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
The compiler is typically used via the Vite plugin:
|
|
14
|
+
|
|
15
|
+
```javascript
|
|
16
|
+
// vite.config.js
|
|
17
|
+
import { defineConfig } from 'vite'
|
|
18
|
+
import flint from '@flint/vite-plugin'
|
|
19
|
+
|
|
20
|
+
export default defineConfig({
|
|
21
|
+
plugins: [flint()]
|
|
22
|
+
})
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Features
|
|
26
|
+
|
|
27
|
+
- **Auto-imports** — no need to import `state`, `computed`, `effect`, `render`
|
|
28
|
+
- **JSX transformation** — converts JSX to efficient DOM operations
|
|
29
|
+
- **Optimizations** — dead code elimination, tree shaking
|
|
30
|
+
- **Source maps** — full source map support for debugging
|
|
31
|
+
- **TypeScript** — full TypeScript support
|
|
32
|
+
|
|
33
|
+
## Manual Usage
|
|
34
|
+
|
|
35
|
+
```typescript
|
|
36
|
+
import { parse, transform, compile } from '@flint/compiler'
|
|
37
|
+
|
|
38
|
+
const ast = parse('<div>Hello</div>')
|
|
39
|
+
const transformed = transform(ast)
|
|
40
|
+
const code = compile(transformed)
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Auto-Imported Symbols
|
|
44
|
+
|
|
45
|
+
The following symbols are automatically available without importing:
|
|
46
|
+
|
|
47
|
+
- `state`, `computed`, `effect`, `batch`
|
|
48
|
+
- `render`, `h`, `Show`, `When`, `For`
|
|
49
|
+
- `ref`, `onMount`, `onUpdate`, `onDestroy`
|
|
50
|
+
- And more...
|
|
51
|
+
|
|
52
|
+
## License
|
|
53
|
+
|
|
54
|
+
MIT
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export interface CompilerError {
|
|
2
|
+
message: string;
|
|
3
|
+
file?: string;
|
|
4
|
+
line?: number;
|
|
5
|
+
column?: number;
|
|
6
|
+
suggestion?: string;
|
|
7
|
+
/** The source line(s) of code where the error occurred */
|
|
8
|
+
sourceLine?: string;
|
|
9
|
+
/** Likely causes shown as a bullet list */
|
|
10
|
+
causes?: string[];
|
|
11
|
+
/** Raw technical detail (shown in verbose/advanced mode) */
|
|
12
|
+
raw?: string;
|
|
13
|
+
}
|
|
14
|
+
export declare function createCompilerError(message: string, options?: {
|
|
15
|
+
file?: string;
|
|
16
|
+
line?: number;
|
|
17
|
+
column?: number;
|
|
18
|
+
suggestion?: string;
|
|
19
|
+
raw?: string;
|
|
20
|
+
}): CompilerError;
|
|
21
|
+
/**
|
|
22
|
+
* Guess likely causes from a parse/transform error message.
|
|
23
|
+
* Ordered by commonality in real-world JSX projects.
|
|
24
|
+
*/
|
|
25
|
+
export declare function guessCauses(message: string): string[];
|
|
26
|
+
/**
|
|
27
|
+
* Build a code frame: the offending source line with a caret at the column.
|
|
28
|
+
*/
|
|
29
|
+
export declare function codeFrame(source: string, line: number, column: number, context?: number): string;
|
|
30
|
+
/**
|
|
31
|
+
* Format a compiler error for display to humans.
|
|
32
|
+
*/
|
|
33
|
+
export declare function formatCompilerError(error: CompilerError): string;
|
|
34
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/errors/index.ts"],"names":[],"mappings":"AA6BA,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,0DAA0D;IAC1D,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,2CAA2C;IAC3C,MAAM,CAAC,EAAE,MAAM,EAAE,CAAA;IACjB,4DAA4D;IAC5D,GAAG,CAAC,EAAE,MAAM,CAAA;CACb;AAED,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,MAAM,EACf,OAAO,GAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CAAO,GACjG,aAAa,CAKf;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CA4BrD;AAED;;GAEG;AACH,wBAAgB,SAAS,CACvB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EACd,OAAO,SAAI,GACV,MAAM,CAoBR;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,aAAa,GAAG,MAAM,CAkChE"}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
// Flint Compiler — Error Messages
|
|
2
|
+
// Actionable, human-readable error messages with code frames
|
|
3
|
+
//
|
|
4
|
+
// Raw parser errors like "Unexpected token (12:4)" are useless to beginners.
|
|
5
|
+
// Flint renders the offending line with a caret, the file, and likely causes
|
|
6
|
+
// plus a fix — while keeping the raw detail available for advanced users.
|
|
7
|
+
const ANSI = {
|
|
8
|
+
reset: '\x1b[0m',
|
|
9
|
+
red: '\x1b[31m',
|
|
10
|
+
yellow: '\x1b[33m',
|
|
11
|
+
cyan: '\x1b[36m',
|
|
12
|
+
gray: '\x1b[90m',
|
|
13
|
+
bold: '\x1b[1m',
|
|
14
|
+
};
|
|
15
|
+
function supportsColor() {
|
|
16
|
+
return (typeof process !== 'undefined' &&
|
|
17
|
+
process.stdout?.isTTY === true &&
|
|
18
|
+
process.env?.NO_COLOR === undefined);
|
|
19
|
+
}
|
|
20
|
+
function colorize(text, ...codes) {
|
|
21
|
+
if (!supportsColor())
|
|
22
|
+
return text;
|
|
23
|
+
return codes.join('') + text + ANSI.reset;
|
|
24
|
+
}
|
|
25
|
+
export function createCompilerError(message, options = {}) {
|
|
26
|
+
return {
|
|
27
|
+
message,
|
|
28
|
+
...options,
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Guess likely causes from a parse/transform error message.
|
|
33
|
+
* Ordered by commonality in real-world JSX projects.
|
|
34
|
+
*/
|
|
35
|
+
export function guessCauses(message) {
|
|
36
|
+
const causes = [];
|
|
37
|
+
const msg = message.toLowerCase();
|
|
38
|
+
if (msg.includes('unexpected token') || msg.includes('unexpected character')) {
|
|
39
|
+
causes.push('A tag, brace, or parenthesis is missing or mismatched', 'JSX is used inside a .js file that the tooling does not treat as JSX', 'An unclosed string or template literal earlier in the file');
|
|
40
|
+
}
|
|
41
|
+
else if (msg.includes('unexpected end') || msg.includes('unterminated')) {
|
|
42
|
+
causes.push('A tag, brace, or parenthesis opened earlier was never closed', 'A string or template literal is missing its closing quote/backtick');
|
|
43
|
+
}
|
|
44
|
+
else if (msg.includes('jsx')) {
|
|
45
|
+
causes.push('The file contains JSX but may not be recognized as a JSX file', 'Self-closing tags must be written as <Tag />, and every tag must be closed');
|
|
46
|
+
}
|
|
47
|
+
else if (msg.includes('reserved') || msg.includes('keyword')) {
|
|
48
|
+
causes.push('A reserved JavaScript keyword is used as a variable or prop name');
|
|
49
|
+
}
|
|
50
|
+
if (causes.length === 0) {
|
|
51
|
+
causes.push('The syntax near this position is not valid JavaScript/JSX');
|
|
52
|
+
}
|
|
53
|
+
return causes;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Build a code frame: the offending source line with a caret at the column.
|
|
57
|
+
*/
|
|
58
|
+
export function codeFrame(source, line, column, context = 1) {
|
|
59
|
+
const lines = source.split('\n');
|
|
60
|
+
const start = Math.max(0, line - 1 - context);
|
|
61
|
+
const end = Math.min(lines.length, line + context);
|
|
62
|
+
const gutterWidth = String(end).length;
|
|
63
|
+
const frames = [];
|
|
64
|
+
for (let i = start; i < end; i++) {
|
|
65
|
+
const num = i + 1;
|
|
66
|
+
const text = lines[i] ?? '';
|
|
67
|
+
const isCaret = num === line;
|
|
68
|
+
const gutter = String(num).padStart(gutterWidth, ' ');
|
|
69
|
+
const prefix = isCaret ? colorize('>', ANSI.red, ANSI.bold) : ' ';
|
|
70
|
+
frames.push(`${prefix} ${colorize(gutter + ' │', ANSI.gray)} ${text}`);
|
|
71
|
+
if (isCaret && column >= 0) {
|
|
72
|
+
const caretPad = ' '.repeat(Math.min(column, text.length));
|
|
73
|
+
frames.push(` ${colorize(gutter + ' │', ANSI.gray)} ${colorize(caretPad + '^', ANSI.red, ANSI.bold)}`);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
return frames.join('\n');
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Format a compiler error for display to humans.
|
|
80
|
+
*/
|
|
81
|
+
export function formatCompilerError(error) {
|
|
82
|
+
let output = `\n${colorize('❌ ' + error.message, ANSI.red, ANSI.bold)}`;
|
|
83
|
+
if (error.file || error.line !== undefined) {
|
|
84
|
+
const where = [
|
|
85
|
+
error.file,
|
|
86
|
+
error.line !== undefined ? `${error.line}${error.column !== undefined ? ':' + error.column : ''}` : undefined,
|
|
87
|
+
]
|
|
88
|
+
.filter(Boolean)
|
|
89
|
+
.join(', ');
|
|
90
|
+
output += `\n\n${colorize('📄 ' + where, ANSI.cyan)}`;
|
|
91
|
+
}
|
|
92
|
+
if (error.sourceLine && error.line !== undefined) {
|
|
93
|
+
output += `\n\n${codeFrame(error.sourceLine, error.line, error.column ?? 0)}`;
|
|
94
|
+
}
|
|
95
|
+
if (error.causes && error.causes.length > 0) {
|
|
96
|
+
output += `\n\n${colorize('Kemungkinan penyebab / Likely causes:', ANSI.bold)}`;
|
|
97
|
+
for (const cause of error.causes) {
|
|
98
|
+
output += `\n • ${cause}`;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
if (error.suggestion) {
|
|
102
|
+
output += `\n\n${colorize('💡 ' + error.suggestion, ANSI.yellow)}`;
|
|
103
|
+
}
|
|
104
|
+
if (error.raw) {
|
|
105
|
+
output += `\n\n${colorize('── technical detail ' + '─'.repeat(40), ANSI.gray)}\n${colorize(error.raw, ANSI.gray)}`;
|
|
106
|
+
}
|
|
107
|
+
output += '\n';
|
|
108
|
+
return output;
|
|
109
|
+
}
|
|
110
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/errors/index.ts"],"names":[],"mappings":"AAAA,kCAAkC;AAClC,6DAA6D;AAC7D,EAAE;AACF,6EAA6E;AAC7E,6EAA6E;AAC7E,0EAA0E;AAE1E,MAAM,IAAI,GAAG;IACX,KAAK,EAAE,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C"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export { parse } from './parser/index.js';
|
|
2
|
+
export { transform } from './transformer/index.js';
|
|
3
|
+
export { createCompilerError, formatCompilerError, guessCauses, codeFrame, } from './errors/index.js';
|
|
4
|
+
export type { CompilerError } from './errors/index.js';
|
|
5
|
+
export type { ParseOptions, ParseResult } from './parser/index.js';
|
|
6
|
+
export type { TransformOptions, TransformResult } from './transformer/index.js';
|
|
7
|
+
/** Shape of the failure object returned by compile() on error. */
|
|
8
|
+
export interface CompileFailure {
|
|
9
|
+
code: string;
|
|
10
|
+
error: Error;
|
|
11
|
+
/** Formatted, human-friendly report ready to print (code frame + causes) */
|
|
12
|
+
formatted?: string;
|
|
13
|
+
line?: number;
|
|
14
|
+
column?: number;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Compile JSX/JavaScript source code into Flint runtime calls.
|
|
18
|
+
*
|
|
19
|
+
* On failure, returns the original code plus a richly formatted error:
|
|
20
|
+
* file, line:column, a caret code frame, likely causes, and a suggestion —
|
|
21
|
+
* while the raw error stays available for tooling.
|
|
22
|
+
*/
|
|
23
|
+
export declare function compile(code: string, options?: {
|
|
24
|
+
filename?: string;
|
|
25
|
+
dev?: boolean;
|
|
26
|
+
sourceType?: 'module' | 'script';
|
|
27
|
+
}): {
|
|
28
|
+
code: string;
|
|
29
|
+
error?: Error;
|
|
30
|
+
};
|
|
31
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AAClD,OAAO,EACL,mBAAmB,EACnB,mBAAmB,EACnB,WAAW,EACX,SAAS,GACV,MAAM,mBAAmB,CAAA;AAC1B,YAAY,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AACtD,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAClE,YAAY,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AAE/E,kEAAkE;AAClE,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,KAAK,CAAA;IACZ,4EAA4E;IAC5E,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAkBD;;;;;;GAMG;AACH,wBAAgB,OAAO,CACrB,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE;IACP,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,GAAG,CAAC,EAAE,OAAO,CAAA;IACb,UAAU,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAA;CAC5B,GACL;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,KAAK,CAAA;CAAE,CAsCjC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
// Flint Compiler — Main Entry Point
|
|
2
|
+
import { parse as doParse } from './parser/index.js';
|
|
3
|
+
import { transform as doTransform } from './transformer/index.js';
|
|
4
|
+
import { createCompilerError, formatCompilerError, guessCauses, } from './errors/index.js';
|
|
5
|
+
export { parse } from './parser/index.js';
|
|
6
|
+
export { transform } from './transformer/index.js';
|
|
7
|
+
export { createCompilerError, formatCompilerError, guessCauses, codeFrame, } from './errors/index.js';
|
|
8
|
+
/**
|
|
9
|
+
* Extract line/column from an acorn-style error message ("(12:4)") and
|
|
10
|
+
* grab the offending source line for the code frame.
|
|
11
|
+
*/
|
|
12
|
+
function locateError(err, code) {
|
|
13
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
14
|
+
const match = /\((\d+):(\d+)\)\s*$/.exec(message.trim());
|
|
15
|
+
if (!match)
|
|
16
|
+
return {};
|
|
17
|
+
const line = parseInt(match[1], 10);
|
|
18
|
+
const column = parseInt(match[2], 10);
|
|
19
|
+
const lines = code.split('\n');
|
|
20
|
+
const sourceLine = line >= 1 && line <= lines.length ? lines[line - 1] : undefined;
|
|
21
|
+
return { line, column, sourceLine };
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Compile JSX/JavaScript source code into Flint runtime calls.
|
|
25
|
+
*
|
|
26
|
+
* On failure, returns the original code plus a richly formatted error:
|
|
27
|
+
* file, line:column, a caret code frame, likely causes, and a suggestion —
|
|
28
|
+
* while the raw error stays available for tooling.
|
|
29
|
+
*/
|
|
30
|
+
export function compile(code, options = {}) {
|
|
31
|
+
try {
|
|
32
|
+
const { ast } = doParse(code, {
|
|
33
|
+
sourceType: options.sourceType,
|
|
34
|
+
filename: options.filename,
|
|
35
|
+
});
|
|
36
|
+
const result = doTransform(ast, code, {
|
|
37
|
+
filename: options.filename,
|
|
38
|
+
dev: options.dev,
|
|
39
|
+
});
|
|
40
|
+
return { code: result.code };
|
|
41
|
+
}
|
|
42
|
+
catch (err) {
|
|
43
|
+
const error = err instanceof Error ? err : new Error(String(err));
|
|
44
|
+
const { line, column, sourceLine } = locateError(error, code);
|
|
45
|
+
const compilerError = createCompilerError('Could not compile this file', {
|
|
46
|
+
file: options.filename,
|
|
47
|
+
line,
|
|
48
|
+
column,
|
|
49
|
+
suggestion: 'Fix the syntax at the marked position, then save the file again.',
|
|
50
|
+
raw: `${error.name}: ${error.message}`,
|
|
51
|
+
});
|
|
52
|
+
compilerError.causes = guessCauses(error.message);
|
|
53
|
+
compilerError.sourceLine = sourceLine;
|
|
54
|
+
return {
|
|
55
|
+
code,
|
|
56
|
+
error,
|
|
57
|
+
formatted: formatCompilerError(compilerError),
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+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|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
type ASTNode = any;
|
|
2
|
+
export interface OptimizationOptions {
|
|
3
|
+
/** Enable dead code elimination */
|
|
4
|
+
deadCodeElimination: boolean;
|
|
5
|
+
/** Enable constant folding */
|
|
6
|
+
constantFolding: boolean;
|
|
7
|
+
/** Enable dead store elimination */
|
|
8
|
+
deadStoreElimination: boolean;
|
|
9
|
+
/** Enable function inlining */
|
|
10
|
+
functionInlining: boolean;
|
|
11
|
+
/** Enable JSX optimization */
|
|
12
|
+
jsxOptimization: boolean;
|
|
13
|
+
/** Enable tree-shaking hints */
|
|
14
|
+
treeShaking: boolean;
|
|
15
|
+
/** Enable static subtree hoisting (React.memo-like) */
|
|
16
|
+
staticHoisting: boolean;
|
|
17
|
+
/** Enable compile-time CSS scoping */
|
|
18
|
+
cssScoping: boolean;
|
|
19
|
+
/** Enable auto-memoization (React Compiler-like) */
|
|
20
|
+
autoMemoization: boolean;
|
|
21
|
+
/** Minification level (0-3) */
|
|
22
|
+
minificationLevel: 0 | 1 | 2 | 3;
|
|
23
|
+
}
|
|
24
|
+
export interface OptimizationResult {
|
|
25
|
+
code: string;
|
|
26
|
+
ast: ASTNode;
|
|
27
|
+
warnings: OptimizationWarning[];
|
|
28
|
+
stats: OptimizationStats;
|
|
29
|
+
/** CSS scopes extracted during optimization */
|
|
30
|
+
cssScopes?: CSSScope[];
|
|
31
|
+
}
|
|
32
|
+
export interface OptimizationWarning {
|
|
33
|
+
type: 'dead_code' | 'unused_variable' | 'side_effect' | 'performance' | 'static_hoist';
|
|
34
|
+
message: string;
|
|
35
|
+
line?: number;
|
|
36
|
+
column?: number;
|
|
37
|
+
}
|
|
38
|
+
export interface OptimizationStats {
|
|
39
|
+
originalSize: number;
|
|
40
|
+
optimizedSize: number;
|
|
41
|
+
reduction: number;
|
|
42
|
+
eliminatedNodes: number;
|
|
43
|
+
inlinedFunctions: number;
|
|
44
|
+
constantFolds: number;
|
|
45
|
+
staticHoisted: number;
|
|
46
|
+
autoMemoized: number;
|
|
47
|
+
}
|
|
48
|
+
export interface CSSScope {
|
|
49
|
+
id: string;
|
|
50
|
+
selector: string;
|
|
51
|
+
css: string;
|
|
52
|
+
hash: string;
|
|
53
|
+
}
|
|
54
|
+
export declare class Optimizer {
|
|
55
|
+
private options;
|
|
56
|
+
private warnings;
|
|
57
|
+
private stats;
|
|
58
|
+
constructor(options?: Partial<OptimizationOptions>);
|
|
59
|
+
/**
|
|
60
|
+
* Optimize AST
|
|
61
|
+
*/
|
|
62
|
+
optimize(ast: ASTNode): OptimizationResult;
|
|
63
|
+
private cloneAST;
|
|
64
|
+
private eliminateDeadCode;
|
|
65
|
+
private foldConstants;
|
|
66
|
+
private eliminateDeadStores;
|
|
67
|
+
private inlineFunctions;
|
|
68
|
+
private optimizeJSX;
|
|
69
|
+
private evaluateConstant;
|
|
70
|
+
private evaluateBinary;
|
|
71
|
+
private evaluateUnary;
|
|
72
|
+
private evaluateLogical;
|
|
73
|
+
private createLiteral;
|
|
74
|
+
private isSmallExpression;
|
|
75
|
+
private substituteParams;
|
|
76
|
+
private hasSideEffects;
|
|
77
|
+
private generateCode;
|
|
78
|
+
/**
|
|
79
|
+
* Convert AST node to JavaScript code string
|
|
80
|
+
*/
|
|
81
|
+
private astToCode;
|
|
82
|
+
/**
|
|
83
|
+
* Automatically memoize expensive computations.
|
|
84
|
+
* Similar to React Compiler's auto-memoization — eliminates the need for manual useMemo/useCallback.
|
|
85
|
+
*/
|
|
86
|
+
private autoMemoize;
|
|
87
|
+
}
|
|
88
|
+
export interface TreeShakeOptions {
|
|
89
|
+
/** Entry points */
|
|
90
|
+
entryPoints: string[];
|
|
91
|
+
/** Mark functions as side-effect free */
|
|
92
|
+
sideEffectFree: Set<string>;
|
|
93
|
+
/** Export analysis */
|
|
94
|
+
analyzeExports: boolean;
|
|
95
|
+
}
|
|
96
|
+
export interface TreeShakeResult {
|
|
97
|
+
kept: string[];
|
|
98
|
+
eliminated: string[];
|
|
99
|
+
warnings: string[];
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Analyze and tree-shake unused exports
|
|
103
|
+
*/
|
|
104
|
+
export declare function treeShake(code: string, options: TreeShakeOptions): TreeShakeResult;
|
|
105
|
+
export interface BundleAnalysis {
|
|
106
|
+
size: number;
|
|
107
|
+
gzipSize: number;
|
|
108
|
+
modules: ModuleInfo[];
|
|
109
|
+
dependencies: string[];
|
|
110
|
+
peerDependencies: string[];
|
|
111
|
+
}
|
|
112
|
+
export interface ModuleInfo {
|
|
113
|
+
name: string;
|
|
114
|
+
size: number;
|
|
115
|
+
exports: string[];
|
|
116
|
+
sideEffects: boolean;
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Analyze bundle for optimization opportunities
|
|
120
|
+
*/
|
|
121
|
+
export declare function analyzeBundle(code: string, moduleName: string): BundleAnalysis;
|
|
122
|
+
export declare const DEAD_CODE_PATTERNS: RegExp[];
|
|
123
|
+
export declare const SIDE_EFFECT_FREE_FUNCTIONS: Set<string>;
|
|
124
|
+
/**
|
|
125
|
+
* Identify and hoist static JSX subtrees.
|
|
126
|
+
* Static elements (no dynamic expressions) can be created once and reused.
|
|
127
|
+
*
|
|
128
|
+
* @example
|
|
129
|
+
* // Before hoisting
|
|
130
|
+
* function App() {
|
|
131
|
+
* return <div><Header /><StaticContent /><Footer /></div>
|
|
132
|
+
* }
|
|
133
|
+
*
|
|
134
|
+
* // After hoisting — StaticContent is hoisted outside the function
|
|
135
|
+
* const _hoisted_0 = <StaticContent />
|
|
136
|
+
* function App() {
|
|
137
|
+
* return <div><Header />{_hoisted_0}<Footer /></div>
|
|
138
|
+
* }
|
|
139
|
+
*/
|
|
140
|
+
export declare function hoistStaticSubtrees(ast: ASTNode, code: string): {
|
|
141
|
+
ast: ASTNode;
|
|
142
|
+
code: string;
|
|
143
|
+
hoisted: number;
|
|
144
|
+
};
|
|
145
|
+
export declare function autoMemoize(ast: ASTNode): {
|
|
146
|
+
ast: ASTNode;
|
|
147
|
+
memoized: number;
|
|
148
|
+
};
|
|
149
|
+
/**
|
|
150
|
+
* Scope CSS to components at compile time.
|
|
151
|
+
* Generates unique class names and injects scoped styles.
|
|
152
|
+
*
|
|
153
|
+
* @example
|
|
154
|
+
* // Input
|
|
155
|
+
* <style>
|
|
156
|
+
* .container { padding: 16px; }
|
|
157
|
+
* .title { font-size: 24px; }
|
|
158
|
+
* </style>
|
|
159
|
+
* <div class="container">
|
|
160
|
+
* <h1 class="title">Hello</h1>
|
|
161
|
+
* </div>
|
|
162
|
+
*
|
|
163
|
+
* // Output (with scope hash "abc123")
|
|
164
|
+
* <style>
|
|
165
|
+
* .container[data-scoped-abc123] { padding: 16px; }
|
|
166
|
+
* .title[data-scoped-abc123] { font-size: 24px; }
|
|
167
|
+
* </style>
|
|
168
|
+
* <div class="container" data-scoped-abc123>
|
|
169
|
+
* <h1 class="title" data-scoped-abc123>Hello</h1>
|
|
170
|
+
* </div>
|
|
171
|
+
*/
|
|
172
|
+
export declare function scopeCSS(ast: ASTNode, code: string, componentName?: string): {
|
|
173
|
+
ast: ASTNode;
|
|
174
|
+
code: string;
|
|
175
|
+
scopes: CSSScope[];
|
|
176
|
+
};
|
|
177
|
+
export {};
|
|
178
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/optimizer/index.ts"],"names":[],"mappings":"AAOA,KAAK,OAAO,GAAG,GAAG,CAAA;AAElB,MAAM,WAAW,mBAAmB;IAClC,mCAAmC;IACnC,mBAAmB,EAAE,OAAO,CAAA;IAC5B,8BAA8B;IAC9B,eAAe,EAAE,OAAO,CAAA;IACxB,oCAAoC;IACpC,oBAAoB,EAAE,OAAO,CAAA;IAC7B,+BAA+B;IAC/B,gBAAgB,EAAE,OAAO,CAAA;IACzB,8BAA8B;IAC9B,eAAe,EAAE,OAAO,CAAA;IACxB,gCAAgC;IAChC,WAAW,EAAE,OAAO,CAA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