Skip to content

Commit

Permalink
实验了wasm,需要flutter channel beta , 文件加载慢,不如html模式适合web
Browse files Browse the repository at this point in the history
  • Loading branch information
chen56 committed Mar 23, 2024
1 parent 1719cf0 commit 9091d62
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 1,517 deletions.
2 changes: 2 additions & 0 deletions bake
Original file line number Diff line number Diff line change
Expand Up @@ -798,6 +798,8 @@ preview.web() {
build "$@"
# npx http-server ./flutter_note/build/web --port 8000
_exec flutter_note deno run --allow-env --allow-read --allow-sys --allow-net npm:http-server ./build/web --port 8000 -g --brotli
# flutter pub global activate dhttpd
# _exec flutter_note dhttpd --path ./build/web --port 8080 '--headers=Cross-Origin-Embedder-Policy=credentialless;Cross-Origin-Opener-Policy=same-origin'
}
web.serve() {
# http-server 不支持base href设置,所以单独build,并设置base-href为"/",而github-pages的base-href必须是repository名
Expand Down
10 changes: 5 additions & 5 deletions mate/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ dependencies:
flutter_highlight: ^0.7.0
highlight: ^0.7.0

analyzer: ^5.10.0
analyzer: ^6.4.1

note:

Expand All @@ -33,17 +33,17 @@ dependencies:

path: ^1.8.2
code_builder: ^4.4.0
file: ^6.1.4
shared_preferences: ^2.1.1
file: ^7.0.0
shared_preferences: ^2.2.2

dev_dependencies:

test:
flutter_test:
sdk: flutter
# 这俩不要貌似也没啥影响
flutter_lints: ^2.0.1
lints: ^2.0.1
flutter_lints: ^3.0.1
lints: ^3.0.0

dart_style: ^2.0.0
glob: ^2.1.1
6 changes: 3 additions & 3 deletions note/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ dependencies:
stack_trace: ^1.11.0
glob: ^2.1.1

file: ^6.1.0
file: ^7.0.0

shared_preferences: ^2.1.1
shared_preferences: ^2.2.2

# async: ^2.11.0
dev_dependencies:
flutter_test:
sdk: flutter
flutter_lints: ^2.0.0
flutter_lints: ^3.0.1

# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec
Expand Down
4 changes: 2 additions & 2 deletions note_tools/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ dependencies:
code_builder: ^4.4.0
dart_style: ^2.0.0
path: ^1.8.3
file: ^6.1.4
file: ^7.0.0
glob: ^2.1.1
analyzer: ^5.10.0
analyzer: ^6.4.1
watcher: ^1.0.2
# async: ^2.11.0

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import 'package:analyzer/dart/analysis/results.dart';
import 'package:analyzer/dart/analysis/utilities.dart';
import 'package:analyzer/dart/ast/ast.dart';
import 'package:analyzer/dart/ast/visitor.dart';
import 'package:flutter_note/notes/z_draft/other/dart/analyzer/to_source_visitor.dart';


main() {
Expand All @@ -24,8 +23,6 @@ read(File file) {
path: file.path, featureSet: FeatureSet.latestLanguageVersion());
CompilationUnit unit = result.unit;
unit.visitChildren(X());
StringBuffer sb = StringBuffer();
unit.visitChildren(Find(sb));
}

class X extends GeneralizingAstVisitor {
Expand Down Expand Up @@ -65,18 +62,3 @@ class X extends GeneralizingAstVisitor {
return node.parent == null ? 0 : level(node.parent!) + 1;
}
}

class Find extends ToSourceVisitor {
Find(super.sink);

@override
void visitClassDeclaration(ClassDeclaration node) {
ParamVisitor v = ParamVisitor(sink);
node.accept(v);
}
}

/// 参考[ToSourceVisitor]
class ParamVisitor extends ToSourceVisitor {
ParamVisitor(super.sink);
}
Loading

0 comments on commit 9091d62

Please sign in to comment.