Blazor Repository Documentation

repository·master·Indexed 27 days ago

https://github.com/dotnet/blazor

Documentation for the Blazor web framework repository, focusing on build tools and runtime maintenance. Includes guides for the blazor-buildtools CLI (CheckNodeJsInstalledCommand and ILWipeCommand), generating the .NET WASM timezone database, and the process for upgrading Mono WebAssembly builds.

Tokens
1.6K
Snippets
2
Records
13
Agent score
94%

What's inside Blazor

  1. Locate Blazor source code and issue tracking

    master

    Blazor has moved from this repository to the ASP.NET Core repository. For source code, issues, and pull requests related to Blazor components, visit the ASP.NET Core repository.

    Do not post new issues or pull requests in the old dotnet/blazor repository.

  2. Update Blazor repository with a new Mono build

    master

    Use the provided upgrade script to replace existing binaries in the repository with the new Mono build. The script removes older binaries from the incoming and tools directories and copies the new structure from your extracted build.

    From the root directory of the repository, run UpgradeMono.[cmd|ps1] followed by the path to your extracted Mono build.

    Expected changes in Git diff:

    • dotnet.js and dotnet.wasm should be modified.
    • Many .NET assemblies in bcl and bcl\facades should be modified (new or removed assemblies are rare but possible).
    • The three .NET assemblies in framework should be modified (adding or removing assemblies here is unexpected and should be verified with Mono).
    • Linker binaries in tools should be modified.

    Commit Convention: Commit the changes with a message following this pattern: Upgrade Mono binaries to <their-commit-sha>, where <their-commit-sha> is the SHA found in the downloaded Mono zip filename.

    UpgradeMono.cmd C:\Users\you\Downloads\mono-wasm-a93e4712ecd
  3. Verify Mono upgrade in ASP.NET Core

    master

    After pushing your changes to the blazor repository, you must verify the upgrade by integrating it into the aspnetcore repository.

    1. Download the CI package: Once the Blazor CI builds the package (e.g., Microsoft.AspNetCore.Components.WebAssembly.Runtime.3.2.0-ci.nupkg), download it.
    2. Update Versions.props: In the aspnetcore repository, modify eng\Versions.props. Update the MicrosoftAspNetCoreComponentsWebAssemblyRuntimePackageVersion property to your new version (e.g., 3.2.0-ci).
    3. Restore the package:
      • Ensure no -ci version of the package exists in your local NuGet cache.
      • Run dotnet restore pointing to the directory containing your downloaded package using the -s flag.
    4. Run Benchmarks: Execute StandaloneApp and performance benchmarks to ensure functionality and check for regressions in size or performance.
    5. Run E2E Tests:
      • Navigate to src\Components\test\E2ETest.
      • Run yarn install to install dependencies (selenium, chrome debug adapter, etc.).
      • Ensure Java is installed.
      • Run dotnet test via the command line or through Visual Studio.
  4. Obtain a Mono WebAssembly build

    master

    To upgrade Mono and the Mono Linker, you must first download the latest Mono WebAssembly builds from the Jenkins server.

    1. Go to the Mono WebAssembly builds page: https://jenkins.mono-project.com/job/test-mono-mainline-wasm/.
    2. Select a build from the Build History pane (preferably a recent successful build).
    3. Navigate to the Default configuration at the bottom of the build info page.
    4. On the sidebar, select Azure Artifacts.
    5. Download the .zip file.

    Note: The filename contains the commit's SHA hash, which is required for tracking the Mono version used in Blazor.

    Direct Access Shortcut: You can browse directly to the Azure directory by replacing the build number in this URL: https://jenkins.mono-project.com/job/test-mono-mainline-wasm/<BUILD_NUMBER>/label=ubuntu-1804-amd64/Azure/.

  5. ILWipe CLI options reference

    master

    The following options are available for the ILWipeCommand:

    OptionLong NameDescription
    -i--inputRequired. The directory containing assemblies from which code should be wiped.
    -s--specRequired. The directory containing spec files (*.txt) describing which members to wipe.
    -o--outputRequired. The directory to which the wiped assembly files should be written.
    -v--verboseIf set, logs additional information to the console.
    -l--listIf set, just writes lists the assembly contents to disk instead of wiping.
    -h--helpDisplays help information.
  6. Verify Node.js installation via CheckNodeJsInstalledCommand

    master

    The CheckNodeJsInstalledCommand is a CLI utility used to assert that Node.js is installed on the system and meets a minimum version requirement. It executes node -v to detect the version and compares it against a specified threshold.

    Usage

    Run the command to check for Node.js. If Node.js is not found or the version is insufficient, the command will exit with code 1 and print an error message to the console.

    Options

    • -v|--version: Specifies a minimum acceptable version of Node.js (e.g., 14.17.0).
  7. Use the ILWipe command to wipe code from .NET assemblies

    master

    The ILWipeCommand is a CLI tool used to wipe specific code members from .NET assemblies based on specification files. It processes assemblies located in an input directory and writes the modified assemblies to an output directory.

    If the --list flag is used, the tool will not perform a wipe; instead, it will list the contents of the assemblies to disk as text files in the output directory.