ホワイトハット(78,876件)

「いちばん大切なことは、目には見えない」重要なことを見極めるため知識体系情報サイト

Edit by @nicolo-ribaudo When migrating @babel/core we shouldn't forget about                babel/packages/babel-helper-hoist-variables/package.json                   Lines 16 to 18       in       bfd3f80                                                     "TODO": "The @babel/traverse dependency is only needed for the NodePath TS type. After converting @babel/core to TS we can import NodePath from there.",                                           "dependencies": {                                             "@babel/traverse": "workspace:^7.12.17",                      Still work in progress, but most of the migration already done:  updated lint/build configuration migrated everything to typescript using flowts(see commits with messages starting with flowts:) configured typescript project references so it is nice and fast did some manual fixes:  updated generated code to be in TypeScript did manual fixes where types happened to be incorrect backported some types/comments from DefinitelyTyped    Currently, the whole project passes the type check, also existing tests should be working. Commits are grouped by package and sorted in topological order (before fixing some package - all of its dependencies should be already fixed) I tried to avoid unnecessary changes, and so - for example, did not use strict mode anywhere(I think it would be good to add in some places, but - later). Remaining things, I am planing before marking this as ready for review:  to merge some dependency updates and related improvements (separate PRs) to review the changes I did and to update the comments (some comments might be no longer relevant, and some fixes might be not needed anymore)   Some background: I working on a tool automating the Flow to TypeScript migration, which is already in a quite working state. It is built using Babel, and partially because of that - I want to improve TypeScript typings for Babel. I think, the best way to so is to convert the whole project to TypeScript, which I believe also has other benefits:  all the benefits of TypeScript in comparison to Flow (much bigger community, better IDE support, etc…) finding and fixing bugs… improving type coverage - currently, it is very sparsely typed, and I believe a bit more types would be helpful  Related meeting notes: https://github.com/babel/notes/blob/master/2020/05-07.md#investigate-using-typescript-in-our-code  Migration summary: The most complicated/problematic was babel/parser - there are a lot of issues in flow types that were highlighted after the migration(basically, as often happens with flow… - some issues were ignored) in particular, there are a lot of issues in node type definitions:  some of the types there were impossible(types intersections that should result in empty property types, where it clearly should not be) some node types were missing also, it is out of sync with babel/types (which I think it should use instead of redeclaring all the node types)  weird changes There is a tricky problem about importing ../package.json in TypeScript. Generally TypeScript can support importing json files, but it also wants all imported files to be included as sources. So if to include only src - ../package.json would be allowed. If to include package.json into sources - when building, structure of all the sources (not only src as needed) would be replicated. To solve this, I did a bit weird trick: Where needed - I added src/package.js, with following content: import { version } from "../package.json"; export { version };                               Which is not type-checked, and can be imported instead of package.json. Suggestions for better options are welcome. common fixes:   remove unnecessary typecasts(most common as Array<any>)   add missing optional argument annotations (most often boolean arguments which are optional, are not marked as such)   add as const in some places to get more specific types (typically for "enum-like" constants)  Object.freeze({}) -> Object.freeze({} as const) {…} -> {…} as const    remove some anys(btw, in flow Function and Object - are aliases to any), in many cases typescript can infer better type   remove some typecasts to unknown (mixed in flow) or replace it with any where appropriate   where needed replace $FlowIgnore with @ts-ignore   fixing usages of not existing types (some types used in flow code not were imported, or imported from somewhere they do not exist)   replace void with undefinded in some places (in ts void mean no value and should be used only as return type)   fixing optional argument annotations (in typescript undefned type, does not mean that argument is optional, and so it would require argument which however might be undefined)   change type annotation for some functions to be type guards, for example: - function isThenable(val: unknown): boolean { + function isThenable<T extends PromiseLike<any>>(val: unknown): val is T {                                 in some cases - added type refinement, before the condition, for example: if (t.isStringLiteral(node) && node.value === "use strict") instead of just node.value === "use strict" (which technically will work, but would make TS not happy)   add missing type parameter(most common Array to Array<any>, but also the same for Set, Map and WeekMap types)   fix incorrect DOM type usages:  replace Location with t.SourceLocation replace Node with t.Node    add missing fields in some types(for example recordAndTupleSyntaxType, jsescOption and jsonCompatibleStrings in Format in babel-generator)   declared instance fields in class declarations (often they were assigned somewhere in class methods or constructor, but not declared)   replace some assertions like path.type === "JSXFragment" with appropriate utility calls path.isJSXFragment()   remove unused call arguments or properties on options object where in some places, where function does not have that argument or does not use the property   @ts-expect-error when doing something not type-safe, like assigning .type on AST node   @ts-expect-error when getting tagExpr.value from Literal (because it is not present on NullLiteral)   import and use types from babel-types and babel-travese in some plugins, helpers (not everywhere, I would suggest this can be one of the next steps)   replace template -> template.statement where appropriate to have simpler type-casts   use !!value in some places where value should be converted to boolean   additional type annotations in some places(tried to minimize this, also to consider as one of the next steps after landing this)   typecasts like path.get("tag.object") as NodePath where correct type cannot be inferred   type declaration for visitor state in some helpers/plugins (as possible next step - to do more of this)   use Visitor type from babel-traverse for visitor declaration in plugins (allows improving type coverage for individual visitors without manually typing each property in declaration)   in some places, t.Node validators were used on NodePath(which evetually worked, but is not correct in general), example fix: t.isImportDeclaration(stmt) -> stmt.isImportDeclaration()   notable changes:  updated build config to support TypeScript instead of Flow  use babel preset typescript instead of flow plugin config updates to allow using .ts files update code generating scripts to generate typescript code   babel-types  add more generated types to src (adopting existing logic from scripts/typescript) update generateBuilders to specify exact argument types improve deprecated types generation backport types from generate index.d.ts to be included in sources avoid export of builders starting with upper case in ts sources (generate separate js file for deprecated exports, to avoid exporting types for them)   babel-parser   use abstact class (instead of hack with flow type comments)   refactor parser plugins to be typed   specify exact argument list in methods overridden in parser plugins, and in calls to original implementation - to have exactly the same method signature(which is now type-checked). for example: - return super.parseMaybeAssign(...args); + return super.parseMaybeAssign( +  noIn, +  refExpressionErrors, +  afterLeftParse, +  refNeedsArrowPos, + );                                 refactoring in node type definitions  use interfaces instead of type aliases for node type definitions extend node types (instead of & in flow types, which often looked not correct)    babel-parser move included type definitions to source code   add/fix some node types    babel-generator  babel-generator type this for generators assigned to Printer.prototype   babel-traverse  this type annotation for mixins in NodePath, export types for fields added by mixins validators, asserts and virtual types code generation scripts   babel-core  remove not existing type imports, like replacing type SourceMap = typeof import("convert-source-map").SourceMap; with any in packages/babel-core/src/transformation/file/generate.ts add types for some dependencies   babel-helper-plugin-utils  generic type for declare utility     Going to periodically rebase this on current master, while finishing work on. However, there is not likely to be a big change here, so comments and suggestions are welcome.      Q                       A      Fixed Issues?    Patch: Bug Fix?    Major: Breaking Change?    Minor: New Feature?    Tests Added + Pass? Yes (almost, to be updated)   Documentation PR Link    Any Dependency Changes?    License MIT

