mirror of https://github.com/abpframework/abp
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
3.3 KiB
3.3 KiB
Blazor UI 3.3 to 4.0 Migration Guide
Startup Template Changes
These changes are required to manually applied in your own solution. It would be easier if you create a new solution based on 4.0 with the same name of your current solution then compare the files.
Csproj File / Dependencies
- Add
<BlazorWebAssemblyLoadAllGlobalizationData>true</BlazorWebAssemblyLoadAllGlobalizationData>to thePropertyGroupsection of your project (.csproj) file. - Update the
Blazorise.*packages to the latest version (to the latest RC for the ABP 4.0 preview).
wwwroot/index.html
There are some changes made in the index.html file;
- Removed JQuery & Bootstrap JavaScript dependencies
- Replaced Bootstrap and FontAwesome imports with local files instead of CDN usages.
- Re-arranged some ABP CSS file locations.
- Introduced the
abp bundleCLI command to manage global Style/Script file imports.
Follow the steps below to apply the changes;
- Add the bundle contributor class into your project (it will be slightly different based on your solution namespaces):
using Volo.Abp.Bundling;
namespace MyCompanyName.MyProjectName.Blazor
{
public class MyProjectNameBundleContributer : IBundleContributer
{
public void AddScripts(BundleContext context)
{
}
public void AddStyles(BundleContext context)
{
context.Add("main.css");
}
}
}
If you are using another global style/script files, add them here.
- Remove all the
<link...>elements and replace with the following comment tags:
<!--ABP:Styles-->
<!--/ABP:Styles-->
- Remove all the
<script...>elements and replace with the following comment tags:
<!--ABP:Scripts-->
<!--/ABP:Scripts-->
- Execute the following command in a terminal in the root folder of the Blazor project (
.csproj) file (ensure that you're using the ABP CLI version 4.0):
abp bundle
This will fill in the Styles and Scripts tags based on the dependencies.
- You can clean the
blazor-error-uirelated sections from yourmain.cssfile since they are not needed anymore.
The Root Element
This change is optional but recommended.
- Change
<app>...</app>to<div id="ApplicationContainer">...</div>in thewwwroot/index.html. - Change
builder.RootComponents.Add<App>("app");tobuilder.RootComponents.Add<App>("#ApplicationContainer");in the YourProjectBlazorModule.cs.
AbpCrudPageBase Changes
If you've derived your pages from the AbpCrudPageBase class, then you may need to apply the following changes;
OpenEditModalAsyncmethod getsEntityDtoinstead of id (Guid) parameter. Passcontextinstead ofcontext.Id.DeleteEntityAsyncmethod doesn't display confirmation dialog anymore. You can use the newEntityActionscomponent in Data Grids to show confirmation messages. You can also injectIUiMessageServiceto your page or component and call theConfirmAsyncexplicitly.- Added
GetListInputas a base property that is used to filter while getting the entities from the server.