Updated JAEL to Dart 3

This commit is contained in:
thomashii@dukefirehawk.com 2023-05-27 07:27:47 +08:00
parent 85e7463afc
commit 981397791a
13 changed files with 86 additions and 72 deletions

View file

@ -3,19 +3,22 @@
## 8.0.0 ## 8.0.0
* Require Dart >= 3.0 * Require Dart >= 3.0
* Upgraded: angel3_http_exception * Updated: angel3_http_exception
* Upgraded: angel3_route * Updated: angel3_route
* Upgraded: angel3_model * Updated: angel3_model
* Upgraded: angel3_container * Updated: angel3_container
* Upgraded: angel3_container_generator * Updated: angel3_container_generator
* Upgraded: angel3_mock_request * Updated: angel3_mock_request
* Upgraded: angel3_framework * Updated: angel3_framework
* Upgraded: angel3_auth (4 failed test cases) * Updated: angel3_auth (4 failed test cases)
* Upgraded: angel3_configuration * Updated: angel3_configuration
* Upgraded: angel3_validate * Updated: angel3_validate
* Upgraded: angel3_client (1 failed test cases) * Updated: angel3_client (1 failed test cases)
* Upgraded: angel3_websocket (1 failed test cases) * Updated: angel3_websocket (1 failed test cases)
* Upgraded: angel3_test * Updated: angel3_test
* Updated: jael3
* Updated: jael3_preprocessor
* Updated: jael3_language_server
## 7.0.0 ## 7.0.0

View file

@ -1,5 +1,9 @@
# Change Log # Change Log
## 8.0.0
* Require Dart >= 3.0
## 7.0.0 ## 7.0.0
* Require Dart >= 2.17 * Require Dart >= 2.17

View file

@ -13,7 +13,7 @@ In your `pubspec.yaml`:
```yaml ```yaml
dependencies: dependencies:
angel3_jael: ^6.0.0 angel3_jael: ^8.0.0
``` ```
## Usage ## Usage

View file

@ -22,7 +22,7 @@ AngelConfigurer jael(Directory viewsDirectory,
bool asDSX = false, bool asDSX = false,
bool minified = true, bool minified = true,
CodeBuffer Function()? createBuffer}) { CodeBuffer Function()? createBuffer}) {
var _cache = cache ?? <String, Document>{}; var localCache = cache ?? <String, Document>{};
var bufferFunc = createBuffer ?? () => CodeBuffer(); var bufferFunc = createBuffer ?? () => CodeBuffer();
@ -37,14 +37,14 @@ AngelConfigurer jael(Directory viewsDirectory,
//var stopwatch = Stopwatch()..start(); //var stopwatch = Stopwatch()..start();
if (cacheViews && _cache.containsKey(name)) { if (cacheViews && localCache.containsKey(name)) {
processed = _cache[name]; processed = localCache[name];
} else { } else {
processed = await _loadViewTemplate(viewsDirectory, name, processed = await _loadViewTemplate(viewsDirectory, name,
fileExtension: fileExtension, asDSX: asDSX, patch: patch); fileExtension: fileExtension, asDSX: asDSX, patch: patch);
if (cacheViews) { if (cacheViews) {
_cache[name] = processed!; localCache[name] = processed!;
} }
} }
//print('Time executed: ${stopwatch.elapsed.inMilliseconds}'); //print('Time executed: ${stopwatch.elapsed.inMilliseconds}');

View file

@ -1,47 +1,47 @@
name: angel3_jael name: angel3_jael
version: 7.0.0 version: 8.0.0
description: Angel support for the Jael templating engine, similar to Blade or Liquid. description: Angel support for the Jael templating engine, similar to Blade or Liquid.
homepage: https://angel3-framework.web.app/ homepage: https://angel3-framework.web.app/
repository: https://github.com/dukefirehawk/angel/tree/master/packages/jael/angel_jael repository: https://github.com/dukefirehawk/angel/tree/master/packages/jael/angel_jael
environment: environment:
sdk: '>=3.0.0 <4.0.0' sdk: '>=3.0.0 <4.0.0'
dependencies: dependencies:
angel3_framework: ^7.0.0 angel3_framework: ^8.0.0
jael3: ^7.0.0 jael3: ^8.0.0
jael3_preprocessor: ^7.0.0 jael3_preprocessor: ^8.0.0
belatuk_code_buffer: ^4.0.0 belatuk_code_buffer: ^5.0.0
belatuk_symbol_table: ^4.0.0 belatuk_symbol_table: ^5.0.0
file: ^6.0.0 file: ^7.0.0
logging: ^1.0.1 logging: ^1.2.0
dev_dependencies: dev_dependencies:
angel3_test: ^7.0.0 angel3_test: ^8.0.0
html: ^0.15.0 html: ^0.15.0
test: ^1.21.0 test: ^1.24.0
lints: ^2.0.0 lints: ^2.1.0
# dependency_overrides: dependency_overrides:
# angel3_container: angel3_container:
# path: ../../container/angel_container path: ../../container/angel_container
# angel3_framework: angel3_framework:
# path: ../../framework path: ../../framework
# angel3_http_exception: angel3_http_exception:
# path: ../../http_exception path: ../../http_exception
# angel3_model: angel3_model:
# path: ../../model path: ../../model
# angel3_route: angel3_route:
# path: ../../route path: ../../route
# angel3_mock_request: angel3_mock_request:
# path: ../../mock_request path: ../../mock_request
# angel3_auth: angel3_auth:
# path: ../../auth path: ../../auth
# angel3_client: angel3_client:
# path: ../../client path: ../../client
# angel3_websocket: angel3_websocket:
# path: ../../websocket path: ../../websocket
# angel3_validate: angel3_validate:
# path: ../../validate path: ../../validate
# angel3_test: angel3_test:
# path: ../../test path: ../../test
# jael3: jael3:
# path: ../jael path: ../jael
# jael3_preprocessor: jael3_preprocessor:
# path: ../jael_preprocessor path: ../jael_preprocessor

View file

@ -13,7 +13,7 @@ In your `pubspec.yaml`:
```yaml ```yaml
dependencies: dependencies:
jael3_prepreprocessor: ^6.0.0 jael3_prepreprocessor: ^8.0.0
``` ```
## Usage ## Usage

View file

@ -1,5 +1,9 @@
# Change Log # Change Log
## 8.0.0
* Require Dart >= 3.0
## 7.1.1 ## 7.1.1
* Added `exclusive` parameter to `createSync` * Added `exclusive` parameter to `createSync`

View file

@ -5,3 +5,7 @@
Experimental virtual DOM/SPA engine built on Jael. Supports SSR. Experimental virtual DOM/SPA engine built on Jael. Supports SSR.
**Not ready for production use.** **Not ready for production use.**
## TODO
* Builder failed to generate the class

View file

@ -6,7 +6,7 @@ part of 'main.dart';
// JaelComponentGenerator // JaelComponentGenerator
// ************************************************************************** // **************************************************************************
abstract class _HelloJaelTemplate implements Component<dynamic> { mixin _HelloJaelTemplate implements Component<dynamic> {
DateTime get now; DateTime get now;
@override @override
DomNode render() { DomNode render() {

View file

@ -6,7 +6,7 @@ part of 'stateful.dart';
// JaelComponentGenerator // JaelComponentGenerator
// ************************************************************************** // **************************************************************************
abstract class _StatefulAppJaelTemplate implements Component<_AppState> { mixin _StatefulAppJaelTemplate implements Component<_AppState> {
//Timer? get _timer; //Timer? get _timer;
@override @override
void beforeDestroy(); void beforeDestroy();

View file

@ -6,7 +6,7 @@ part of 'using_components.dart';
// JaelComponentGenerator // JaelComponentGenerator
// ************************************************************************** // **************************************************************************
abstract class _MyAppJaelTemplate implements Component<dynamic> { mixin _MyAppJaelTemplate implements Component<dynamic> {
@override @override
DomNode render() { DomNode render() {
return h('div', {}, [ return h('div', {}, [
@ -16,7 +16,7 @@ abstract class _MyAppJaelTemplate implements Component<dynamic> {
} }
} }
abstract class _LabeledInputJaelTemplate implements Component<dynamic> { mixin _LabeledInputJaelTemplate implements Component<dynamic> {
String? get name; String? get name;
@override @override
DomNode render() { DomNode render() {

View file

@ -60,9 +60,8 @@ class JaelComponentGenerator extends GeneratorForAnnotation<Jael> {
} }
// Generate a _XJaelTemplate mixin class // Generate a _XJaelTemplate mixin class
var clazz = Class((b) { var clazz = Mixin((b) {
b b
..abstract = true
..name = '_${element.name}JaelTemplate' ..name = '_${element.name}JaelTemplate'
..implements.add(convertTypeReference(element.supertype)); ..implements.add(convertTypeReference(element.supertype));

View file

@ -1,5 +1,5 @@
name: jael3_web name: jael3_web
version: 7.1.1 version: 8.0.0
description: Experimental virtual DOM/SPA engine built on Jael3. Supports SSR. description: Experimental virtual DOM/SPA engine built on Jael3. Supports SSR.
publish_to: none publish_to: none
environment: environment:
@ -9,15 +9,15 @@ dependencies:
build: ^2.0.2 build: ^2.0.2
build_config: ^1.0.0 build_config: ^1.0.0
code_builder: ^4.0.0 code_builder: ^4.0.0
file: ^6.1.4 file: ^7.0.0
path: ^1.8.2 path: ^1.8.0
jael3: ^7.0.0 jael3: ^8.0.0
jael3_preprocessor: ^7.0.0 jael3_preprocessor: ^8.0.0
source_gen: ^1.0.2 source_gen: ^1.3.0
dev_dependencies: dev_dependencies:
build_runner: ^2.0.4 build_runner: ^2.4.0
build_web_compilers: ^3.0.0 build_web_compilers: ^4.0.0
lints: ^2.0.0 lints: ^2.1.0
dependency_overrides: dependency_overrides:
jael3: jael3:
path: ../jael path: ../jael