Migrate Babel from Flow to TypeScript by zxbodya · Pull Request #11578 · babel/babel · GitHub

Webページ

github.com

2021-05-22 20:08:27

詳細ページ

minne CREを紹介します - ペパボテックブログ

Webページ

tech.pepabo.com

2021-05-22 20:01:08

詳細ページ

スパコンによる大規模分子動力学計算の現状

Webページ

zenn.dev

2021-05-22 20:00:41

詳細ページ

コロナ禍で家中での通信環境に注目が集まる中、ドコモは5Gを使った新たなサービス「home 5G」を提供する。固定回線の代替としてモバイル回線を使う仕組みで、ホームルーターの「home 5G HR01」も用意。このhome 5Gを他社のサービスと比較しつつ、ドコモの狙いを読み解いていきたい。 (1/3)

ドコモが固定代替サービス「home 5G」を始める狙い 他社サービスとの違いは?:石野純也のMobile Eye(1/3 ページ) - ITmedia Mobile

Webページ

www.itmedia.co.jp

2021-05-22 20:00:40

詳細ページ

自民党は21日、半導体産業の強化を目指す議員連盟を設立した。最高顧問に就任した安倍晋三前首相は、半導体産業支援について「異次元のものをやらなければならない」との考えを示した。

安倍前首相、「異次元」の半導体産業支援が必要-自民が議連設立 - Bloomberg

