How to use NPM in Blazor

Поделиться
HTML-код
  • Опубликовано: 19 окт 2024

Комментарии • 61

  • @konstantinosmichopoulos1723
    @konstantinosmichopoulos1723 3 года назад +4

    Awesome video and many thanks! I've encountered an error when I run 'npm run build' command, it threw 'Exit status 2'. I modified scripts in package.json `` "build": "webpack --entry ./src/index.js --output-path ../wwwroot/js --output-filename index.bundle.js" `` and it worked fine. I leave this here if anyone encounter something similar in the future! Again great content!

    • @BrianLagunas
      @BrianLagunas  3 года назад +2

      Since I recorded this, Webpack made some breaking changes in their latest version. Your code is now the correct code. I'm going to pin this so everyone can see the updated code.

  • @huw1676
    @huw1676 8 месяцев назад +1

    Great video and tutorial.
    The latest version of Blazor with .NET 8 allows us to interact with this radial gauge component without having to write a JS function, and without using any JS InterOps. To do this, we include @rendermode InteractiveServer at the top of the razor file, then for example, we change value="25" to say value="@getCurrentValue()", then taking your onClick function within the @onclick event within the button, we write the following in the @code section:
    @code {
    public int currentValue = 35;
    public void onClick()
    {
    currentValue = 45;
    }
    public int getCurrentValue() => currentValue;
    }

  • @zakialmarhoon4468
    @zakialmarhoon4468 4 года назад +4

    Wow.. I really like how you integrate NPM with blazor, it’s really amazing 🤩

  • @ievheniiierokhin1677
    @ievheniiierokhin1677 4 года назад +2

    I ve learnt a lot of new from this single video...thank you very much!

  • @osman3404
    @osman3404 3 года назад +1

    Wooow. This is really amazing. I will take this simple way of integrating npm and use it for TailwindCSS
    THANK U Brian

    • @BrianLagunas
      @BrianLagunas  3 года назад

      I'm glad you enjoyed the video. Thanks for watching.

  • @benjamininkorea7016
    @benjamininkorea7016 Год назад +1

    Haha I was just reading your blog about this. I'm trying to import Microsoft's CognitiveServices Speech SDK into Blazor-- and MS docs are doggy poop. You'd think someone at MS would say, "Hey. . . Blazor is going to be our flagship web framework. Why don't we let people know how to use our many paid services in Blazor?" I'm glad that you were out there doing that work for them.
    You'd think.

    • @BrianLagunas
      @BrianLagunas  Год назад

      They have a lot of work to do on Blazor before I would use it in a production app

    • @benjamininkorea7016
      @benjamininkorea7016 Год назад

      @@BrianLagunas Don't get me wrong, I'm a Blazor fan boy. It's definitely a mature framework. But not for this particular task. I don't think you really want to run these services server-side anyway, which means-- Javascript.

    • @BrianLagunas
      @BrianLagunas  Год назад

      @@benjamininkorea7016 my big problem with blazor is dealing with dynamic json which is really prevalent in web. In addition the the fact how chatty it is for server apps

  • @sps014
    @sps014 3 года назад +1

    Wow , i just found a good Blazor video. Keep posting blazor stuff.

  • @ArsenMkrtchyanspage
    @ArsenMkrtchyanspage Год назад +1

    Answered all my questions! Excellent video, thanks!

  • @anovinb
    @anovinb 2 года назад +1

    So much valuable knowledge in just 10 min's video. ty

  • @voicethefirst2560
    @voicethefirst2560 3 года назад +1

    Great tutorial Mr Lagunas, great stuff...

  • @emmanueladebiyi2109
    @emmanueladebiyi2109 4 года назад +1

    Awesome! NPM on Blazor made easy 👌

  • @anovinb
    @anovinb 2 года назад +1

    Woow just wow, thank you so much!

  • @pedrocampa3574
    @pedrocampa3574 Год назад +1

    Super useful!! thanks!

  • @petrapetra7551
    @petrapetra7551 4 года назад +1

    Really good, thanks!

  • @closingdealz
    @closingdealz 3 года назад

    I got errors when using the command "npm run build". Problem was that I hade Node.js 17 installed, So I uninstalled it and installed Node.js 14.18.1 LTS instead and it worked.

  • @jsmj086
    @jsmj086 3 года назад

    Thanks Brian for the idea, if we want to build on top of it, and use this technique to load the first page fast, is it doable? Since loading first page in Blazor takes little time.

    • @BrianLagunas
      @BrianLagunas  3 года назад +1

      For WASM that won't work

    • @jsmj086
      @jsmj086 3 года назад

      @@BrianLagunas
      Ok clear, another related question was in my mind and didn’t find an answer for it.
      As long as Blazor WASM must download the .NET run time at the beginning, then why not include the run time in the browser itself such as chrome or edge, is it applicable or not?

  • @christopherwilliams3293
    @christopherwilliams3293 2 года назад

    I couldn't get it to work with Cropper.js and unfortunately, I can't provide a link here, but can you explain how I can use Cropper.js in my app? I was also trying to do Quill. I got it to work, but not the preferred way (I'm using the CDN route).

  • @skarabei2303
    @skarabei2303 3 года назад +1

    Great. But you show only with one js file. I think the situation will be different with more files. I mean web pack configuration. Did you can explain more about it.

    • @BrianLagunas
      @BrianLagunas  3 года назад

      Yes, you will need to add some webpack configuration for that. I may do a video on getting started with Web pack

  • @IndiaThatIsBhaarat
    @IndiaThatIsBhaarat 3 года назад +1

    Awesome!

  • @StuckDuckF
    @StuckDuckF 2 года назад

    Would this work with any npm package? Say OpenLayers or Vuetify?

    • @BrianLagunas
      @BrianLagunas  2 года назад

      Yup, it works for any npm package.

  • @rahulmathew8713
    @rahulmathew8713 4 года назад

    Hi Brian I saw an awesome video of yours in plural sight for a custom control with ItemPresenter and ItemControl. But I was looking for how to dynamically populate the item control with region adapter. Instead of hard coding the list to be shown. Region adapter code which i followed for ribbob did help. But the actuall adding portion is what i am looking at. If you can post a video it will be really helpful paid or nonpaid.

    • @BrianLagunas
      @BrianLagunas  4 года назад

      I'm sorry, but I don't understand what you are trying to do.

  • @bspinnfade
    @bspinnfade 3 года назад

    I like the fact that you can integrate with npm with this but I still don't see the simplicity in this over react/vue with typescript. My concerns with integrations like this is scale on large platforms and the ease of understanding.

    • @BrianLagunas
      @BrianLagunas  3 года назад

      Blazor is new and is missing a lot. NPM has a ton of great resources that can be used in Blazor. This would scale just as much as any other Javascript framework. It's not the best experience from a C# dev perspective, but it is a solution that works.

    • @alexU42k
      @alexU42k 3 года назад

      Thanks for the video, but I think it was bad idea to pull js in a blazor app. It brakes the idea of blazor to manage dom objects via c#. I understand that brazor missing some features that impossible without involving js, but it's also maturing and growing up, it's just a matter of time.

    • @BrianLagunas
      @BrianLagunas  3 года назад +2

      Until then, javascript will be needed.

  • @deepak20002075
    @deepak20002075 4 года назад

    Hi Brian
    Can you do a video on WPF DataGrid editing and validation techniques?

    • @BrianLagunas
      @BrianLagunas  4 года назад

      Thats a very broad question. Is there something specific you'd like to know

    • @deepak20002075
      @deepak20002075 4 года назад

      @@BrianLagunas data validation when we use a template switcher

    • @BrianLagunas
      @BrianLagunas  4 года назад

      I would suggest using a real data grid from a company like Infragistics 😁

  • @dariodusper7068
    @dariodusper7068 9 месяцев назад

    if i would have to do this , where would i place this line
    const { xxxx} = require('xxxx');

  • @Drak0sha13
    @Drak0sha13 3 года назад

    Если без анимации, то переменную можно заменить прямо на разор странице без джава скрипта. Ссылку на элемент можно передавать из c#.

  • @christopherwilliams3293
    @christopherwilliams3293 2 года назад

    Why don't you have way, way more followers and views? I'm guessing the programming audience is quite limited.

    • @BrianLagunas
      @BrianLagunas  2 года назад

      I go for quality or quantity 😂. I also think you’re right about the audience.

  • @paulstanley2789
    @paulstanley2789 3 года назад +1

    Brilliant video thanks!