Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
113 commits
Select commit Hold shift + click to select a range
3d11a47
Add Pull Request Template
Victorcorcos Sep 4, 2025
27508b7
Add CLAUDE.md and AGENTS.md (symlink)
Victorcorcos Sep 4, 2025
3e98f3e
Update parsec/ to redirect to proper solution through load balancer
Victorcorcos Sep 4, 2025
f0cf3d5
Add parsec_web
Victorcorcos Sep 4, 2025
457dc57
Add parsec_platform_interface to detect custom function and handle di…
Victorcorcos Sep 4, 2025
3818a41
Update README
Victorcorcos Sep 4, 2025
2c7f764
Fill pull request template
Victorcorcos Sep 4, 2025
9b24a8f
Incorporate parsec-web into parsec_flutter + add automation to use we…
Victorcorcos Sep 4, 2025
16be849
Add parsec_web_lib
Victorcorcos Sep 4, 2025
3c9b447
Add a file responsible to validate integration of parsec-web into par…
Victorcorcos Sep 4, 2025
79eee4a
Add dynamic versions to pubspec.yaml looking to PATHs instead of decl…
Victorcorcos Sep 4, 2025
782a59f
Fix parsec web
Victorcorcos Sep 4, 2025
f33b68f
Untrack binary wasm files
Victorcorcos Sep 4, 2025
6787944
Remove changes of README.md and CLAUDE.md (the solution of load balan…
Victorcorcos Sep 4, 2025
a2ab3a3
Replace complex load balancing regarding custom functions to just web…
Victorcorcos Sep 4, 2025
5c60c7f
successfully clean up all the outdated references to the old load bal…
Victorcorcos Sep 4, 2025
e4e228f
Add newline to the end of files
Victorcorcos Sep 4, 2025
f97f328
Update README.md with instructions to run tests and app
Victorcorcos Sep 4, 2025
5df4631
Convert JSON result properly
Victorcorcos Sep 4, 2025
eea1f74
Update parsec web lib with master changes of parsec-web repo
Victorcorcos Sep 4, 2025
fb614a9
Use correct webassembly generate files instead of the spike/mocked one
Victorcorcos Sep 4, 2025
1385972
Update CLAUDE.md and README.md
Victorcorcos Sep 4, 2025
8d22dca
docs: remove CLAUDE.md/AGENTS.md from web PR; moved to separate PR
Victorcorcos Sep 4, 2025
6e85006
Merge remote-tracking branch 'upstream/main' into implement_parsec_web
Victorcorcos Sep 4, 2025
a4842d3
Remove **/wasm/** from .gitignore + Send javascript file resulted fro…
Victorcorcos Sep 5, 2025
943beb9
Change license to correct one
Victorcorcos Sep 5, 2025
4951e67
Remove the General Issues section
Victorcorcos Sep 5, 2025
bff5c53
Remove documentation from parsec.dart
Victorcorcos Sep 5, 2025
34efe65
Add tests
Victorcorcos Sep 5, 2025
047ccb7
Revert "Remove **/wasm/** from .gitignore + Send javascript file resu…
Victorcorcos Sep 5, 2025
65dfa3d
Add /local to .gitignore
Victorcorcos Sep 5, 2025
0f858c4
Replace assets/parsec-web by packages/parsec_web
Victorcorcos Sep 5, 2025
304e738
Merge remote-tracking branch 'upstream/main' into implement_parsec_web
Victorcorcos Sep 6, 2025
45d9c51
Merge remote-tracking branch 'upstream/main' into implement_parsec_web
Victorcorcos Sep 6, 2025
d2f0d52
Move parsec-web web library to inside parsec_web folder (merging the …
Victorcorcos Sep 6, 2025
4c2685e
Make flutter test work: `cd parsec/example && flutter test`
Victorcorcos Sep 6, 2025
6516353
Properly add parsec-web to gitmodules and use it in code setup of set…
Victorcorcos Sep 6, 2025
7b9c279
Update git submodules to make parsec-web work as a HTTP submodule
Victorcorcos Sep 6, 2025
897ef57
Update index.html
Victorcorcos Sep 6, 2025
8ce526e
chore(platform-interface): normalize native result parsing across pla…
Victorcorcos Sep 6, 2025
1234492
feat(web): align WASM result types and edge-case behavior with tests
Victorcorcos Sep 6, 2025
1d9a417
test(web): configure Chrome tests to use real ParsecWeb plugin
Victorcorcos Sep 6, 2025
92dbd9d
ci(web): add Chrome + WASM integration tests on GitHub Actions
Victorcorcos Sep 6, 2025
4449362
docs(web): update README with Web testing; improve pubspec descriptio…
Victorcorcos Sep 6, 2025
2c06dbf
test(web): add main WebAssembly integration test suite for Parsec
Victorcorcos Sep 6, 2025
2de33e0
Remove temporary file
Victorcorcos Sep 6, 2025
caed8bf
Merge remote-tracking branch 'upstream/main' into implement_parsec_web
Victorcorcos Sep 6, 2025
4146715
Fix analyzer
Victorcorcos Sep 6, 2025
28b1965
Fiz Parsec Analyze (CI Github Action)
Victorcorcos Sep 6, 2025
ca009f1
Fix Analyze parsec_android
Victorcorcos Sep 6, 2025
97dca51
Fix Analyze parsec
Victorcorcos Sep 6, 2025
94efc70
Fix Analyze parsec_web package
Victorcorcos Sep 6, 2025
8c5649b
Ignore files that are result from flutter commands
Victorcorcos Sep 6, 2025
ce42033
Fix Get FLutter dependencies
Victorcorcos Sep 6, 2025
afe26cf
Fix Setup Web Assets (missing Emscripten)
Victorcorcos Sep 6, 2025
8017af6
Remove invalid performance tests in web_tests workflow
Victorcorcos Sep 6, 2025
9fe175c
Fix "Test parsec-web npm package"
Victorcorcos Sep 6, 2025
f668abf
Make web_tests workflow run in all branches
Victorcorcos Sep 6, 2025
53a9326
example: move UI improvements to separate PR; revert example changes …
Victorcorcos Sep 6, 2025
0199744
Merge remote-tracking branch 'upstream/main' into implement_parsec_web
Victorcorcos Sep 7, 2025
0d1ec77
feat: implement Dart-based WebAssembly generation command
Victorcorcos Sep 7, 2025
09d3d5f
chore: update CI workflows to use Dart WASM generation
Victorcorcos Sep 7, 2025
e08999d
remove: delete obsolete setup_web_assets.sh script
Victorcorcos Sep 7, 2025
1f8a8f5
docs: update documentation for new Dart WASM generation
Victorcorcos Sep 7, 2025
8291824
docs: create a README.md and CHANGELOG.md inside the parsec_web direc…
Victorcorcos Sep 7, 2025
0e846f7
technicaldebt: remove unecessary comments, update code references, fi…
Victorcorcos Sep 7, 2025
277521e
Merge remote-tracking branch 'upstream/main' into implement_parsec_web
Victorcorcos Sep 7, 2025
a7c1ca6
Remove changes in index.html
Victorcorcos Sep 7, 2025
9dc3e93
Increase time limit for web_tests job
Victorcorcos Sep 7, 2025
7f7440f
Implement wasm artifact reuse between workflows (Upload & Download)
Victorcorcos Sep 7, 2025
743873f
Simplify solution by using evalRaw(equation) instead of eval(equation)
Victorcorcos Sep 8, 2025
b6e18ba
Update automated tests
Victorcorcos Sep 8, 2025
c6cbdfd
Update Documentation & Guidance
Victorcorcos Sep 8, 2025
0c4895c
Simplify code by using evalRaw
Victorcorcos Sep 8, 2025
6d6dfdd
Delete redundant file
Victorcorcos Sep 8, 2025
d0e7c70
Remove temporary file: validate_integration.sh
Victorcorcos Sep 8, 2025
0482fe6
Remove outdated workflow step
Victorcorcos Sep 8, 2025
68e2b99
Revert unnecessary async/await changes in main plugin
Victorcorcos Sep 8, 2025
8cab962
Simplify nan cases in ParsecPlatform
Victorcorcos Sep 9, 2025
c251377
Prepare parsec_web for publication v0.1.0
Victorcorcos Sep 9, 2025
77c4b19
Release parsec 0.4.0 with Web support
Victorcorcos Sep 9, 2025
5688689
Bump parsec to 0.4.1 for Web support release
Victorcorcos Sep 9, 2025
aea243b
Update parsec_web .pubignore with specific build artifacts
Victorcorcos Sep 9, 2025
074c191
Fix CI web tests by using local packages during testing
Victorcorcos Sep 9, 2025
9b182de
Fix YAML syntax error in web_tests.yml workflow
Victorcorcos Sep 9, 2025
b4e6d87
Standardize all packages to use hosted dependencies
Victorcorcos Sep 9, 2025
456350f
Remove export of parsec_eval_exception.dart
Victorcorcos Sep 9, 2025
24d4d9c
Upgrade parsec platform channel to 0.2.1
Victorcorcos Sep 9, 2025
706b397
Merge remote-tracking branch 'upstream/main' into implement_parsec_web
Victorcorcos Sep 9, 2025
1281994
Update submodule
Victorcorcos Sep 9, 2025
352bafa
Update .lock file
Victorcorcos Sep 9, 2025
02131d0
Update parsec_web to use path
Victorcorcos Sep 9, 2025
2e7b947
Pub.dev recommends to publish .lock files
Victorcorcos Sep 9, 2025
96e3c2a
Commit some .lock files
Victorcorcos Sep 9, 2025
9debfd6
Update parsec_platform_interface dependency to 0.2.1
Victorcorcos Sep 9, 2025
8f0ba7f
Add cleanest solution to avoid path errors as there will be PRs with …
Victorcorcos Sep 9, 2025
af143a9
Only in CI: Remove warning of "publishable packages can´t have ´path´…
Victorcorcos Sep 9, 2025
fe1210e
Revert "Only in CI: Remove warning of "publishable packages can´t hav…
Victorcorcos Sep 9, 2025
5e64fe5
Simplify the solution by adding `publish_to: none` instead of disabli…
Victorcorcos Sep 9, 2025
ce38971
Add flutter version 3.29.3
Victorcorcos Sep 9, 2025
d3db4e3
parsec version 0.4.1 -> 0.5.0
Victorcorcos Sep 9, 2025
103dba1
simplify parsec_web changelog
Victorcorcos Sep 9, 2025
75bc270
Update parsec_web LICENSE
Victorcorcos Sep 9, 2025
020a331
Simplify parsec_web/README.md
Victorcorcos Sep 9, 2025
f78418a
Revert "Simplify the solution by adding `publish_to: none` instead of…
Victorcorcos Sep 10, 2025
2dde7cf
CI) Add `publish_to: none`
Victorcorcos Sep 10, 2025
aa2bf2d
Simplify solution to suppress `path` dependencies in flutter_ci
Victorcorcos Sep 10, 2025
bdfc104
Patternize web_tests.yml
Victorcorcos Sep 10, 2025
2401320
Simplify flutter_ci: centralize `publish_to: none` handling
Victorcorcos Sep 10, 2025
abce3fc
Remove additional blank lins in flutter_ci.yml
Victorcorcos Sep 10, 2025
4bfb80d
Remove redundant step (done in flutter_ci)
Victorcorcos Sep 10, 2025
8cb1271
Move important info from parsec_web/README.md to parsec/README.md
Victorcorcos Sep 11, 2025
7c9f067
Remove not necessary pubspec.yml file change to a working version (it…
Victorcorcos Sep 11, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions .github/workflows/flutter_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,19 @@ jobs:
- name: Flutter version
run: flutter --version

- name: Suppress path dependency warnings (pre)
run: |
set -euo pipefail
for dir in parsec parsec_android parsec_linux parsec_windows parsec_web parsec_platform_interface; do
f="$dir/pubspec.yaml"
if [ -f "$f" ]; then
cp "$f" "$f.backup"
if ! grep -qE '^\s*publish_to:' "$f"; then
printf "\npublish_to: none\n" >> "$f"
fi
fi
done

- name: Analyze parsec_platform_interface
run: |
cd parsec_platform_interface
Expand All @@ -38,6 +51,20 @@ jobs:
- name: Analyze parsec
run: |
cd parsec
# Add dependency overrides for CI testing
echo "" >> pubspec.yaml
echo "dependency_overrides:" >> pubspec.yaml
echo " parsec_platform_interface:" >> pubspec.yaml
echo " path: ../parsec_platform_interface" >> pubspec.yaml
echo " parsec_android:" >> pubspec.yaml
echo " path: ../parsec_android" >> pubspec.yaml
echo " parsec_linux:" >> pubspec.yaml
echo " path: ../parsec_linux" >> pubspec.yaml
echo " parsec_windows:" >> pubspec.yaml
echo " path: ../parsec_windows" >> pubspec.yaml
echo " parsec_web:" >> pubspec.yaml
echo " path: ../parsec_web" >> pubspec.yaml

flutter pub get
flutter analyze --no-fatal-infos

Expand All @@ -59,3 +86,9 @@ jobs:
flutter pub get
flutter analyze --no-fatal-infos

- name: Analyze parsec_web
run: |
cd parsec_web
flutter pub get
flutter analyze --no-fatal-infos

163 changes: 163 additions & 0 deletions .github/workflows/web_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
name: Web Integration Tests

on:
push:
branches:
- '**'
pull_request:
branches:
- '**'
workflow_dispatch:

jobs:
web_tests:
name: Web Tests (WebAssembly)
runs-on: ubuntu-latest
timeout-minutes: 15

strategy:
matrix:
flutter_version: [3.19.0, 3.24.0, 3.29.3]

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive

- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: ${{ matrix.flutter_version }}
channel: stable
cache: true

- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y emscripten

- name: Install Chrome for Web testing
uses: browser-actions/setup-chrome@v1
with:
chrome-version: stable

- name: Generate Web Assets
run: |
cd parsec_web
dart bin/generate.dart

- name: Upload WASM artifacts
if: ${{ matrix.flutter_version == '3.29.3' }}
uses: actions/upload-artifact@v4
with:
name: parsec-web-wasm
path: |
parsec_web/lib/parsec-web/wasm/
retention-days: 3

- name: Get Flutter dependencies
run: |
cd parsec_platform_interface && flutter pub get
cd ../parsec_web && flutter pub get
cd ../parsec && flutter pub get

- name: Run parsec_web JavaScript tests (Node.js)
run: |
cd parsec_web/lib/parsec-web
npm install
npm test

- name: Run Flutter Web integration tests
run: |
cd parsec
# Backup original pubspec.yaml for publication
cp pubspec.yaml pubspec.yaml.backup

# Add dependency overrides to use local packages with WASM files
echo "" >> pubspec.yaml
echo "dependency_overrides:" >> pubspec.yaml
echo " # Use local packages for CI testing with WASM files" >> pubspec.yaml
echo " parsec_platform_interface:" >> pubspec.yaml
echo " path: ../parsec_platform_interface" >> pubspec.yaml
echo " parsec_web:" >> pubspec.yaml
echo " path: ../parsec_web" >> pubspec.yaml
echo " parsec_android:" >> pubspec.yaml
echo " path: ../parsec_android" >> pubspec.yaml
echo " parsec_linux:" >> pubspec.yaml
echo " path: ../parsec_linux" >> pubspec.yaml
echo " parsec_windows:" >> pubspec.yaml
echo " path: ../parsec_windows" >> pubspec.yaml

# Get dependencies with overrides
flutter pub get

# Run web tests with local packages
flutter test --platform chrome test/parsec_test.dart

# Restore original pubspec.yaml (publication-ready)
mv pubspec.yaml.backup pubspec.yaml


- name: Build Web example (validation)
run: |
cd parsec/example
flutter build web --release

- name: Upload test artifacts
if: failure()
uses: actions/upload-artifact@v4
with:
name: web-test-artifacts-${{ matrix.flutter_version }}
path: |
parsec/coverage/
parsec_web/lib/parsec-web/coverage/
parsec/test-results.xml
retention-days: 3

web_compatibility:
name: Web Compatibility Tests
runs-on: ubuntu-latest
needs: web_tests
timeout-minutes: 30

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive

- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: 3.29.3
channel: stable
cache: true

- name: Download WASM artifacts
uses: actions/download-artifact@v4
with:
name: parsec-web-wasm
path: parsec_web/lib/parsec-web/wasm

- name: Test parsec-web npm package
run: |
cd parsec_web/lib/parsec-web
npm install
npm test

- name: Validate WebAssembly module
run: |
cd parsec_web/lib/parsec-web
if [ -f wasm/equations_parser.js ]; then
file wasm/equations_parser.js
ls -la wasm/
else
echo "❌ WASM glue JS missing at wasm/equations_parser.js" && exit 1
fi

- name: Test JavaScript imports
run: |
cd parsec_web/lib/parsec-web
node -e "const E = require('./index.cjs'); console.log('✅ CommonJS works')"
node --input-type=module -e "import('./index.mjs').then(()=>console.log('✅ ES6 works'))"
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,13 @@
/local
.aider*
.claude/

# Dart/Flutter build artifacts
**/.dart_tool/**
**/build/**
**/.packages

# IDE/editor files
.idea/
.vscode/
.DS_Store
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@
path = parsec_windows/windows/ext/equations-parser
url = https://github.com/niltonvasques/equations-parser
branch = windows-version
[submodule "parsec_web/lib/parsec-web"]
path = parsec_web/lib/parsec-web
url = https://github.com/oxeanbits/parsec-web.git
59 changes: 52 additions & 7 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ This repository follows a federated Flutter plugin architecture:

## Key Commands

### Web Asset Generation
```bash
# Generate WebAssembly files for parsec_web (required for web platform)
cd parsec_web && dart bin/generate.dart
```

### Testing
```bash
# Test all packages from their respective directories
Expand All @@ -28,6 +34,9 @@ cd parsec_android && flutter test
cd parsec_linux && flutter test
cd parsec_windows && flutter test
cd parsec_platform_interface && flutter test

# Web platform testing (requires WASM files)
cd parsec && flutter test --platform chrome
```

### Linting & Analysis
Expand Down Expand Up @@ -152,7 +161,7 @@ pubspec.yaml # Platform-specific dependencies

## Dependencies & Versioning

- **Platform Interface Version**: Currently ^0.2.0 across all implementations
- **Platform Interface Version**: Currently ^0.2.1 across all implementations
- **Flutter Lints**: ^4.0.0 (latest) for strict code quality
- **Plugin Platform Interface**: ^2.1.8 for base platform functionality

Expand All @@ -170,14 +179,50 @@ pubspec.yaml # Platform-specific dependencies
- Local path dependencies are used for development (see pubspec.yaml files)
- No iOS/macOS/Web support in main plugin (separate web library exists)

## Web Platform Development

The **parsec_web** package uses WebAssembly compiled from C++ for high performance:

### Prerequisites
- **Emscripten**: Required to compile C++ to WebAssembly
```bash
# Ubuntu/Debian
sudo apt-get install emscripten

# Or install via emsdk
git clone https://github.com/emscripten-core/emsdk.git
cd emsdk && ./emsdk install latest && ./emsdk activate latest
source ./emsdk_env.sh
```

### Development Workflow
1. **Generate WASM files**: `cd parsec_web && dart bin/generate.dart`
2. **Test functionality**: `cd parsec_web/lib/parsec-web && npm test`
3. **Integration testing**: `cd parsec && flutter test --platform chrome`

### What `dart bin/generate.dart` does:
- Validates parsec-web submodule exists
- Compiles C++ equations-parser (38 source files) to WebAssembly using Emscripten
- Generates `wasm/equations_parser.js` (WASM glue + binary, ~635KB)
- Verifies JavaScript wrapper and WASM files are present
- Provides user-friendly output and next steps

### Web Platform Architecture

**parsec_web** uses `evalRaw()` function for direct C++ JSON output:
- **Data flow**: Dart → `evalRaw()` → WebAssembly → Raw JSON → Dart
- **Platform consistency**: All platforms receive identical JSON from C++
- **Simplified code**: Eliminated complex type conversion layers

## When Working on This Codebase

1. **Always test across platforms** - changes to interface affect all implementations
2. **Maintain version consistency** - keep platform interface versions aligned
3. **Follow Flutter plugin conventions** - use established patterns for method channels
4. **Preserve JSON contract** - native libraries expect specific response format
5. **Update documentation** - especially README.md examples if API changes
6. **Run analysis** - ensure all packages pass `flutter analyze` before commits
1. **Generate WASM first** - run `cd parsec_web && dart bin/generate.dart` before web testing
2. **Always test across platforms** - changes to interface affect all implementations
3. **Maintain version consistency** - keep platform interface versions aligned
4. **Follow Flutter plugin conventions** - use established patterns for method channels
5. **Preserve JSON contract** - native libraries expect specific response format
6. **Update documentation** - especially README.md examples if API changes
7. **Run analysis** - ensure all packages pass `flutter analyze` before commits

## Pull Request Guidance

Expand Down
13 changes: 13 additions & 0 deletions parsec/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
## 0.5.0

- **NEW: Web Support with WebAssembly** - Added comprehensive web platform support using high-performance WebAssembly compiled from C++
- **Web Implementation** - Published `parsec_web ^0.1.0` package provides offline-first, client-side equation evaluation for Flutter web applications
- **Complete Multi-Platform Coverage** - Now supports Android, Linux, Windows, and Web platforms with identical mathematical precision
- **Updated Dependencies** - All platform implementations updated to use latest `parsec_platform_interface ^0.2.0`
- **Publishing Ready** - Converted from development path dependencies to hosted pub.dev packages
- **Enhanced Testing** - Comprehensive cross-platform testing including WebAssembly validation

## 0.4.0

- Initial Web platform support (maintenance release)

## 0.3.1

- Supports Windows.
Expand Down
Loading