Bumps [@angular/platform-browser](https://github.com/angular/angular/tree/HEAD/packages/platform-browser) from 17.3.10 to 18.0.1. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/angular/angular/releases"><code>@angular/platform-browser</code>'s releases</a>.</em></p> <blockquote> <h2>v18.0.1</h2> <p><!-- raw HTML omitted --><!-- raw HTML omitted --></p> <h1>18.0.1 (2024-05-29)</h1> <h3>compiler</h3> <table> <thead> <tr> <th>Commit</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td><a href="419ffa2026"><img src="https://img.shields.io/badge/419ffa2026-fix-green" alt="fix - 419ffa2026" /></a></td> <td>optimize track function that only passes $index (<a href="https://github.com/angular/angular/tree/HEAD/packages/platform-browser/issues/55872">#55872</a>)</td> </tr> </tbody> </table> <h3>compiler-cli</h3> <table> <thead> <tr> <th>Commit</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td><a href="4c7efc005a"><img src="https://img.shields.io/badge/4c7efc005a-fix-green" alt="fix - 4c7efc005a" /></a></td> <td>interpolatedSignalNotInvoked diagnostic for class, style, attribute and animation bindings (<a href="https://github.com/angular/angular/tree/HEAD/packages/platform-browser/issues/55969">#55969</a>)</td> </tr> </tbody> </table> <h3>core</h3> <table> <thead> <tr> <th>Commit</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td><a href="4e6ea0e19c"><img src="https://img.shields.io/badge/4e6ea0e19c-fix-green" alt="fix - 4e6ea0e19c" /></a></td> <td>handle elements with local refs in event replay serialization logic (<a href="https://github.com/angular/angular/tree/HEAD/packages/platform-browser/issues/56076">#56076</a>)</td> </tr> <tr> <td><a href="d73a0175cb"><img src="https://img.shields.io/badge/d73a0175cb-fix-green" alt="fix - d73a0175cb" /></a></td> <td>link errors to ADEV (<a href="https://github.com/angular/angular/tree/HEAD/packages/platform-browser/issues/55554">#55554</a>)</td> </tr> <tr> <td><a href="985a215b10"><img src="https://img.shields.io/badge/985a215b10-fix-green" alt="fix - 985a215b10" /></a></td> <td>typo in zoneless warning (<a href="https://github.com/angular/angular/tree/HEAD/packages/platform-browser/issues/55974">#55974</a>)</td> </tr> </tbody> </table> <h3>migrations</h3> <table> <thead> <tr> <th>Commit</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td><a href="ba85d08158"><img src="https://img.shields.io/badge/ba85d08158-fix-green" alt="fix - ba85d08158" /></a></td> <td>handle empty ngSwitchCase (<a href="https://github.com/angular/angular/tree/HEAD/packages/platform-browser/issues/56105">#56105</a>)</td> </tr> </tbody> </table> <h2>v18.0.0</h2> <p><!-- raw HTML omitted --><!-- raw HTML omitted --></p> <h1>18.0.0 (2024-05-22)</h1> <h3>animations</h3> <table> <thead> <tr> <th>Commit</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td><a href="bcce85af72"><img src="https://img.shields.io/badge/bcce85af72-refactor-yellow" alt="refactor - bcce85af72" /></a></td> <td>remove deprecated <code>matchesElement</code> from <code>AnimationDriver</code> (<a href="https://github.com/angular/angular/tree/HEAD/packages/platform-browser/issues/55479">#55479</a>)</td> </tr> </tbody> </table> <h3>common</h3> <table> <thead> <tr> <th>Commit</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td><a href="d34c033902"><img src="https://img.shields.io/badge/d34c033902-refactor-yellow" alt="refactor - d34c033902" /></a></td> <td>Deprecate Local Data API functions (<a href="https://github.com/angular/angular/tree/HEAD/packages/platform-browser/issues/54483">#54483</a>)</td> </tr> <tr> <td><a href="3b0de30b37"><img src="https://img.shields.io/badge/3b0de30b37-refactor-yellow" alt="refactor - 3b0de30b37" /></a></td> <td>remove deprecated <code>isPlatformWorkerApp</code> and <code>isPlatformWorkerUi</code> API (<a href="https://github.com/angular/angular/tree/HEAD/packages/platform-browser/issues/55302">#55302</a>)</td> </tr> </tbody> </table> <h3>compiler</h3> <table> <thead> <tr> <th>Commit</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td><a href="91b007e58f"><img src="https://img.shields.io/badge/91b007e58f-fix-green" alt="fix - 91b007e58f" /></a></td> <td>add math elements to schema (<a href="https://github.com/angular/angular/tree/HEAD/packages/platform-browser/issues/55631">#55631</a>)</td> </tr> <tr> <td><a href="33d0102304"><img src="https://img.shields.io/badge/33d0102304-fix-green" alt="fix - 33d0102304" /></a></td> <td>allow comments between connected blocks (<a href="https://github.com/angular/angular/tree/HEAD/packages/platform-browser/issues/55966">#55966</a>)</td> </tr> <tr> <td><a href="7fc7f3f05f"><img src="https://img.shields.io/badge/7fc7f3f05f-fix-green" alt="fix - 7fc7f3f05f" /></a></td> <td>capture all control flow branches for content projection in if blocks (<a href="https://github.com/angular/angular/tree/HEAD/packages/platform-browser/issues/54921">#54921</a>)</td> </tr> <tr> <td><a href="a369f43fbd"><img src="https://img.shields.io/badge/a369f43fbd-fix-green" alt="fix - a369f43fbd" /></a></td> <td>capture switch block cases for content projection (<a href="https://github.com/angular/angular/tree/HEAD/packages/platform-browser/issues/54921">#54921</a>)</td> </tr> <tr> <td><a href="eb625d3783"><img src="https://img.shields.io/badge/eb625d3783-fix-green" alt="fix - eb625d3783" /></a></td> <td>declare for loop aliases in addition to new name (<a href="https://github.com/angular/angular/tree/HEAD/packages/platform-browser/issues/54942">#54942</a>)</td> </tr> <tr> <td><a href="f824911510"><img src="https://img.shields.io/badge/f824911510-fix-green" alt="fix - f824911510" /></a></td> <td>For <code>FatalDiagnosticError</code>, hide the <code>message</code> field without affecting the emit (<a href="https://github.com/angular/angular/tree/HEAD/packages/platform-browser/issues/55160">#55160</a>)</td> </tr> <tr> <td><a href="a040fb720a"><img src="https://img.shields.io/badge/a040fb720a-fix-green" alt="fix - a040fb720a" /></a></td> <td>maintain multiline CSS selectors during CSS scoping (<a href="https://github.com/angular/angular/tree/HEAD/packages/platform-browser/issues/55509">#55509</a>)</td> </tr> <tr> <td><a href="39624c6b12"><img src="https://img.shields.io/badge/39624c6b12-fix-green" alt="fix - 39624c6b12" /></a></td> <td>output input flags as a literal (<a href="https://github.com/angular/angular/tree/HEAD/packages/platform-browser/issues/55215">#55215</a>)</td> </tr> <tr> <td><a href="eba92cfa55"><img src="https://img.shields.io/badge/eba92cfa55-fix-green" alt="fix - eba92cfa55" /></a></td> <td>prevent usage of reserved control flow symbol in custom interpolation context. (<a href="https://github.com/angular/angular/tree/HEAD/packages/platform-browser/issues/55809">#55809</a>)</td> </tr> <tr> <td><a href="7d5bc1c628"><img src="https://img.shields.io/badge/7d5bc1c628-fix-green" alt="fix - 7d5bc1c628" /></a></td> <td>remove container index from conditional instruction (<a href="https://github.com/angular/angular/tree/HEAD/packages/platform-browser/issues/55190">#55190</a>)</td> </tr> <tr> <td><a href="4eb0165750"><img src="https://img.shields.io/badge/4eb0165750-fix-green" alt="fix - 4eb0165750" /></a></td> <td>remove support for unassignable expressions in two-way bindings (<a href="https://github.com/angular/angular/tree/HEAD/packages/platform-browser/issues/55342">#55342</a>)</td> </tr> <tr> <td><a href="e1650e3b13"><img src="https://img.shields.io/badge/e1650e3b13-fix-green" alt="fix - e1650e3b13" /></a></td> <td>throw error if item name and context variables conflict (<a href="https://github.com/angular/angular/tree/HEAD/packages/platform-browser/issues/55045">#55045</a>)</td> </tr> </tbody> </table> <h3>compiler-cli</h3> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/angular/angular/blob/main/CHANGELOG.md"><code>@angular/platform-browser</code>'s changelog</a>.</em></p> <blockquote> <h1>18.0.1 (2024-05-29)</h1> <h3>compiler</h3> <table> <thead> <tr> <th>Commit</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td><a href="419ffa2026">419ffa2026</a></td> <td>fix</td> <td>optimize track function that only passes $index (<a href="https://redirect.github.com/angular/angular/pull/55872">#55872</a>)</td> </tr> </tbody> </table> <h3>compiler-cli</h3> <table> <thead> <tr> <th>Commit</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td><a href="4c7efc005a">4c7efc005a</a></td> <td>fix</td> <td>interpolatedSignalNotInvoked diagnostic for class, style, attribute and animation bindings (<a href="https://redirect.github.com/angular/angular/pull/55969">#55969</a>)</td> </tr> </tbody> </table> <h3>core</h3> <table> <thead> <tr> <th>Commit</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td><a href="4e6ea0e19c">4e6ea0e19c</a></td> <td>fix</td> <td>handle elements with local refs in event replay serialization logic (<a href="https://redirect.github.com/angular/angular/pull/56076">#56076</a>)</td> </tr> <tr> <td><a href="d73a0175cb">d73a0175cb</a></td> <td>fix</td> <td>link errors to ADEV (<a href="https://redirect.github.com/angular/angular/pull/55554">#55554</a>)</td> </tr> <tr> <td><a href="985a215b10">985a215b10</a></td> <td>fix</td> <td>typo in zoneless warning (<a href="https://redirect.github.com/angular/angular/pull/55974">#55974</a>)</td> </tr> </tbody> </table> <h3>migrations</h3> <table> <thead> <tr> <th>Commit</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td><a href="ba85d08158">ba85d08158</a></td> <td>fix</td> <td>handle empty ngSwitchCase (<a href="https://redirect.github.com/angular/angular/pull/56105">#56105</a>)</td> </tr> </tbody> </table> <!-- raw HTML omitted --> <p><!-- raw HTML omitted --><!-- raw HTML omitted --></p> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="0b6018b755"><code>0b6018b</code></a> build: update to latest dev infra code (<a href="https://github.com/angular/angular/tree/HEAD/packages/platform-browser/issues/56128">#56128</a>)</li> <li><a href="47b7ba0d5e"><code>47b7ba0</code></a> refactor(core): Remove hybrid mode flag and move scheduler provider location ...</li> <li><a href="77eb4ca061"><code>77eb4ca</code></a> docs: declare <code>provideAnimationsAsync()</code> function stable (<a href="https://github.com/angular/angular/tree/HEAD/packages/platform-browser/issues/55871">#55871</a>)</li> <li><a href="f8a6ebd977"><code>f8a6ebd</code></a> docs: Add documentation for event replay (<a href="https://github.com/angular/angular/tree/HEAD/packages/platform-browser/issues/55802">#55802</a>)</li> <li><a href="9eb7478e5d"><code>9eb7478</code></a> refactor(core): Throw a runtime error if both zone and zoneless are provided ...</li> <li><a href="5c8c2eb60c"><code>5c8c2eb</code></a> refactor(animations): make async animations code compatible with Closure comp...</li> <li><a href="23f914f101"><code>23f914f</code></a> fix(platform-browser): Use the right namespace for mathML. (<a href="https://github.com/angular/angular/tree/HEAD/packages/platform-browser/issues/55622">#55622</a>)</li> <li><a href="122478c202"><code>122478c</code></a> refactor(core): Ensure animations are flushed before running render hooks (<a href="https://github.com/angular/angular/tree/HEAD/packages/platform-browser/issues/5">#5</a>...</li> <li><a href="a80fa8d1a5"><code>a80fa8d</code></a> refactor(core): Omit listeners from out-of-zone scheduling when using ZoneJS ...</li> <li><a href="e3d5607caf"><code>e3d5607</code></a> Revert "refactor(core): Ensure DOM removal happens when no app views need ref...</li> <li>Additional commits viewable in <a href="https://github.com/angular/angular/commits/18.0.1/packages/platform-browser">compare view</a></li> </ul> </details> <br /> [](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
ng-flutter
This Angular project is a simple example of how Angular and Flutter web apps could be integrated, and have them interop.
Points of Interest
Angular
This repository is a quite standard Angular app. The following changes were made to be able to use (and interop) with a Flutter web application:
package.jsonhas a customprebuildscript that builds the Flutter web app, so Angular can find it later.flutter.jsis added as a"scripts"entry inangular.json. Angular takes care of minimizing and injecting it as any other script.- The rest of the flutter app
flutter/build/web/is registered as an"assets"entry inangular.json, and moved to/flutter. - The
ng-fluttercomponent takes care of embedding Flutter web, and yielding control to Angular through anappLoadedEventEmitter. The object yielded by this emitter is a state controller exposed by flutter via a JS custom event!
Flutter
The embedded Flutter application lives in the flutter directory of this repo.
That application is a standard web app, that doesn't need to be aware that it's
going to be embedded in another framework.
- Flutter uses new
@staticInteropmethods to allow certain Dart functions to be called from JavaScript. - Look at how
createDartExportandbroadcastAppEventwork together to make the_statecontroller of the Flutter app available to Angular!
How to build the app
Requirements
If you want to build and run this demo on your machine, you'll need a moderately recent version of Angular:
$ ng version
Angular CLI: 17.0.0
Node: 20.9.0
Package Manager: npm 10.1.0
OS: linux x64
And Flutter:
$ flutter --version
Flutter 3.13.9 • channel stable
Framework • revision d211f42860 (2 weeks ago) • 2023-10-25 13:42:25 -0700
Engine • revision 0545f8705d
Tools • Dart 3.1.5 • DevTools 2.25.0
Ensure npm, ng and flutter are present in your $PATH.
Building the app
This repository is a moderately standard Angular app. It integrates
Flutter web by making it part of the Angular assets.
In order to build this app, first fetch its npm dependencies:
$ npm install
added 963 packages, and audited 964 packages in 17s
93 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
Then run the build script. It'll take care of building Flutter
automatically:
$ npm run build
> ng-flutter@0.0.0 prebuild
... Flutter web build output ...
Compiling lib/main.dart for the Web...
> ng-flutter@0.0.0 build
> ng build
... Angular build output ...
✔ Browser application bundle generation complete.
✔ Copying assets complete.
✔ Index html generation complete.
Local Angular development
Once you've reached this point, you should be able to work with your Angular application normally, for example to run a local web server:
$ npm run start
> ng-flutter@0.0.0 start
> ng serve
✔ Browser application bundle generation complete.
Initial Chunk Files | Names | Raw Size
vendor.js | vendor | 4.38 MB |
... Angular build output...
** Angular Live Development Server is listening on localhost:4200, open your browser on http://localhost:4200/ **
✔ Compiled successfully.
Navigate to http://localhost:4200/. The application will automatically reload
if you change any of its Angular source files.
Local Flutter web development
The Flutter app lives inside the flutter directory, and can be
developed independently. Just do any changes on Flutter web as you'd
normally do. It even includes a small web/index.html so you can see
changes to your app without running the whole Angular setup.
Note
For now, Angular does not auto-detect changes to your Flutter web app, so once you're happy with your Flutter web app, make sure to call
npm run buildso everything rebuilds and gets placed into its correct location.
Deploying the app
After npm run build, you should have a deployable Angular + Flutter
web app in the dist directory of this Angular project.
Your built app can can be deployed anywhere, but do check Firebase hosting for a super-easy deployment experience!
Troubleshooting
Flutter
Ensure your flutter app is properly rebuilt after any changes.
- Run
npm run buildto re-build the Flutter app.
If you encounter error messages like:
Error: Can't resolve 'flutter/build/web/flutter.js' in '/my/checkout/of/ng-flutter'
You definitely need to run npm run build!
Reach out to the team(s)!
Have you had any problem not covered in this README? Do you want to see other embedding examples?
Let us know by creating an issue or opening a new pull request.
Thanks!