Webページ

www.bloomberg.co.jp

2021-05-22 20:00:35

詳細ページ

[2020/05/15] nlpaper.challenge BERT応用勉強会 テキスト生成の評価 × BERT - Speaker Deck

Webページ

speakerdeck.com

2021-05-22 20:00:34

詳細ページ

「Sublime Text 4」初の安定版がリリース ~プログラマー向け高機能テキストエディター - 窓の杜

Webページ

forest.watch.impress.co.jp

2021-05-22 17:00:58

詳細ページ

Contribute to stackblitz/webcontainer-core development by creating an account on GitHub.

GitHub - stackblitz/webcontainer-core

Webページ

github.com

2021-05-22 17:00:53

詳細ページ

GitHub is where people build software. More than 65 million people use GitHub to discover, fork, and contribute to over 200 million projects.

React’s greatest power may lie in its open source ecosystem · The ReadME Project · GitHub

Webページ

github.com

2021-05-22 17:00:33

詳細ページ

Mathematical Tools for Data Science – NYU Center for Data Science

Webページ

cds.nyu.edu

2021-05-22 17:00:32

詳細ページ

 ニッポン放送のアナウンサー・吉田尚記が先月、新番組『ミューコミVR』をスタートし、話題を呼んでいる。同番組では、吉田と声と記憶と考え方が全く同じ部下のVRアナウンサー・一翔剣(いっしょう・けん)が

ニッポン放送・吉田尚記が語る、ラジオ再評価の背景にある“多様性”「大事なのは否定すること」

Webページ

news.yahoo.co.jp

2021-05-22 14:08:45

詳細ページ

1990年代に米連邦捜査局(FBI)の捜査をかいくぐって企業の機密情報などを盗み、「伝説のハッカー」と呼ばれたケビン・ミトニック氏が日本経済新聞のオンライン取材に応じた。心理的な隙やミスにつけ込み情報を漏らすよう仕向ける「ソーシャルエンジニアリング」の巧者で知られ、現在はセキュリティー会社で対策を指導する同氏は「サイバー攻撃者の心理操作は巧妙化している」と話す。例えばエモテットの偽メールには

「最大の弱点は人間」 伝説のハッカーが警鐘: 日本経済新聞

Webページ

www.nikkei.com

2021-05-22 14:08:43

詳細ページ

E32-SolarCharger の PWM制御 ーベランダ太陽光発電所への道4ー - 電子工作 - HomeMadeGarbage

Webページ

homemadegarbage.com

2021-05-22 14:08:25

詳細ページ

Raspberry Pi3とArduinoのLoRa通信 – Ambient

Webページ

ambidata.io

2021-05-22 14:08:23

詳細ページ

※この投稿は米国時間 2021 年 5 月 4 日に、Google Cloud blog に投稿されたものの抄訳です。数十年にわたり、アプリケーションの開発チームや運用チームは、システムやアプリからテレメトリー データを生成、収集、分析する最適な方法を模索してきました。2010 年、Google は Dapp

OpenTelemetry Trace 1.0 が利用可能に | Google Cloud Blog

Webページ

cloud.google.com

2021-05-22 14:08:05

詳細ページ