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
* Require Dart >= 3.0
* Upgraded: angel3_http_exception
* Upgraded: angel3_route
* Upgraded: angel3_model
* Upgraded: angel3_container
* Upgraded: angel3_container_generator
* Upgraded: angel3_mock_request
* Upgraded: angel3_framework
* Upgraded: angel3_auth (4 failed test cases)
* Upgraded: angel3_configuration
* Upgraded: angel3_validate
* Upgraded: angel3_client (1 failed test cases)
* Upgraded: angel3_websocket (1 failed test cases)
* Upgraded: angel3_test
* Updated: angel3_http_exception
* Updated: angel3_route
* Updated: angel3_model
* Updated: angel3_container
* Updated: angel3_container_generator
* Updated: angel3_mock_request
* Updated: angel3_framework
* Updated: angel3_auth (4 failed test cases)
* Updated: angel3_configuration
* Updated: angel3_validate
* Updated: angel3_client (1 failed test cases)
* Updated: angel3_websocket (1 failed test cases)
* Updated: angel3_test
* Updated: jael3
* Updated: jael3_preprocessor
* Updated: jael3_language_server
## 7.0.0

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -6,7 +6,7 @@ part of 'using_components.dart';
// JaelComponentGenerator
// **************************************************************************
abstract class _MyAppJaelTemplate implements Component<dynamic> {
mixin _MyAppJaelTemplate implements Component<dynamic> {
@override
DomNode render() {
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;
@override
DomNode render() {

View file

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

View file

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