Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sql-mistermagoo/blazorpreview_8_typescript_sample
How to use Typescript in a Razor Component Library (and how it also doesn't work very well)
https://github.com/sql-mistermagoo/blazorpreview_8_typescript_sample
blazor blazorlib content-files embedded-resource staticwebassets typescript
Last synced: about 2 months ago
JSON representation
How to use Typescript in a Razor Component Library (and how it also doesn't work very well)
- Host: GitHub
- URL: https://github.com/sql-mistermagoo/blazorpreview_8_typescript_sample
- Owner: SQL-MisterMagoo
- Created: 2019-08-14T20:53:59.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2020-06-15T16:16:51.000Z (over 4 years ago)
- Last Synced: 2024-11-09T03:59:20.695Z (3 months ago)
- Topics: blazor, blazorlib, content-files, embedded-resource, staticwebassets, typescript
- Language: HTML
- Size: 221 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Blazor Preview 8 Broken Libraries
Blazor Preview 8 sees the death of the "blazorlib" template,
which was used for Comnponent Libraries in previous versions.The new Razor Component Library is supposed to replace it,
but there are problems...### No Client Side Blazor support for "content"
RCL does not provide support for "content" files in
Client-Side Blazor.Using the old _blazorlib_ template, any content files
(JS/CSS etc) would automatically be packed as
Embedded Resources in the component assembly and
served up by the Blazor WASM web server.You can still achieve this, by adding these lines into your
RCL project file``` XML
```### No Server-Side Content When Not In Development
If the environment variable `ASPNETCORE_ENVIRONMENT` is not
set to `Development`, no content files are served by the SSB
project - whether published or not.## This repo contains sample projects to demonstrate these issues
To see the problem with SSB content files, change the environment
variable `ASPNETCORE_ENVIRONMENT` to anything other than
`Development` and run it. Check the browser console and see the
error where it cannot load the `Library.js` file.To see the problem in CSB, comment out the `ItemGroup` labelled
*Client Side Blazor* in **BlazorCSB8.csproj** and run the BlazorCSB8
project, then check the browser console for errors.