Skip to content

Generate modern JS outputs that can be consumed by other JS toolchains (Blazor->JS) #53215

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
javiercn opened this issue Jan 8, 2024 · 3 comments
Assignees
Labels
area-blazor Includes: Blazor, Razor Components enhancement This issue represents an ask for new feature or an enhancement to an existing one Pillar: Dev Experience Priority:1 Work that is critical for the release, but we could probably ship without
Milestone

Comments

@javiercn
Copy link
Member

javiercn commented Jan 8, 2024

  • Users should be able to rely on standard JS idioms (import statements) to consume Blazor JS assets.
  • Our build system should be able to produce an output layout that can easily be consumed by JS tools.
    • For example, adding a package.json to the project and calling an npm script after Blazor's build/publish steps.
    • This might simply mean we offer the option to link Blazor outputs into the dist/(Debug|Release) folders.

Items

  • Generate ES module bundles that can be consumed via import statements.
    • Our modules should not pollute the global state (by default).
  • Blazor web will have a base layer and separate chunks for enhanced nav, server interactivity, and wasm interactivity. Other Blazor flavors will be a single bundle.
  • Update the wasm loading strategy to rely on standard JS idioms that toolchains can understand with enough flexibility to adapt to different bundlers.
    • Standard import. E.g. import { Blazor } from 'blazor'
    • Import as URL. E.g. import system from './_framework/system.wasm?url' (then we do fetch(system.url) or similar to load the asset).
    • Fetch (we don't include an import, and inside the loader we use fetch directly to load the asset).
@ghost ghost added the area-blazor Includes: Blazor, Razor Components label Jan 8, 2024
@javiercn
Copy link
Member Author

javiercn commented Jan 8, 2024

Part of #52819

@mkArtakMSFT mkArtakMSFT added enhancement This issue represents an ask for new feature or an enhancement to an existing one Pillar: Dev Experience Priority:1 Work that is critical for the release, but we could probably ship without labels Jan 23, 2024
@mkArtakMSFT mkArtakMSFT added this to the .NET 9 Planning milestone Jan 26, 2024
@ghost
Copy link

ghost commented Jan 26, 2024

Thanks for contacting us.

We're moving this issue to the .NET 9 Planning milestone for future evaluation / consideration. We would like to keep this around to collect more feedback, which can help us with prioritizing this work. We will re-evaluate this issue, during our next planning meeting(s).
If we later determine, that the issue has no community involvement, or it's very rare and low-impact issue, we will close it - so that the team can focus on more important and high impact issues.
To learn more about what to expect next and how this issue will be handled you can read more about our triage process here.

@danroth27 danroth27 changed the title [Blazor] Generate modern JS outputs that can be consumed by other JS toolchains (Blazor->JS) Generate modern JS outputs that can be consumed by other JS toolchains (Blazor->JS) Jan 30, 2024
@mkArtakMSFT mkArtakMSFT modified the milestones: .NET 10 Planning, Backlog Nov 4, 2024
@rodolfograve
Copy link

Hello. Can you clarify if this item is now expected to be shipped with .NET 10? Having Blazor JS assets available as standard modules will enable several use cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-blazor Includes: Blazor, Razor Components enhancement This issue represents an ask for new feature or an enhancement to an existing one Pillar: Dev Experience Priority:1 Work that is critical for the release, but we could probably ship without
Projects
None yet
Development

No branches or pull requests

3 participants