js |
JavaScriptタグが付けられた新着投稿 - Qiita |
JavaScriptマスタリング: スキル向上のための5の重要な機能 |
https://qiita.com/figueiredoluiz/items/97ac7a27f65e5cae13e1
|
javascript |
2023-06-24 04:01:44 |
海外TECH |
DEV Community |
Tutorial on creating a NextJS Application for beginners |
https://dev.to/aryan_shourie/tutorial-on-creating-a-nextjs-application-for-beginners-495f
|
Tutorial on creating a NextJS Application for beginnersNextJS is an open source web development framework which provides us with extended features of ReactJS and gives us the building blocks to create web applications In this article I will explain some important points about NextJS and also build a sample NextJS application from scratch Features of NextJS Following are some effective features of NextJS that gives it the edge over other web development technologies Page based Routing system With NextJS we don t need to install any external package from NPM or YARN to use Routing in our projects like we install react router dom in React We just create a page in a special folder and NextJS creates a route for that page Pre rendering NextJS supports both Static Site Generation SSG and Server Side Rendering SSR Server Side Rendering SSR prepares the content of a page on a server while a one page React application uses Client Side Rendering CSR The problem with CSR is that it s not SEO friendly because search engines will not see the page s actual content Using SSR in NextJS can avoid such issues as a flickering page while data fetching and our website content will be SEO friendly Built in CSS and Sass support NextJS provides support for any CSS in JS library Code splitting NextJS allows developers to split their application code between different components Server Component and Client Component All the Backend related code i e A P I handling Database integration and Data fetching should be written in Server Components whereas all the UI related code should be written in the Client Components Dynamic Components Using NextJS we can also import JavaScript modules and React components dynamically Creating our own NextJS application from scratchFor this tutorial I am assuming that you have Node js and NPM installed in your system If not you can follow the steps mentioned here I will be using the Visual Studio Code Editor to write and maintain my code You can use any editor you desire but if you want to install and configure it follow the steps mentioned here Now lets start with creating our application Step Creating a NextJS application using create next app We already know that we can create a ReactJS application using the create react app command Creating a NextJS application is not much different as we can use the create next app command Type in the following command in your terminal npx create next app blog appOn typing this command you will be asked multiple questions regarding the setup of your project Once you answer all the questions a new NextJS application will be created based on your requirements Step Opening the application in VS Code and viewing the folder structure Go to the folder in which your application is located right click anywhere and you will see these options Click on Git Bash Here A Git Bash terminal will open type in the following command code Your NextJS application will now be opened in V S Code You can now see the folder structure You will see the following files and folders present next config js It is the configuration file for NextJS jsconfig json It is the configuration file for JavaScript gitignore It contains the Git files and folders to ignore eslintrc json It is the configuration file for ESLint src It is the optional application source folder app It is the App Router public It contains the static assets to be served layout js It contains the Common Layout of the application package json It contains the project dependencies and scripts Step Running your NextJS application Navigate to your project directory using this command cd blog appRun your application using the following command npm run devOn your browser go to http localhost to view your application This should be the output on your screen Step Making changes in the application Go to src app page js replace the code present in the file with the following code import Image from next image import styles from page module css export default function Home return lt main className styles main gt lt h gt Welcome to your first NextJS Application lt h gt lt main gt You will see the following output on the screen Step Making multiple routes for the application As said earlier NextJS supports a file based routing system We do not need to install any external package to use routing in our application In this step I will show you how to create routes for our blog application localhost first post amp localhost second postGo to src app and create new folders first post and second post Inside both these folders create a new file page js Go to src app first post page js and write the following code in it use client import Link from next link function FirstPost return lt gt lt h style color fff position absolute top left gt When to Use Static Generation v s lt br gt Server side Rendering lt h gt lt p style color lightgray fontSize px position absolute top left gt June lt p gt lt p style color fff position absolute top left fontSize px gt We recommend using lt b gt Static Generation lt b gt with and without data whenever lt br gt possible because your page can be built once and served by CDN lt br gt which makes it much faster than having a server render the page on every request lt p gt lt p style color fff position absolute top left fontSize px gt You can use Static Generation for many types of pages including lt p gt lt ul style color fff position absolute top left fontSize px gt lt li gt Marketing pages lt li gt lt li gt Blog Posts lt li gt lt li gt E commerce product listings lt li gt lt li gt Help and documentation lt li gt lt ul gt lt p style color fff position absolute top left fontSize px gt You should ask yourself Can I pre render this page lt b gt ahead lt b gt of a user s lt br gt request If the answer is yes then you should choose Static Generation lt p gt lt p style color fff position absolute top left fontSize px gt On the other hand Static Generation is lt b gt not lt b gt a good idea if you cannot pre lt br gt render a page ahead of a user s request Maybe your page shows frequently lt br gt updated data and the page content changes on every request lt p gt lt p style color fff position absolute top left fontSize px gt In that case you can use lt b gt Server Side Rendering lt b gt It will be slower but the lt br gt pre rendered page will always be up to date Or you can skip pre rendering lt br gt and use client side JavaScript to populate data lt p gt lt Link href style color blue position absolute top left gt ←Back to home lt Link gt lt br gt lt br gt lt gt export default FirstPost On your browser visit http localhost first post and you will see this output You have created your first route first post Now go to src app second post page js and write the following code in it use client import Link from next link function SecondPost return lt gt lt h style color fff position absolute top left gt Two Forms of Pre rendering lt h gt lt p style color lightgray fontSize px position absolute top left gt April lt p gt lt p style color fff position absolute top left fontSize px gt Next js has two forms of pre rendering lt b gt Static Generation lt b gt and lt b gt Server side lt br gt Rendering lt b gt The difference is in when it generates the HTML for a page lt p gt lt ul style color fff position absolute top left fontSize px gt lt li gt lt b gt Static Generation lt b gt is the pre rendering method that generates the lt br gt HTML at lt b gt build time lt b gt The pre rendered HTML is then reused on each lt br gt request lt li gt lt li gt lt b gt Server side Rendering lt b gt is the pre rendering method that generates the lt br gt HTML on lt b gt each request lt b gt lt li gt lt ul gt lt p style color fff position absolute top left fontSize px gt Importantly Next js lets you lt b gt choose lt b gt which pre rendering form to use for lt br gt each page You can create a hybrid Next js app by using Static Generation lt br gt for most pages and using Server side Rendering for others lt p gt lt Link href style color blue position absolute top left gt ←Back to home lt Link gt lt br gt lt br gt lt gt export default SecondPost On your browser visit http localhost second post and you will see this output You have created your second route second post Step Editing the home page Go to src app page js and write the following code in it import Link from next link import page module css export default function Home return lt main gt lt p style color fff position absolute top left fontSize px gt Hello World lt p gt lt h style color fff position absolute top left gt Blog lt h gt lt ul style position absolute top left fontSize px gt lt li gt lt p style color blue gt lt Link href first post gt When to use Static Generation v s Server Side Rendering lt Link gt lt p gt lt br gt lt p style color lightgray fontSize px gt June lt p gt lt li gt lt br gt lt li gt lt p style color blue gt lt Link href second post gt Two forms of Pre Rendering lt Link gt lt p gt lt br gt lt p style color lightgray fontSize px gt April lt p gt lt li gt lt ul gt lt main gt On your browser visit http localhost and you will see this output And thats it You have successfully created your first NextJS application Now our next and final step is to deploy it on VercelVercel is an American cloud platform as a service company It maintains the NextJS web development framework Its frontend cloud gives developers frameworks workflows and infrastructure to build a faster more personalized web app We can deploy our NextJS application on Vercel in mere minutes Step Push your NextJS application code to Github Go to and create a repository named nextjs blog Open your terminal in V S Code and write the following commands git initgit add git commit m Initial Commit git remote add origin Your Username gt nextjs blog gitgit push u f origin masterYou have successfully pushed your code to Github Your repository now should look like this Step Create a Vercel AccountFirst go to utm medium learnpages amp utm campaign no campaign to create a Vercel account Choose Continue with GitHub and go through the sign up process Step Import your RepositoryOnce you re signed up import your nextjs blog repository on Vercel You ll need to Install Vercel for GitHub You can give it access to All Repositories Once you ve installed Vercel import nextjs blog Step Deploy your applicationYou can use default values for the following settings ーno need to change anything Vercel automatically detects that you have a Next js app and chooses optimal build settings for you Project NameRoot DirectoryBuild CommandOutput DirectoryDevelopment CommandWhen you deploy your Next js app will start building It should finish in under a minute When it s done you ll get deployment URLs Click on one of the URLs and you should see the application starter page live Here is the sample URL of my NextJS application deployed on Vercel And thats it You have successfully learnt how to create and deploy a NextJS application Connect with me on Linkedin LinkedinDo check out my Github for amazing projects GithubView my Personal Portfolio Aryan s Portfolio |
2023-06-23 19:23:56 |
Apple |
AppleInsider - Frontpage News |
Nancy Pelosi exercises options for $1 million of Apple stock one day before expiration |
https://appleinsider.com/articles/23/06/23/nancy-pelosi-exercises-options-for-1-million-of-apple-stock-one-day-before-expiration?utm_medium=rss
|
Nancy Pelosi exercises options for million of Apple stock one day before expirationNancy Pelosi and her husband Paul have exercised options worth millions of dollars in both Apple and Microsoft stocks a day before the both would have expired Credit J Scott Applewhite APThe pair purchased shares each in both Apple and Microsoft stock a day before a call option expired This equates to roughly worth of Apple stock and million of Microsoft stock at their current price Read more |
2023-06-23 19:13:29 |
Apple |
AppleInsider - Frontpage News |
Apple replacing shuttered North Carolina store with new location |
https://appleinsider.com/articles/23/06/23/apple-replacing-shuttered-north-carolina-store-with-new-location?utm_medium=rss
|
Apple replacing shuttered North Carolina store with new locationThree months after Apple closed a North Carolina retail store it has filed permits to start construction on a new location just a handful of miles away Birkdale Village North CarolinaPermits have been filed for construction at Townley Road in Birkdale Village It will open as part of a larger effort to rejuvenate the area with new properties including Anthropologie Lilly Pulitzer Cheesecake Factory and other new retail venues opening at the center Read more |
2023-06-23 19:06:59 |
海外TECH |
Engadget |
Fossil finally gets Google Assistant on its Wear OS 3 smartwatches |
https://www.engadget.com/fossil-finally-gets-google-assistant-on-its-wear-os-3-smartwatches-194519611.html?src=rss
|
Fossil finally gets Google Assistant on its Wear OS smartwatchesGoogle Assistant vanished on many smartwatches when the Wear OS update arrived leaving just the Pixel Watch and Samsung s newer Galaxy Watches supporting the feature Thankfully you no longer have to switch brands just to talk to Google on your wrist Fossil is rolling out an update this month that adds Assistant to Gen watches running Wear OS This includes both Fossil s own models as well as counterparts from Diesel Michael Kors and Skagen although you ll need to be paired with a phone running standard Android with Google apps Android Go and many Chinese phones won t count The functionality will be familiar if you ve used either Google or Samsung wristwear You can invoke the AI helper by saying quot hey Google quot holding a button or tapping a watch face complication The feature lets you answer texts control music or otherwise handle tasks that would normally require your phone Unlike many alternatives though you ll also have Alexa on hand You won t be locked into one ecosystem for speaking commands This won t be much help if you re using a Wear OS watch from another brand like Mobvoi or Montblanc Fossil is one of the most popular names in Google powered smartwatches though Support here ensures that many more wearable owners can use Assistant and avoid tapping a minuscule screen You might want to wait before purchasing if you re new to smartwatches Fossil historically introduces new Wear OS models in late summer with the exception being this year s mildly upgraded Gen Wellness Edition in January While there s no word on when Gen will arrive or what it might entail it s likely to be a significant upgrade if and when it appears ーwe wouldn t buy Gen just because Assistant is ready The update is more for existing owners who lost functionality last year This article originally appeared on Engadget at |
2023-06-23 19:45:19 |
海外TECH |
Engadget |
A Reddit transcription community will shut down over a 'lack of trust' in the platform |
https://www.engadget.com/a-reddit-transcription-community-will-shut-down-over-a-lack-of-trust-in-the-platform-191008889.html?src=rss
|
A Reddit transcription community will shut down over a x lack of trust x in the platformA group of Reddit volunteers who transcribe media from other subreddits are shutting down their community in part due to changes the company is making to its API The community r TranscribersOfReddit will close its doors on June th which is one day before Reddit starts charging for API access The group transcribes media from around subreddits Its aim was to provide some temporary solutions for accessibility features that are missing from Reddit such as alt text while imploring the company to address such quot inadequacies quot according to Rebekah Ginsburg a Transcribers Of Reddit moderator As The Verge reports Ginsburg aka u halailah is also the chair of the Grafeas Group a nonprofit that provides the technology powering much of the community s transcription work quot In light of recent events we now recognize that Reddit corporate has demonstrated a severe lack of willingness to fix core issues with the platform quot Ginsburg wrote quot It is clear that these problems are coming from the top and we do not believe they can be fixed Unfortunately while this was an extraordinarily difficult decision for us these circumstances mean that we can no longer operate this project quot Ginsburg added that quot the API changes and the realistic limits on how much work we can take on and our lack of trust in Reddit as a platform and the clear disregard for accessibility from Reddit corporate quot made it quot impossible quot for the team to continue the project While Reddit has said it will exempt some third party accessibility apps from having to pay for API access members of the community say apps such as RedReader Dystopia and Luna don t have quot sufficient moderation functions quot for blind and visually impaired moderators Reddit declined to comment to The Verge on these issues A spokesperson previously said the company was quot exploring a number of things quot related to accessibility across its platform In the meantime it seems that it ll soon be more difficult for some people to use Reddit Some communities I m a member of have volunteers that will add alt text for an image in the comments or transcribe a short video Still the loss of a larger coordinated effort to make Reddit more accessible is a blow Reddit said last month that it would start charging for access to its API which third party developers have used to build apps such as ones for moderation and accessibility that hook into the platform The move caused an uproar in the community and several third party apps including ones that tens of thousands of people use to access Reddit are shutting down as a result of the changes However Reddit is pressingahead with the new policy CEO Steve Huffman also said he was planning changes that would allow members of a subreddit to more easily vote out a moderator who makes unpopular decisions Some moderators have taken similar comments from a Reddit administrator as a direct threat after thousands of subreddits went private to protest the API changes Reddit also reportedly removed moderators from subreddits that were suddenly labeled as not safe for work Not only did those communities allow porn for the first time in protest against the API changes making them NSFW meant Reddit was unable to monetize them due to its ad policies This article originally appeared on Engadget at |
2023-06-23 19:10:08 |
ニュース |
BBC News - Home |
Ernest Moret: Arrested French publisher faces no further action |
https://www.bbc.co.uk/news/uk-england-london-66005430?at_medium=RSS&at_campaign=KARANGA
|
april |
2023-06-23 19:55:13 |
ニュース |
BBC News - Home |
Queen's 2023 results: Cameron Norrie loses to Sebastian Korda in quarter-finals |
https://www.bbc.co.uk/sport/tennis/66000661?at_medium=RSS&at_campaign=KARANGA
|
Queen x s results Cameron Norrie loses to Sebastian Korda in quarter finalsBritish number one Cameron Norrie s run at Queen s ends with a disappointing quarter final defeat by American Sebastian Korda |
2023-06-23 19:46:39 |
ニュース |
BBC News - Home |
Titanic sub search: What happens next |
https://www.bbc.co.uk/news/world-us-canada-65981742?at_medium=RSS&at_campaign=KARANGA
|
search |
2023-06-23 19:17:54 |
ビジネス |
ダイヤモンド・オンライン - 新着記事 |
キーエンス流!企画の成功確率を上げる2つの秘訣、営業の意見を鵜呑みにすると失敗する【動画】 - キーエンス流 営業・企画・戦略の強化書 |
https://diamond.jp/articles/-/324483
|
キーエンス流企画の成功確率を上げるつの秘訣、営業の意見を鵜呑みにすると失敗する【動画】キーエンス流営業・企画・戦略の強化書営業の意見を鵜呑みにする商品企画が、失敗する根本的理由とは特集『キーエンス流営業・企画・戦略の強化書』は、元商品企画担当者が「究極の顧客理解」を実現する方法を解説します。 |
2023-06-24 04:50:00 |
ビジネス |
ダイヤモンド・オンライン - 新着記事 |
6月のうちに伝えたい「住民税の落とし穴」、思わぬ手取りダウンや控除で損も【見逃し配信・税】 - 見逃し配信 |
https://diamond.jp/articles/-/325055
|
落とし穴 |
2023-06-24 04:45:00 |
ビジネス |
ダイヤモンド・オンライン - 新着記事 |
英語ベタな日本人の救世主?話題の英語学習アプリ「Speak」を使ってみた - 井の中の宴 武藤弘樹 |
https://diamond.jp/articles/-/325054
|
speak |
2023-06-24 04:40:00 |
ビジネス |
ダイヤモンド・オンライン - 新着記事 |
「骨太の方針」議論はわずか25分、日本衰退を招く問題だらけの“中身” - DOL特別レポート |
https://diamond.jp/articles/-/325053
|
|
2023-06-24 04:35:00 |
ビジネス |
ダイヤモンド・オンライン - 新着記事 |
人気女優似の女子大生と「運命の出会い」300万円を貸した52歳男性の“激レアな結末” - オオカミ少年片岡の「あなたの隣に詐欺師がいます。」 |
https://diamond.jp/articles/-/325006
|
」筆者は、吉本でお笑いコンビ「オオカミ少年」で活動する傍ら、探偵事務所の代表を務めています。 |
2023-06-24 04:30:00 |
ビジネス |
ダイヤモンド・オンライン - 新着記事 |
なぜ悲惨なバーベキュー事故は繰り返されるのか~顔を大やけどした当事者が語る「燃えている時」の恐怖 - from AERAdot. |
https://diamond.jp/articles/-/325021
|
なぜ悲惨なバーベキュー事故は繰り返されるのか顔を大やけどした当事者が語る「燃えている時」の恐怖fromAERAdot月日、福岡県柳川市でバーベキューをしていた専門学校生の男子学生人に火が燃え移り、そのうち、歳の男子学生が死亡するという痛ましい事故が起きた。 |
2023-06-24 04:25:00 |
ビジネス |
ダイヤモンド・オンライン - 新着記事 |
【自宅で簡単おつまみ】日本酒がすすむ「大豆の五目煮」の栄養価たっぷりレシピ - 男のオフビジネス |
https://diamond.jp/articles/-/324946
|
家庭料理 |
2023-06-24 04:20:00 |
ビジネス |
ダイヤモンド・オンライン - 新着記事 |
男性3000万人がEDに悩む米国「塗るタイプ」の治療薬が処方箋ナシで買えるように - ヘルスデーニュース |
https://diamond.jp/articles/-/325083
|
eroxon |
2023-06-24 04:15:00 |
ビジネス |
東洋経済オンライン |
宇都宮LRT、8月開業時ダイヤが「控えめ」な事情 運行開始までに「延期」を重ねた紆余曲折も | ローカル線・公共交通 | 東洋経済オンライン |
https://toyokeizai.net/articles/-/681685?utm_source=rss&utm_medium=http&utm_campaign=link_back
|
宇都宮駅 |
2023-06-24 04:30:00 |
コメント
コメントを投稿