投稿時間:2021-05-07 18:43:24 RSSフィード2021-05-07 18:00 分まとめ(52件)

カテゴリー等 サイト名等 記事タイトル・トレンドワード等 リンクURL 頻出ワード・要約等/検索ボリューム 登録日
TECH Engadget Japanese ヤマハ、デノンなどの一部AVアンプが4K/120Hz出力できない問題に解決策 https://japanese.engadget.com/yamaha-denon-maranz-083040987.html 解決策 2021-05-07 08:30:40
TECH Engadget Japanese グーグル、アカウントの2段階認証を近日中にデフォルトでオンに https://japanese.engadget.com/google-two-factor-081028902.html google 2021-05-07 08:10:28
IT ITmedia 総合記事一覧 [ITmedia News] AWS、エッジにおけるJavaScript実行環境に本格参入 CloudflareやDenoなどの競合に https://www.itmedia.co.jp/news/articles/2105/07/news122.html cloudflare 2021-05-07 17:31:00
IT 情報システムリーダーのためのIT情報専門サイト IT Leaders SCSK、クラウド型EDI「スマクラ」が電子帳簿保存法に対応、取引データを電子保存するオプションを提供 | IT Leaders https://it.impress.co.jp/articles/-/21458 SCSK、クラウド型EDI「スマクラ」が電子帳簿保存法に対応、取引データを電子保存するオプションを提供ITLeadersSCSKは年月日、クラウド型のEDI電子データ交換サービス「スマクラ」のオプションとして、電子帳簿保存法に対応できるようにする「電子帳簿保存サービス」の提供を開始した。 2021-05-07 17:02:00
AWS lambdaタグが付けられた新着投稿 - Qiita サーバーレスを利用した従量課金で動くシステム開発 https://qiita.com/kerorinfather/items/d4c01353d82e24c99864 構成adminpage管理用ページの構築、webpage閲覧用ページの構築、databaseデータ格納先の構築のつのフォルダが存在し、管理用ページと閲覧用ページはServerlessFrameworkを利用して構築、データ格納先はCloudFormationを利用して構築しています。 2021-05-07 17:02:12
python Pythonタグが付けられた新着投稿 - Qiita Pythonで関数をいい感じに使うためのパッケージ https://qiita.com/asuzuki2008/items/53eecba9023289baf3da 関数をカリー化すると、結果的に部分適用の関数ができるみたいな理解をしている。 2021-05-07 17:58:04
python Pythonタグが付けられた新着投稿 - Qiita 駆け出しpythonエンジニアのまとめ デザインパターンまとめ4(prottype) https://qiita.com/speedingrenchon/items/24bf46162dec110fa543 利用頻度はそんなに高くなさそうクラス図とシーケンス図wikipediaより引用実装方針Prototypeクラスはインスタンスを複製するための基底メソッドcloneを規定するtemplatemethodパターン。 2021-05-07 17:39:02
python Pythonタグが付けられた新着投稿 - Qiita pixivpyでpixivのブックマークした画像を全てダウンロードしてくる https://qiita.com/genshi0916/items/e17d0a5c7fd226714f3c 退屈なことはpythonにやらせよう誰でも度は「手動でpixivのブックマークした画像全てをダウンロードしてくるのは面倒、、」と思ったことがあると思います。 2021-05-07 17:19:12
python Pythonタグが付けられた新着投稿 - Qiita forループを用いて辞書のキーとバリューを同時に表示させる(今日のPython Day7) https://qiita.com/mitsu4310/items/17a97bd02d7f0442cf0c ・辞書のキーとバリューをすべて取得するにはitems関数を用いよう。 2021-05-07 17:13:16
js JavaScriptタグが付けられた新着投稿 - Qiita React + OpenWeatherMap API で現在の気象を表示する https://qiita.com/honda28/items/60323f80dde9761fc006 現在はWeathermapsがローンチしており、そこでは予報データや過去のデータも取得できるとのことだったが、試したところ結果がうまく反映されなかったので、うまく扱える人がいたら教えて下さい。 2021-05-07 17:15:43
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) WPなどの商品検索のカテゴリの階層について https://teratail.com/questions/337049?rss=all 階層 2021-05-07 17:58:59
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) WordPress:Advanced Custom Fieldsの「関連」で取得した投稿記事の条件分岐した値を取得したい https://teratail.com/questions/337048?rss=all WordPressAdvancedCustomFieldsの「関連」で取得した投稿記事の条件分岐した値を取得したいカスタム投稿タイプ①nbspカスタム投稿タイプ②の関連記事を選択カスタム投稿タイプ②nbspラジオボタンで色を選択カスタム投稿タイプ①で、AdvancednbspCustomnbspFieldsのタイプ「関連」を使用して、投稿で任意の記事を取得できるようにしています。 2021-05-07 17:47:53
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) Python sympy 複数解からの抽出法 https://teratail.com/questions/337047?rss=all 2021-05-07 17:46:18
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) GoogleClabにてmatplotlibを用いて描画したグラフのローカル保存 https://teratail.com/questions/337046?rss=all 2021-05-07 17:42:56
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) excelでホーム>フォントが一緒なのに実際に表示されている部分が違う https://teratail.com/questions/337045?rss=all excelでホームフォントが一緒なのに実際に表示されている部分が違うお世話になっております。 2021-05-07 17:41:49
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) python fileがセーブ出来ません https://teratail.com/questions/337044?rss=all 原因は何なのでしょうか、また解決方法があれば教えて頂きたいと思っておりますよろしくお願いします。 2021-05-07 17:39:53
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) herokuエラー rails refile 本番環境 https://teratail.com/questions/337043?rss=all herokuエラーrailsrefile本番環境前提・実現したいこと今現在webアプリを作っておりherokuにデプロイしたところエラーが出てきたのですがエラー文にあるようにRefilesecretkeyをapplicationcontrollerrenderer入力して再起動をしたのですが同じようなエラーが出てしまいます。 2021-05-07 17:34:35
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) チェックBOXで選択した項目を削除したいです。 https://teratail.com/questions/337042?rss=all チェックBOXで選択した項目を削除したいです。 2021-05-07 17:26:18
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) 座標検知し名前をつけてコード内でそのまま使いたい https://teratail.com/questions/337041?rss=all 座標検知し名前をつけてコード内でそのまま使いたい前提・実現したいことpythonopenCVnbspで点をマウス入力で座標を確認し、その点を用いて透視変換するようなコードを書きたいです。 2021-05-07 17:23:12
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) UnityでECサイトのようなスマホアプリは開発できますでしょうか? https://teratail.com/questions/337040?rss=all UnityでECサイトのようなスマホアプリは開発できますでしょうか前提・実現したいこと掲題の通りになりますが、UnityCでECサイトのようなスマホアプリは開発できますでしょうかSwift、Kotlin、ReactNative、Flutterなどで作れるのはわかっていますし、列挙した言語の方が適しているとは思います。 2021-05-07 17:19:46
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) Unity別のインスペクターにあるスクリプトを呼び出す方法 https://teratail.com/questions/337039?rss=all Unity別のインスペクターにあるスクリプトを呼び出す方法九九のゲームを作ってまして、正解だと花火があがるようにしたいのです。 2021-05-07 17:12:53
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) VSCodeのSFTPでファイルをアップロードしようとすると、No such fileと出て失敗してしまいます。 https://teratail.com/questions/337038?rss=all VSCodeのSFTPでファイルをアップロードしようとすると、Nosuchfileと出て失敗してしまいます。 2021-05-07 17:06:50
Ruby Rubyタグが付けられた新着投稿 - Qiita Rails Gem JSONをシリアライズする active_model_serializersを学ぶ https://qiita.com/morioka1206/items/8c395c5d0bb6a2cd9592 とのことですが、データをJSONで返すのもシリアライズされた結果のようです。 2021-05-07 17:52:33
Ruby Rubyタグが付けられた新着投稿 - Qiita [Rails] gem 'mailcatcher' をインストールした際に起きたエラーの対処 https://qiita.com/tsuchiya_2/items/93382349e84d47ffb0c5 開発環境OSmacOSBigSurRubyRubyonRailsローカル環境DBMysqlテキストエディタVisualStudioCode起きたエラーmailcatcherはbundleでインストールすると上手く動かないことがあるそうなので、ターミナルからgeminstallmailcatcherを入力してインストールしました。 2021-05-07 17:49:37
AWS AWSタグが付けられた新着投稿 - Qiita CloudFormationを理解する【環境構築〜運用について】 https://qiita.com/mby/items/097b1bde32ea83bbd34b ドリフト検出→テンプレートに反映→反映されたテンプレートに対して変更をかける→スタック更新リソースの保護リソースを更新する際に誤ってスタックやリソースが予期せず変更削除されないように複数レイヤーの保護機能で対策する・IAMポリシーユーザーの権限を調整する・スタックポリシースタック更新の際の意図しない変更削除を防ぐためにスタックのリソースに対して個別に設定するstackpolicyjsonというファイルにポリシーを記載するか、管理コンソールから追加する事もできる下記はjsonファイルのイメージStatmentEffectDenyActionUpdate・リソースのdeletionポリシーリソース自体の保護。 2021-05-07 17:05:34
Ruby Railsタグが付けられた新着投稿 - Qiita Rails Gem JSONをシリアライズする active_model_serializersを学ぶ https://qiita.com/morioka1206/items/8c395c5d0bb6a2cd9592 とのことですが、データをJSONで返すのもシリアライズされた結果のようです。 2021-05-07 17:52:33
Ruby Railsタグが付けられた新着投稿 - Qiita [Rails] gem 'mailcatcher' をインストールした際に起きたエラーの対処 https://qiita.com/tsuchiya_2/items/93382349e84d47ffb0c5 開発環境OSmacOSBigSurRubyRubyonRailsローカル環境DBMysqlテキストエディタVisualStudioCode起きたエラーmailcatcherはbundleでインストールすると上手く動かないことがあるそうなので、ターミナルからgeminstallmailcatcherを入力してインストールしました。 2021-05-07 17:49:37
Ruby Railsタグが付けられた新着投稿 - Qiita Railsチュートリアルで早速Railsがインストールできなかった話 https://qiita.com/friendtree16/items/62c7ec366c107c4b1313 Railsチュートリアルで早速Railsがインストールできなかった話背景Railsのチュートリアルをチュートリアル通り進めると、早速Railsのインストールでエラーが出たので、対処法。 2021-05-07 17:25:34
海外TECH DEV Community How To Improve Your SEO Ranking https://dev.to/jemimaabu/how-to-improve-your-seo-ranking-1d7j How To Improve Your SEO RankingFun fact if you Google front end developer Nigeria my portfolio website shows up on the first page Why SEO Search Engine Optimization SEO is how you make sure your website shows up in relevant search results Ranking refers to a website s position in those search results In this article we ll be discussing how to optimize your website or brand to help you get a high ranking on Google and other search engines We ll also discuss how to improve the online presence for yourself or your brand I d like to preface this by saying that I m not an SEO expert so I ll just be sharing the tips that worked for me Here s what we ll be covering in this article What is SEO Why is SEO important How do I improve my website s SEO ranking How do I improve my personal my brand s online presence How do I test the SEO of my websites What is SEOSearch engine optimization is the process of improving the quality and quantity of website traffic to a website or a web page from search engines Simply put SEO is ensuring that your website receives relevant and continuous traffic through organic search results Organic search results refer to results that show up in search terms due to relevancy as opposed to paid search results Studies have shown that people tend to click more on organic search results than ads SEO doesn t just affect your websites it affects the visibility of anything you post online such as articles products or videos The world of Search Engine Optimization is so vast and complex that companies have dedicated SEO managers just to ensure the visibility of their brand Importance of SEOThe major importance of SEO is to increase the traffic and visibility of your website and content High rankings are the best way to generate traffic to your site The above image is a screenshot of the traffic for an article I wrote in The article has had over views since then and over of that traffic was from organic search results on Google Having a high ranking means that you no longer have to constantly market your products and content and instead you attract your target audience naturally Think of it this way when was the last time you went to the second page of Google The higher your search engine ranking the more visible your site is Tips for Improving SEOThere are multiple ranking factors that can affect the SEO of your site but I ll be focusing on the factors I prioritized in order to optimize my website AccessibilityMetadataRelevant content and linksPerformance and page speedTraffic and backlinksDomain name and extensions AccessibilityAccessibility means creating websites that can be used by everyone Ideally you should build your websites to be as accessible as possible Not only is it considered best practice but it also directly affects your site SEO Accessibility also improves user experience which is another important contributor to SEO Here are some quick tips to focus on to ensure your personal website meets base accessibility needs Use the lang attribute in your HTML tag The lang attribute is what allows browsers to translate websites from one language to another so be sure to write your HTML tags appropriately e g lt html lang en gt Use alt tags for images that require description Alt tags describe the content of an image for screen readers and should be included as attributes in image tags lt img alt src gt Alt tags are also used by search engines to return relevant image results Use semantic elements for creating layouts in HTML Semantic elements such as nav footer and header provide a description of the content to screenreaders Use heading tags in the appropriate order The rule of thumb is to have only one H tag on a page serving as the title and let the headings follow in sequential order i e a h tag shouldn t appear before a h tag in the same section Ensure that the colors on your site have adequate contrast Adequate contrast between the colors of the text and the background allows for easily readable content Use descriptive links Links on your website should describe the page they lead to e g Read More About Me rather than generic statements like Click Here You can view my slides on Getting Started With Web Accessibility watch my video on Understanding Accessibility as A Concept or check out the Accessibility Checklist by Jay Nemchik for more information and resources MetadataMetadata is what provides information about your website to search engines The two major tags for SEO are Title The lt title gt tag is included in HTML and it contains the name of your webpage It s a good idea to include your main keyword in your title tag lt title gt Jemima Abu Front End Developer lt title gt The title tag should be changed on each page to describe the content of the new page e g lt title gt About Me Jemima Abu lt title gt A descriptive title also improves the ranking for articles and videos Your title should be between to characters to avoid search engines truncating or ignoring it Description The description tag describes the content of your webpage and it s also placed in the tag of your HTML page It should explain the main goal of your webpage and use more keywords related to the message you re trying to pass along lt html gt lt head gt lt meta name description content Jemima Abu is a self taught Front End Developer and school taught Systems Engineer from Lagos Nigeria gt lt head gt lt html gt Another tag to mention is the keywords tag It was previously used by search engines to match relevant keywords but most search engines have announced that they no longer consider the meta keyword tag in a site s ranking Using too many keywords can also have a negative impact on your site s SEO as this could be seen as spam by some search engines Relevant content and linksProviding relevant content on your website increases your website s SEO ranking Here are some tips on increasing the relevancy of content for articles Use action words in your title and words related to search terms An article with a title like Introduction to Web Accessibility or How to Make Your Website Accessible would be placed higher than an article simply titled Web Accessibility Use proper formatting by separating sections with titles and emphasizing important content using bold text or italics Include links to related resources in your article Using outbound links can lend to the credibility of your content Avoid plagiarism If Google detects the same content in two search results they ll remove whichever they consider least relevant If you re trying to upload your content to multiple sites be sure to include a canonical link text A canonical tag aka rel content appearing on multiple URLs Provide a summary of your content in list tags Google tends to place summarized content at the top of search results Using relevant keywords in the link of your article also helps with ranking If I write an article titled How To Make Your Website Accessible a good link would be myblog make your website accessible Performance and Page SpeedPerformance and page speed are factors used by Google to determine a website s ranking If your page loads slowly or has poor performance it directly affects your SEO Here are some tips on improving how fast your page loads Reduce images to the maximum rendered size If an image on a page only gets rendered at a maximum width of px then the width of the actual image shouldn t be more than px You can also optimize your images to reduce their data size Avoid using embeds When using embeds the time it takes them to load is also calculated with your page speed I was able to increase my page speed score from to by getting rid of the YouTube embeds on my landing page Reduce loading animation Google measures how long it takes for content to appear on your page so if you re animating content into the page the time for animation might affect your score Try to keep all loading animation under s Minify your files You can reduce the size of your CSS and JavaScript files by minifying them This means removing all spaces new lines and other unnecessary characters You can use the Minifier tool to do this manually You can use Page Speed Insights on your website to get more information on how to improve the performance and decrease loading time Traffic and backlinksIf your site gets a lot of traffic from other sources it increases its ranking as it seems more relevant A good way of generating traffic and improving your SEO is using backlinks Backlinks are the inbound links for your site They re created when other websites link to your site Backlinks are basically votes from other sites vouching for the credibility of your site A backlink from a highly ranked site also boosts your ranking Google uses backlinks as one of their top three ranking factors You can create backlinks by including a link to your site whenever you appear online If you publish an article for an online magazine or you appear in an interview including a link to your website on those sources create more backlinks for your site You can read this article to learn more about backlinks You can also use the Google Analytics tool to detect how much traffic your website generates and which sources you acquire traffic from Domain name and extensionsHaving a domain name tailored to your website is a good way of increasing traffic to your site as it lends credibility Your domain name should perfectly represent your website e g use your full name for a personal site or the main keyword for a business site The domain extension also matters com domains are the most popular domain extension and tend to have higher rankings For location targeted rankings you can use country code domains e g co uk or eu You can buy a domain name on Namecheap this is an affiliate link so I get a commission if you decide to buy with this link Tips for creating an online presenceHaving an online presence refers to having all results related to you or your brand show up when you Google yourself While all the tips for improving SEO can also be applied to increasing your search results here are some specific actions you can take to ensure a solid online presence Have a personal website If you re trying to secure your brand s online presence invest in a com domain name and make sure all your other online accounts Twitter Instagram LinkedIn point to that site You can read my article How To Create a Portfolio Website for a step by step guide to creating your personal website Direct traffic to your site Aside from organic traffic you can also take advantage of your social media presence to direct traffic to your personal site If you have a viral tweet or video be sure to include a link to your site somewhere Create accounts on larger platforms If you re going to create a personal blog you might generate more traffic by creating it on a site like Hashnode Medium or Dev to than a lesser known platform Use the same username across all accounts and URLs If you have a name you want to be known by online make sure that s the name that you use for every account and in the same format Use common keywords on all your accounts I use pretty much the same tagline for all my accounts Self taught Front End Developer School Taught Systems Engineer so this helps link them together Testing for SEOYou can test your website s SEO by running the Lighthouse audit tool in Google Chrome The audit returns a score based on how optimized your site is for search engines The passed audits section contains the features of your website that improves SEO You can also use an online SEO checker to get a more detailed report on the SEO of your website ConclusionAnd that s how you can get your website to the first page of search results for relevant keywords If you re interested in more in depth research on the workings of SEO you can check out these articles and tutorials What is Search Engine Optimization Crucial SEO Ranking Factors You Need To Know SEO Specialization University of California CourseraYou can also read my article on How I Built My Perfect Portfolio Website for more insight into the process of creating my website If you found this article useful and you d like to contribute to my content creation feel free to buy me a coffee If you have any questions or comments leave a message below or reach out on Twitter 2021-05-07 08:19:10
海外TECH DEV Community Switching up your Spotify experience with microfrontends and Blazor https://dev.to/dantederuwe/switching-up-your-spotify-experience-with-microfrontends-and-blazor-4k72 Switching up your Spotify experience with microfrontends and BlazorIn my previous article I talked about creating a Netflix clone using Piral an open source framework for creating modular applications I highly recommend giving that article a quick read first if you are not yet familiar with microfrontends and or Piral My experiences creating a Netflix clone using microfrontends Dante De Ruwe・Mar ・ min read piral microfrontends react webdev Since then I ve been making contributions on GitHub and working closely together with the maintainers of Piral to provide a helping hand to improve their framework in any way I could The main bulk of the improvements was made in their converter for Blazor In this article I will share my experiences creating a microfrontend web app with Blazor and Piral I ll also give a little behind the scenes look at how this was made possible highlight some of the quirks of using Blazor in a microfrontend solution and explain how the combination of Piral and Blazor has improved ContentsSpiralfy a modular web applicationOverviewThe Spiralfy appshellThe player a simple piletThe controls a Blazor pilet Dev story making Blazor work with microfrontendsLooking backWhat needed improvement and why What has changed and improved Final thoughts Spiralfy a modular web applicationFirst of all let s discuss the demo application that I created to showcase the use of Blazor with Piral Spiralfy A clever or some would say cheesy play on words between Spotify and Piral of course But what does it do Log in with your Spotify premium account and access a way to switch up your Spotify experience OverviewFor a long time now I wanted a way to shuffle play my playlists I m not talking about shuffling the songs within one playlist that s something you can obviously already do The feature I wanted could be described as swiping through playlists Spiralfy picks one playlist at random shuffle playing its songs and whenever you feel like you want a different vibe you let Spiralfy pick a new playlist to listen to I got inspired in part by lofi cafe where you can switch through curated lofi playlists like they were radio stations But I wanted the user to be able to use their own Spotify playlists instead The code Talk is cheap Show me the code Linus ThorvaldsSpiralfy is a modular distributed web application also known as a microfrontend application In my previous microfrontend project I decided to make separate GitHub repositories for each and every module to really demonstrate that these are highly decoupled and autonomous This time I chose to bundle all parts into one repository a monorepo just because it would be easier to discover and browse all the code at once You can find the code on git io spiralfy DanteDeRuwe spiralfy A different way of using Spotify Built using a microfrontend approach with Piral Blazor and React switching up your Spotify experience with microfrontends and BlazorMade with React Blazor and Piral AboutFirst of all let s discuss the demo application that I created to showcase the use of Blazor with Piral Spiralfy A clever or some would say cheesy play on words between Spotify and Piral of course But what does it do Log in with your Spotify premium account and access a way to switch up your Spotify experience For a long time now I wanted a way to shuffle play my playlists I m not talking about shuffling the songs within one playlist that s something you can obviously already do The feature I wanted could be described as swiping through playlists Spiralfy picks one playlist at random shuffle playing its songs and whenever you feel like you want a different vibe you let Spiralfy pick a new playlist to listen to … View on GitHubFor now Spiralfy exists in parts the Piral instance spiralfy appshellthe player piletthe controls piletWhat are these words In case you did not read my previous article a quick summary here In the Piral framework pilets are the individual feature modules also known as microfrontends Pilets are usually published to a feed service The Piral instance aka app shell will pull all registered pilets from the feed service and put them where they need to go as defined by the pilets themselves The Spiralfy appshellFor the Spiralfy app shell I decided to go with piral core instead of the full piral framework I actually started with the full version of Piral but after realizing that I will not be using any dashboards translation notifications and other fancy features bundled in a collection called piral ext I migrated to piral core The Piral docs page on piral core actually describes this scenario pretty well Quite often the scenario is that somebody starts with piral but then realized that one or the other plugin should not be included In any of these cases a migration from piral to piral core makes sense There were only plugins that I actually wanted piral menu in case I would want to add items to the navigation menu in an easy way and piral blazor for reasons explained below So the index tsx file looks a little bit like this import as React from react import render from react dom import createBlazorApi from piral blazor import createInstance Piral SetErrors SetLayout from piral core import createMenuApi from piral menu import errors layout from layout const feedUrl const instance createInstance plugins createBlazorApi this is where the magic is included createMenuApi requestPilets gt fetch feedUrl then res gt res json then res gt res items const piral lt Piral instance instance gt lt SetLayout layout layout gt lt SetErrors errors errors gt lt Piral gt render piral document querySelector app Things to notice about this setup the plugins each come from their respective packages not from piral in the full Piral framework we would use renderInstance Piral core however does not come with react bundled It means we should use the standard render method from react dom to render our Piral instance read more here piral blazorAlthough I called piral blazor a plugin it is actually considered a converter a package that brings support to use a different UI framework Piral supports around different UI frameworks other than React If you would like more information on how piral blazor works I would suggest you read the second part of this article too I included the Blazor converter in the app shell because I already knew I was going to add a Blazor pilet It s also possible to load piral blazor from a pilet This is for example useful if the app shell already existed and you don t want to change it This is beyond the scope of this article The player a simple piletThe player pilet is rather barebones It uses the following npm package which is neat wrapper around the Spotify web playback SDK gilbarbara react spotify web playback A simple player for Spotify s web playback This allows us to have Spotify playback from the browser If we only used the Spotify API we could control the playback but we would have to have an active device it is playing on This eliminates that Since I wanted to make my own layout for a player in Blazor I m setting this one to display none This way it s loaded but it s also hidden from view Yes I am aware that this is hacky stop bullying me While the pilet is simple this is however demonstrating a niche problem that is pretty well solved by the fact that Piral and microfrontends in general can be very technology independent If you want to write an app in Blazor but a certain feature has a pretty nice Javascript library already You can most of the time just use it from a different microfrontend This way there s way less need in having to struggle with any JS interop The controls a Blazor pilet Now for the interesting bit the Blazor pilet To create the Blazor pilet I followed the documentation for Piral Blazor from their README on GitHub Piral Blazor is a set of NuGet packages that will make Piral work from the NET side smapiot Piral Blazor All NET things to make Blazor work seamlessly in microfrontends using Piral The process boils down to installing a template If you want to transform an existing Blazor app however all you have to do is defining the app shell name installing the Piral Blazor Tools package that will create the right files for your pilet and installing Piral Blazor Utils to be able to use custom Piral attributes in your code To make the interaction with the Spotify API a lot easier I used the following great NuGet package which provides fully typed responses and requests JohnnyCrazy SpotifyAPI NET A Client for the Spotify Web API written in C NET Alright after this round of NuGet installing we can talk about the components A standard page in Blazor using the page directive will work as expected and will be automatically registered on the pilet API This is what I used to register the player on the homepage For an extension like a login button that should end up in the app shell header we can use the PiralExtension attribute specifying the name of the extension slot you want to render into attribute PiralExtension header items if username is null lt a href authUri gt Login via Spotify lt a gt else lt p gt Welcome username lt p gt code And I would say That s almost the entire story Because Piral Blazor does some pretty neat stuff under the hood the developer experience of creating a Blazor pilet is really similar to creating a regular Blazor WASM application Let s run it Because we are using Piral running the Blazor pilet does include an extra step We need to use the Piral CLI to do its magic Again the Piral Blazor docs to the rescue From your Blazor project folder run your pilet via the Piral CLI npx pilet debug base piral lt project name gt You could also add a feed argument as outlined here In addition to this if you want to debug your Blazor pilet using for example Visual Studio you can just run the pilet with IISExpress if you want to use Blazor there are extra things to consider You can read about them here The cool kids use Blazor anyway ⌐ This way you can really use the entire Blazor debugging experience hitting breakpoints stepping through your code and so on Dev story making Blazor work with microfrontendsAchievement unlocked you have reached part of the story In this part I wanted to take the opportunity to tell you about how the combination of Piral and Blazor has matured over the period that I was actively contributing to its codebase working closely together with the maintainers of Piral Looking backNow how was Piral with Blazor organized some or months ago The Piral Blazor ecosystem in March This does not look too complicated Let s break it down For the Piral instance we rely of course on the Piral framework although as said before this could also be piral core Next to that we also need piral blazor as a converter Under the hood piral blazor would actually download the Piral Blazor Core NuGet package which would contain Blazor framework files dlls boot files metadata etc custom code that would expose some methods that can be invoked from the JS side to register load and unload componentsmake sure activated components get rendered in a lt div gt with a specific idprovide a way to register dependencies from the pilets in the DI container piral blazor would include these files in the Piral instance and could call the exposed methodes using JS interop This then would allow exposing some functions in the pilet API to allow pilets to activate components from their setup function The pilets would be created using the official template The template created files that can be divided into categories the Blazor filesother files mainly TS codegen and JSON files where the registration with the pilet API was handled setup function etc The Blazor files can be considered to be the heart of the pilet while the other files were just there to be the proverbial glue that would make everything integrate into the Piral framework Still confused Below I give an example on how this all worked ExampleLet s say you know how to create the most beautiful counter component in Blazor You want to use this counter as a microfrontend in your React application and give it a dedicated page Maybe you would also want to render it as an extension on another part of your web app Of course you are already using Piral You would add the piral blazor converter to the plugins of your Piral instance Then you would then set up a pilet using Piral Blazor Template and add your counter component To expose this component to be able to get picked up by Piral you would add an ExposePilet attribute This would look like this attribute ExposePilet my awesome counter lt div gt lt p gt Current count count lt p gt lt button onclick Increment gt Increment lt button gt lt div gt code int count void Increment count Then you would edit the created index tsx file to something like import PiletApi from lt name of piral instance gt export function setup app PiletApi app defineBlazorReferences require resolve My Dependency dll require resolve My Components dll app registerPage counter app fromBlazor my awesome counter page app registerExtension counter slot app fromBlazor my awesome counter extension These last lines would register the counter component as a page and an extension via the pilet API piral blazor would then via Piral Blazor Core lookup the component in the defined references activate it using JS invokable methods and integrate it somewhere in the webpage What needed improvement and why There are several aspects where the aforementioned ecosystem could improve Below I outline some of the goals that were set to make this better The user should be able to select the version of Blazor they want independently of the piral blazor version because the latter is tied to the Piral version There should be a way to transform an existing Blazor application into a Blazor pilet with minimal effort Registering Blazor dependencies is cumbersome and error prone they need to be manually entered and if they are not in the right order they will not load correctly Ideally we would have an automatic solution Registering pages and extensions onto the pilet API should be possible purely from Blazor without having to do any TypeScript configuration in the setup function Additionally to define pages we should not use a custom attribute but use the built in page directive from Blazor Debugging a Blazor pilet from for example Visual Studio should be possible triggering breakpoints stepping through the code Various improvements to single page navigation static files scoped razor styles What has changed and improved Let s dive right in by providing an updated diagram of the Piral Blazor ecosystem The Piral Blazor ecosystem in May Let s go over the improvement goals and see how this new architecture fulfills them The user should be able to select the version of Blazor they want independently of the piral blazor version because the latter is tied to the Piral version This first goal was made possible by extracting the responsibility of dealing with Blazor files into a new npm package called blazor and including it as a peer dependency of piral blazor This way the user can install a piral blazor version that corresponds to their Piral version and choose any version of the blazor package to include any version of Blazor e g blazor x will resolve to the NET Blazor release train There should be a way to transform an existing Blazor application into a Blazor pilet with minimal effort For this goal we created Piral Blazor Tools The workflow for transforming a Blazor project into a pilet now looks something like this Add a PiralInstance property to your csproj file with the name of your Piral instance Install the Piral Blazor Tools packageBuild the project The first time you do this this can take some time as it will fully scaffold the pilet stuff omitted for brevity Read the complete description here This is the reason the template is now grayed out on the diagram you don t need it anymore but it s still nice to get a quick start Template or not the tools package will do all the heavy lifting and create all files needed for integration with the final framework But this time they will not be mixed in with the Blazor files the user should not see these at all We decided to put them all in a piral folder This final tilde makes it so that this folder will by default not be checked in thanks to the default NET gitignore file Registering Blazor dependencies is cumbersome and error prone they need to be manually entered and if they are not in the right order they will not load correctly Ideally we would have an automatic solution The tools package allows us to scaffold the pilet and also copy over any files that we like to the user s pilet We used this to fix this problem by letting the tools copy over a blazor codegen file If you are unfamiliar with codegen files no worries I was too They are basically ways to generate code at build time Here you can learn more about one of the loaders that Piral can use this is one for Parcel FlorianRappl parcel plugin codegen Parcel plugin for bundle time code generation Simple powerful and flexible blazor codegen looks for a JSON file called project assets json to build up a dependency graph for the Blazor project and then traverses flattens this graph in the right order dlls without dependencies leaves in the graph should be loaded first then their parents and so on For you algorithm nerds this is depth first post order traversal It will then use this ordered list of dependencies to generate the pilet API integration code for us at build time How this works will become clearer together with the next goal Registering pages and extensions onto the pilet API should be possible purely from Blazor without having to do any TypeScript configuration in the setup function Additionally to define pages we should not use a custom attribute but use the built in page directive from Blazor This was an interesting challenge What has to happen for this to work is that we should have a list of all components that are defined as pages or extensions And as an additional challenge we need this list before the components are even loaded so we cannot simply get them at runtime Luckily when Blazor gets compiled this page directive just gets converted into a RouteAttribute and we also have the PiralExtension attribute so it s all attributes and we can treat these almost in the same way What we came up with is the Piral Blazor Analyzer a command line tool that will use reflection on the Blazor project dll to extract all components that have certain attributes The codegen then calls dotnet Piral Blazor Analyzer lt args gt the output of which gives us something like this routes counter extensions My Components Counter my awesome counter The codegen then has all the required information to create code for functions that the setup function needs The index tsx file then will use these generated functions from the codegen and becomes import PiletApi from lt name of piral instance gt import as Blazor from blazor codegen export function setup app PiletApi Blazor registerDependencies app Blazor registerPages app Blazor registerExtensions app Debugging a Blazor pilet from for example Visual Studio should be possible triggering breakpoints stepping through the code This was an interesting challenge The first step for me was learning how the debugger actually works I stumbled upon an excellent blog post by Safia Abdalla She s a software engineer at Microsoft on the NET team ltag user id follow action button background color DB important color FFFFFF important border color DB important Safia Abdalla I make open source at nteractio make software at Microsoft and write books and blogs Dream big and follow through even bigger The blogpost can be found on her personal blog Under the hood with debugging in Blazor WebAssembly There she explains the concept of the debugging proxy After some experiments and proof of concept work we found out that in Blazor we could not load the dlls and pdbs symbol files dynamically They had to be included in the blazor boot json file for them to get picked up by the debugger We solved this by configuring the Piral CLI using a kras script injector I won t go into too much detail here so I m oversimplifying massively kras is a proxy mock server for your frontend FlorianRappl kras Efficient server proxying and mocking in Node js While it is most commonly used to mock a backend we can use it as a proxy too You can configure kras with js files included in a mocks folder Let s take a look at a code snippet mocks debug js const toProxy uniqueAssemblyNames uniquePdbNames const shouldBeProxied url gt toProxy filter x gt url endsWith x length amp amp url startsWith framework bin module exports ctx req res gt if shouldBeProxied req return proxy req iisUrl else if req url endsWith blazor boot json return returnWithTweakedBBJson res This last part is what we mentioned before when we debug we want to modify the blazor boot json file to include our pilet dlls and pdbs so they get loaded when the debug starts As we see on line a request should be proxied if the url points to one of our unique dlls or pdbs This means the shared dlls from the appshell will just be loaded as normal but the dlls the Pilet brings will be proxied On line we can see where to the requests for the pilet dlls will be proxied to the url where IISExpress is running we can get this from the launchSettings json file by the way Because of this hack we can now trigger breakpoints in Visual Studio step through the code inspect variables etc Oh by the way NET made stuff a lot easier with the inclusion of lazy loading I won t give a full explanation but it boils down to we can now just load the pilet dlls and pdbs lazily and everything just works Proxying and tweaking the boot file isn t necessary Various improvements to single page navigation static files scoped razor styles I won t go into details about these There are always things to improve about code and these were some major ones ExampleWe take the same scenario as before the counter With the new setup if we want a page there is nothing at all to do that is special We just need a regular Blazor page If we also want to expose an extension we can use the new PiralExtension attribute from Piral Blazor Utils page counter attribute PiralExtension my awesome counter lt div gt lt p gt Current count count lt p gt lt button onclick Increment gt Increment lt button gt lt div gt code int count void Increment count The tooling will do all the rest No more screwing around in TypeScript for a setup function to manually create and keep updated Isn t that convenient For more advanced uses you can still define an optional setup tsx file Refer to the README to see how that works Final thoughtsMy first thought after writing this article would be damn I wrote quite a long article again immediately followed by are people actually going to read this one My last post was received very well and I thank each and everyone that reacted to it Feel free to let me know in the comments if this article was in any way interesting helpful or cool I enjoyed contributing to Piral a lot I ve always wanted to dive into the open source community and because of the guidance given by the Piral maintainers I feel like I could make a difference in this project Piral is also pretty damn cool if you ask me Looking back on it in my opinion using Piral and Blazor has become better in both functionality and developer experience and I m really proud of that hey a Belgian guy that says he is proud of something that s quite rare If you want to see my contributions first hand or just criticize my code here and here are lists of the PRs I made Then I want to address Blazor While I can definitely see the appeal of it and it s a cool technology it was pretty hard to get a grasp on the technical side of it Lots of the stuff that s going on is quite magical at first I m glad the entire thing is open source because finding solutions often meant peeking behind the curtain and reading the source files on the dotnet aspnetcore repo Because of this however I ve learned an awful lot about how Blazor WebAssembly works what the limitations and weird quirks are etc It also just broadened my knowledge of the NET ecosystem as a whole 2021-05-07 08:03:26
海外科学 NYT > Science A Giant Wood Moth Surfaced at an Australian School https://www.nytimes.com/2021/05/07/world/australia/giant-moth-australia.html A Giant Wood Moth Surfaced at an Australian SchoolA giant wood moth the heaviest of all known moths appeared on the side of a school building in Queensland Australia enthralling students who are used to diverse wildlife 2021-05-07 08:55:04
海外科学 BBC News - Science & Environment India Covid: How bad is the second wave? https://www.bbc.co.uk/news/56987209 india 2021-05-07 08:54:17
医療系 医療介護 CBnews 国保連件数も大きめのマイナス続く、3月審査分▲5.8%-支払基金と同様の傾向 https://www.cbnews.jp/news/entry/20210507172834 国民健康保険 2021-05-07 17:45:00
医療系 医療介護 CBnews 入院調整本部への依頼件数が1カ月前と比べて倍増-東京都がコロナモニタリング会議の専門家意見公表 https://www.cbnews.jp/news/entry/20210507170139 日当たり 2021-05-07 17:40:00
海外ニュース Japan Times latest articles Can Fuji Rock’s all-Japan lineup give J-pop a post-pandemic push? https://www.japantimes.co.jp/culture/2021/05/07/music/can-fuji-rocks-japan-lineup-give-j-pop-post-pandemic-push/ japanese 2021-05-07 19:00:12
ニュース BBC News - Home Elections 2021: Conservatives take Hartlepool from Labour in by-election https://www.bbc.co.uk/news/uk-politics-57019456 mortimer 2021-05-07 08:40:27
ニュース BBC News - Home Julia James: Police don't know weapon used to kill PCSO https://www.bbc.co.uk/news/uk-england-kent-57019607 james 2021-05-07 08:21:34
ニュース BBC News - Home India Covid: How bad is the second wave? https://www.bbc.co.uk/news/56987209 india 2021-05-07 08:54:17
ニュース BBC News - Home Scottish election 2021: Scotland awaits results https://www.bbc.co.uk/news/uk-scotland-scotland-politics-57014885 holyrood 2021-05-07 08:34:16
ニュース BBC News - Home What are the India, Brazil, South Africa and UK variants? https://www.bbc.co.uk/news/health-55659820 covid 2021-05-07 08:48:47
北海道 北海道新聞 釣りやロープ渡りに親子笑顔 上ノ国に自然体験拠点開園 https://www.hokkaido-np.co.jp/article/541219/ 開園 2021-05-07 17:10:00
北海道 北海道新聞 襟裳岬の緑化事業を映画に 脚本家・小松江里子さんに聞く https://www.hokkaido-np.co.jp/article/541199/ 小松江里子 2021-05-07 17:04:07
北海道 北海道新聞 道内4人死亡、248人感染 札幌は154人 新型コロナ https://www.hokkaido-np.co.jp/article/541187/ 新型コロナウイルス 2021-05-07 17:08:05
ビジネス 東洋経済オンライン 日中戦争後に日本陸軍将兵が受けた意外な対応 蒋介石は報復しないと表明、武装保持を命じた | 中国・台湾 | 東洋経済オンライン https://toyokeizai.net/articles/-/425589?utm_source=rss&utm_medium=http&utm_campaign=link_back 太平洋戦争 2021-05-07 17:30:00
ビジネス 東洋経済オンライン ラーメン店の倒産ラッシュが必然な訳【動画】 「1000円の壁」突破する仕掛けが生き残りの鍵だ | 外食 | 東洋経済オンライン https://toyokeizai.net/articles/-/426964?utm_source=rss&utm_medium=http&utm_campaign=link_back 帝国データバンク 2021-05-07 17:10:00
IT 週刊アスキー PS5ソフト『テニス ワールドツアー 2 COMPLETE EDITION』の紹介動画を公開! https://weekly.ascii.jp/elem/000/004/053/4053987/ completeedition 2021-05-07 17:50:00
IT 週刊アスキー Twitter、“投げ銭”できる新機能「Tip Jar」を発表 https://weekly.ascii.jp/elem/000/004/053/4053970/ tipjar 2021-05-07 17:30:00
IT 週刊アスキー イープラスがお酒の通販サイトを開始、お酒付きチケットなど展開へ https://weekly.ascii.jp/elem/000/004/053/4053978/ 通販サイト 2021-05-07 17:30:00
IT 週刊アスキー サンコー、スマホを腕に巻き付けられる「持たずに操作!ハンズフリーマルチアングルスマホホルダー」を発売 https://weekly.ascii.jp/elem/000/004/053/4053983/ 操作 2021-05-07 17:30:00
IT 週刊アスキー 『モンスターハンターライズ』スタンプ「忍者セット」が手に入るイベントクエストが本日配信! https://weekly.ascii.jp/elem/000/004/053/4053985/ nintendo 2021-05-07 17:30:00
IT 週刊アスキー 日清食品とPFN、完全栄養食の共同研究開始に合意 https://weekly.ascii.jp/elem/000/004/053/4053982/ preferrednetworks 2021-05-07 17:15:00
IT 週刊アスキー セブンに「一風堂監修とんこつ焼ラーメン」これは気になる~! https://weekly.ascii.jp/elem/000/004/053/4053984/ 監修 2021-05-07 17:10:00

コメント

このブログの人気の投稿

投稿時間:2021-06-17 05:05:34 RSSフィード2021-06-17 05:00 分まとめ(1274件)

投稿時間:2021-06-20 02:06:12 RSSフィード2021-06-20 02:00 分まとめ(3871件)

投稿時間:2020-12-01 09:41:49 RSSフィード2020-12-01 09:00 分まとめ(69件)