Skip to content
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

Publish blazor.*.js files to npm #10124

Open
mike1o1 opened this issue May 9, 2019 · 19 comments
Open

Publish blazor.*.js files to npm #10124

mike1o1 opened this issue May 9, 2019 · 19 comments
Labels
affected-few This issue impacts only small number of customers area-blazor Includes: Blazor, Razor Components Docs This issue tracks updating documentation feature-blazor-jsinterop This issue is related to JSInterop in Blazor Pillar: Technical Debt Priority:2 Work that is important, but not critical for the release severity-minor This label is used by an internal tool task
Milestone

Comments

@mike1o1
Copy link

mike1o1 commented May 9, 2019

I'm working on implementing some server-side Blazor components, but I have a lot of other Javascript functionality on the page. I would like to be able to include the needed blazor.server.js file in my webpack build process, instead of having to embed it directly on the page. This way all of the Javascript for my application gets included in one file.

I would like to be able to bundle blazor.server.js into my webpack build, by either accessing it through NPM or being able to link to it directly. However, according to dotnet/AspNetCore.Docs#12358 this is an embedded resource in the middleware, so I'm not sure how I can access it and include it in my build.

@benaadams
Copy link
Member

And dedupe signalr if you are additionally using that so its not double included.

@Eilon Eilon added the area-blazor Includes: Blazor, Razor Components label May 9, 2019
@mkArtakMSFT mkArtakMSFT added this to the 3.1.0 milestone May 10, 2019
@mkArtakMSFT mkArtakMSFT modified the milestones: 3.1.0, Backlog Aug 12, 2019
@SteveSandersonMS SteveSandersonMS added affected-few This issue impacts only small number of customers severity-minor This label is used by an internal tool labels Oct 6, 2020 — with ASP.NET Core Issue Ranking
@stephanbertl
Copy link

Is this planned to be implemented anytime soon?
This also applies to Web Assembly. I would like to bundle all TS/JS using webpack, including _framework/blazor.webassembly.js
It would be convenient to have it available as an npm package.

@javiercn javiercn added the feature-blazor-jsinterop This issue is related to JSInterop in Blazor label Apr 19, 2021
@TanayParikh
Copy link
Contributor

@danroth27 what're your thoughts on this?

@danroth27
Copy link
Member

@javiercn Is there a better way to integrate the Blazor framework scripts into an asset build pipeline without us having to release them to NPM?

@javiercn
Copy link
Member

@danroth27 we might be able to concoct something, but tbh the proper way to do this is to publish some sort of package to the npm registry, at the very least with the typings.

@danroth27 danroth27 modified the milestones: Backlog, .NET 7 Planning Oct 20, 2021
@TanayParikh TanayParikh changed the title Publish blazor server javascript code on NPM Publish Blazor JS & Type Definitions on NPM Oct 21, 2021
@TanayParikh TanayParikh added the Priority:0 Work that we can't release without label Oct 21, 2021
@mkArtakMSFT mkArtakMSFT added Priority:1 Work that is critical for the release, but we could probably ship without triaged and removed Priority:0 Work that we can't release without labels Nov 5, 2021
@Bouke
Copy link
Contributor

Bouke commented Dec 8, 2021

For type definitions, see also: DefinitelyTyped/DefinitelyTyped#42392.

@TanayParikh
Copy link
Contributor

Note as part of this task, we may want to consider adding official docs on how to use TypeScript with Blazor, environment/project configuration, etc.

cc/ @guardrex. No action now but just so it's on your radar 😄

@TanayParikh TanayParikh self-assigned this Dec 14, 2021
@SteveSandersonMS
Copy link
Member

If it becomes possible to get the JS code from a different source, we should add some kind of exact version match checking at runtime, blocking the app from starting unless it's exactly correct. Until now we've never had to deal with people using the wrong version of blazor.webassembly.js for their .NET runtime, and it would be good to avoid that becoming a possibility.

@mkArtakMSFT mkArtakMSFT removed this from the .NET 7 Planning milestone Jan 27, 2022
@ghost
Copy link

ghost commented Nov 21, 2022

Thanks for contacting us.

We're moving this issue to the .NET 8 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.

@mkArtakMSFT mkArtakMSFT added triaged Priority:2 Work that is important, but not critical for the release labels Nov 23, 2022
@ghost
Copy link

ghost commented Oct 6, 2023

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.

@ghost
Copy link

ghost commented Dec 12, 2023

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.

@yugabe
Copy link

yugabe commented Dec 18, 2023

Manually created TypeScript type definitions for the Blazor API: https://github.com/podNET-Hungary/blazor-typings

@sj-net
Copy link

sj-net commented Oct 19, 2024

I wanted the types to handle the things in my ts files. So I generated the types based on this ts file and used it.

Ensure the tsconfig.json has below things.

        "declarationMap": true,
        "declarationDir": "./types",
        "emitDeclarationOnly": true, ```

@mkArtakMSFT mkArtakMSFT modified the milestones: .NET 10 Planning, Backlog Nov 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affected-few This issue impacts only small number of customers area-blazor Includes: Blazor, Razor Components Docs This issue tracks updating documentation feature-blazor-jsinterop This issue is related to JSInterop in Blazor Pillar: Technical Debt Priority:2 Work that is important, but not critical for the release severity-minor This label is used by an internal tool task
Projects
None yet
Development

No branches or pull requests