Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add --extra-js-compiler-option/--extra-wasm-compiler-option #397

Merged
merged 3 commits into from
Mar 8, 2025

Conversation

mkustermann
Copy link
Contributor

This allows jaspr users to pass any arguments to the

  • dart compile js
  • dart compile wasm compilers.

For example if one wants an -O4 optimized build but symbols for profiling one may run

  • jaspr build -O4 --extra-js-compiler-option=--no-minify
  • jaspr build -O4 --experimental-wasm --extra-wasm-compiler-option=--no-strip-wasm

✨ New feature or improvement

This allows jaspr users to pass any arguments to the
  * `dart compile js`
  * `dart compile wasm`
compilers.

For example if one wants an `-O4` optimized build but symbols for
profiling one may run

  * `jaspr build -O4 --extra-js-compiler-option=--no-minify`
  * `jaspr build -O4 --experimental-wasm --extra-wasm-compiler-option=--no-strip-wasm`
@mkustermann mkustermann requested a review from schultek as a code owner March 7, 2025 14:08
Copy link

docs-page bot commented Mar 7, 2025

To view this pull requests documentation preview, visit the following URL:

docs.page/schultek/jaspr~397

Documentation is deployed and generated using docs.page.

Copy link

github-actions bot commented Mar 7, 2025

Package Version Report

The following packages have been updated:
jaspr : 0.18.0 -> 0.18.1
jaspr_builder : 0.18.0 -> 0.18.1
jaspr_cli : 0.18.0 -> 0.18.1
jaspr_test : 0.18.0 -> 0.18.1

mkustermann added a commit to mkustermann/Speedometer that referenced this pull request Mar 7, 2025
This is a Jaspr Dart Web application compiled with dart2js and
dart2wasm.

The soruce is from [0] and was compiled with a modified Jaspr CLI tool
(see PR in [1]) using the following commands:

```
% rm -rf build
% dart run --resident <jaspr>/packages/jaspr_cli/bin/jaspr.dart build -O4 --extra-js-compiler-option=--no-minify
```

```
% rm -rf build
% dart run --resident <jaspr>/packages/jaspr_cli/bin/jaspr.dart build -O4 --extra-wasm-compiler-option=--no-strip-wasm --experimental-wasm
```

The relevant files in `build/jaspr/*` were copied to the JetStream
benchmark folders.

Used Dart SDK version is: 3.8.0-edge.4c8aedcb57fe678e6d30acfdc021aa9888576638

Before landing we should figure out:

    * do we want both dart2js and dart2wasm?
    * do we want -O2 or -O4?
    * can we rely on `js-string` builtin to be evailable or not?

[0] https://github.com/mkustermann/todomvc
[1] schultek/jaspr#397
mkustermann added a commit to mkustermann/Speedometer that referenced this pull request Mar 7, 2025
This is a Jaspr Dart Web application compiled with dart2js and
dart2wasm.

The source is from [0] and was compiled with a modified Jaspr CLI tool
(see PR in [1]) using the following commands:

```
% rm -rf build
% dart run --resident <jaspr>/packages/jaspr_cli/bin/jaspr.dart build -O4 --extra-js-compiler-option=--no-minify
```

```
% rm -rf build
% dart run --resident <jaspr>/packages/jaspr_cli/bin/jaspr.dart build -O4 --extra-wasm-compiler-option=--no-strip-wasm --experimental-wasm
```

The relevant files in `build/jaspr/*` were copied to the Speedometer
benchmark folders.

Used Dart SDK version is: 3.8.0-edge.4c8aedcb57fe678e6d30acfdc021aa9888576638

Before landing we should figure out:

    * do we want both dart2js and dart2wasm?
    * do we want -O2 or -O4?
    * can we rely on `js-string` builtin to be evailable or not?

[0] https://github.com/mkustermann/todomvc
[1] schultek/jaspr#397
Copy link
Owner

@schultek schultek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, LGTM

@schultek schultek merged commit f30f84a into schultek:main Mar 8, 2025
11 checks passed
@mkustermann
Copy link
Contributor Author

Thanks for the quick merge, @schultek 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants