Skip to content

Commit 18ac67c

Browse files
authored
Improve placeholders for libraries (#35686)
1 parent d008c9f commit 18ac67c

File tree

4 files changed

+16
-16
lines changed

4 files changed

+16
-16
lines changed

aspnetcore/blazor/components/css-isolation.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,26 +58,26 @@ CSS isolation occurs at build time. Blazor rewrites CSS selectors to match marku
5858
Blazor Web Apps:
5959

6060
```html
61-
<link href="@Assets["{ASSEMBLY NAME}.styles.css"]" rel="stylesheet">
61+
<link href="@Assets["{PACKAGE ID/ASSEMBLY NAME}.styles.css"]" rel="stylesheet">
6262
```
6363

6464
Standalone Blazor WebAssembly apps:
6565

6666
```html
67-
<link href="{ASSEMBLY NAME}.styles.css" rel="stylesheet">
67+
<link href="{PACKAGE ID/ASSEMBLY NAME}.styles.css" rel="stylesheet">
6868
```
6969

7070
:::moniker-end
7171

7272
:::moniker range="< aspnetcore-9.0"
7373

7474
```html
75-
<link href="{ASSEMBLY NAME}.styles.css" rel="stylesheet">
75+
<link href="{PACKAGE ID/ASSEMBLY NAME}.styles.css" rel="stylesheet">
7676
```
7777

7878
:::moniker-end
7979

80-
The `{ASSEMBLY NAME}` placeholder is the project's assembly name.
80+
The `{PACKAGE ID/ASSEMBLY NAME}` placeholder is the project's package ID (`<PackageId>` in the project file) for a library or assembly name for an app.
8181

8282
:::moniker range="< aspnetcore-8.0"
8383

@@ -95,7 +95,7 @@ Within the bundled file, each component is associated with a scope identifier. F
9595
<h1 b-3xxtam6d07>
9696
```
9797

98-
The `{ASSEMBLY NAME}.styles.css` file uses the scope identifier to group a style declaration with its component. The following example provides the style for the preceding `<h1>` element:
98+
The `{PACKAGE ID/ASSEMBLY NAME}.styles.css` file uses the scope identifier to group a style declaration with its component. The following example provides the style for the preceding `<h1>` element:
9999

100100
```css
101101
/* /Components/Pages/Counter.razor.rz.scp.css */
@@ -104,11 +104,11 @@ h1[b-3xxtam6d07] {
104104
}
105105
```
106106

107-
At build time, a project bundle is created with the convention `obj/{CONFIGURATION}/{TARGET FRAMEWORK}/scopedcss/projectbundle/{ASSEMBLY NAME}.bundle.scp.css`, where the placeholders are:
107+
At build time, a project bundle is created with the convention `obj/{CONFIGURATION}/{TARGET FRAMEWORK}/scopedcss/projectbundle/{PACKAGE ID/ASSEMBLY NAME}.bundle.scp.css`, where the placeholders are:
108108

109109
* `{CONFIGURATION}`: The app's build configuration (for example, `Debug`, `Release`).
110110
* `{TARGET FRAMEWORK}`: The target framework (for example, `net6.0`).
111-
* `{ASSEMBLY NAME}`: The app's assembly name (for example, `BlazorSample`).
111+
* `{PACKAGE ID/ASSEMBLY NAME}`: The project's package ID (`<PackageId>` in the project file) for a library or assembly name for an app (for example, `BlazorSample`).
112112

113113
## Child component support
114114

aspnetcore/blazor/fundamentals/startup.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ Both callbacks can return a `Promise`, and the promise is awaited before the sta
205205
For the file name:
206206

207207
* If the JS initializers are consumed as a static asset in the project, use the format `{ASSEMBLY NAME}.lib.module.js`, where the `{ASSEMBLY NAME}` placeholder is the app's assembly name. For example, name the file `BlazorSample.lib.module.js` for a project with an assembly name of `BlazorSample`. Place the file in the app's `wwwroot` folder.
208-
* If the JS initializers are consumed from an RCL, use the format `{LIBRARY NAME/PACKAGE ID}.lib.module.js`, where the `{LIBRARY NAME/PACKAGE ID}` placeholder is the project's library name or package identifier. For example, name the file `RazorClassLibrary1.lib.module.js` for an RCL with a package identifier of `RazorClassLibrary1`. Place the file in the library's `wwwroot` folder.
208+
* If the JS initializers are consumed from an RCL, use the format `{LIBRARY NAME/PACKAGE ID}.lib.module.js`, where the `{LIBRARY NAME/PACKAGE ID}` placeholder is the project's library name or package identifier (`<PackageId>` value in the library's project file). For example, name the file `RazorClassLibrary1.lib.module.js` for an RCL with a package identifier of `RazorClassLibrary1`. Place the file in the library's `wwwroot` folder.
209209

210210
:::moniker-end
211211

aspnetcore/blazor/javascript-interoperability/call-dotnet-from-javascript.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,12 @@ Pass in the name of the assembly containing the method, the identifier of the st
3333

3434
In the following example:
3535

36-
* The `{ASSEMBLY NAME}` placeholder is the app's assembly name.
36+
* The `{PACKAGE ID/ASSEMBLY NAME}` placeholder is the project's package ID (`<PackageId>` in the project file) for a library or assembly name for an app.
3737
* The `{.NET METHOD ID}` placeholder is the .NET method identifier.
3838
* The `{ARGUMENTS}` placeholder are optional, comma-separated arguments to pass to the method, each of which must be JSON-serializable.
3939

4040
```javascript
41-
DotNet.invokeMethodAsync('{ASSEMBLY NAME}', '{.NET METHOD ID}', {ARGUMENTS});
41+
DotNet.invokeMethodAsync('{PACKAGE ID/ASSEMBLY NAME}', '{.NET METHOD ID}', {ARGUMENTS});
4242
```
4343

4444
`DotNet.invokeMethodAsync` returns a [JS `Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise) representing the result of the operation. `DotNet.invokeMethod` (client-side components) returns the result of the operation.
@@ -239,7 +239,7 @@ In the call to `DotNet.invokeMethodAsync` (server-side or client-side components
239239
Call `DotNet.createJSObjectReference(jsObject)` to construct a JS object reference so that it can be passed to .NET, where `jsObject` is the [JS `Object`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object) used to create the JS object reference. The following example passes a reference to the non-serializable `window` object to .NET, which receives it in the `ReceiveWindowObject` C# method as an <xref:Microsoft.JSInterop.IJSObjectReference>:
240240
241241
```javascript
242-
DotNet.invokeMethodAsync('{ASSEMBLY NAME}', 'ReceiveWindowObject',
242+
DotNet.invokeMethodAsync('{PACKAGE ID/ASSEMBLY NAME}', 'ReceiveWindowObject',
243243
DotNet.createJSObjectReference(window));
244244
```
245245
@@ -251,7 +251,7 @@ public static void ReceiveWindowObject(IJSObjectReference objRef)
251251
}
252252
```
253253
254-
In the preceding example, the `{ASSEMBLY NAME}` placeholder is the app's namespace.
254+
In the preceding example, the `{PACKAGE ID/ASSEMBLY NAME}` placeholder is the project's package ID (`<PackageId>` in the project file) for a library or assembly name for an app.
255255
256256
> [!NOTE]
257257
> The preceding example doesn't require disposal of the `JSObjectReference`, as a reference to the `window` object isn't held in JS.
@@ -261,12 +261,12 @@ Maintaining a reference to a `JSObjectReference` requires disposing of it to avo
261261
```javascript
262262
var jsObjectReference = DotNet.createJSObjectReference(window);
263263
264-
DotNet.invokeMethodAsync('{ASSEMBLY NAME}', 'ReceiveWindowObject', jsObjectReference);
264+
DotNet.invokeMethodAsync('{PACKAGE ID/ASSEMBLY NAME}', 'ReceiveWindowObject', jsObjectReference);
265265
266266
DotNet.disposeJSObjectReference(jsObjectReference);
267267
```
268268
269-
In the preceding example, the `{ASSEMBLY NAME}` placeholder is the app's namespace.
269+
In the preceding example, the `{PACKAGE ID/ASSEMBLY NAME}` placeholder is the project's package ID (`<PackageId>` in the project file) for a library or assembly name for an app.
270270

271271
Call `DotNet.createJSStreamReference(streamReference)` to construct a JS stream reference so that it can be passed to .NET, where `streamReference` is an [`ArrayBuffer`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer), [`Blob`](https://developer.mozilla.org/docs/Web/API/Blob), or any [typed array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray), such as [`Uint8Array`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array) or [`Float32Array`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Float32Array), used to create the JS stream reference.
272272

aspnetcore/blazor/security/webassembly/additional-scenarios.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ A typed client can be defined that handles all of the HTTP and token acquisition
410410
```csharp
411411
using System.Net.Http.Json;
412412
using Microsoft.AspNetCore.Components.WebAssembly.Authentication;
413-
using static {ASSEMBLY NAME}.Data;
413+
using static {PACKAGE ID/ASSEMBLY NAME}.Data;
414414

415415
public class WeatherForecastClient(HttpClient http)
416416
{
@@ -433,7 +433,7 @@ public class WeatherForecastClient(HttpClient http)
433433
}
434434
```
435435

436-
In the preceding example, the `WeatherForecast` type is a static class that holds weather forecast data. The `{ASSEMBLY NAME}` placeholder is the app's assembly name (for example, `using static BlazorSample.Data;`).
436+
In the preceding example, the `WeatherForecast` type is a static class that holds weather forecast data. The `{PACKAGE ID/ASSEMBLY NAME}` placeholder is the project's package ID (`<PackageId>` in the project file) for a library or assembly name for an app (for example, `using static BlazorSample.Data;`).
437437

438438
In the following example, <xref:Microsoft.Extensions.DependencyInjection.HttpClientFactoryServiceCollectionExtensions.AddHttpClient%2A?displayProperty=nameWithType> is an extension in <xref:Microsoft.Extensions.Http?displayProperty=fullName>. Add the package to an app that doesn't already reference it.
439439

0 commit comments

Comments
 (0)