Skip to content

Blazor JavaScript tag #24231

Closed
Closed
@vd3d

Description

@vd3d

Currently, blazor support the <style> tag, it is really helpful, this way we can add CSS style only in their respective components.
Otherwise, it is a pain to manage and clean very large CSS files.

So, I think we also need a tag that we can use into each component, with specific component JavaScript.
Currently, I have my own library loading some JavaScript on the fly, but it is done from the code.
My library do the following:

  • Evaluate("....")
  • LoadFromURL("HTTP://....")
  • LoadFromScript("var t = ....")

Why JavaScript, because today, there exist so much JS libraries ... they are useful too, having a 100% C# platform is not realist today.

And it works perfectly since months (I can share my code) :-)

Describe the solution you'd like

So, my proposition is

  1. to have a <Script> tag with theses features, but also:
  • is able to optimize and minify this JavaScript code
  • Version 2, can even support TypeScript etc...

(I have try to create it myself, but the Fragments seems to only support HTML like for now)

  1. improve the <style> tag to minify the css (and version 2) can even support SCSS etc...
    (I know that it is an existing feature request already)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions