投稿時間:2023-01-09 01:07:26 RSSフィード2023-01-09 01:00 分まとめ(9件)

カテゴリー等 サイト名等 記事タイトル・トレンドワード等 リンクURL 頻出ワード・要約等/検索ボリューム 登録日
IT 気になる、記になる… 「iOS 17」や「macOS 14」は変化の少ないアップデートに?? − AR/VRヘッドセットの開発に注力の為 https://taisy0.com/2023/01/09/166837.html apple 2023-01-08 15:55:58
IT 気になる、記になる… AppleのAR/VRヘッドセットは春のイベントで発表か − 発売は秋以降に https://taisy0.com/2023/01/09/166834.html apple 2023-01-08 15:45:24
IT 気になる、記になる… Appleシリコン搭載の新型「Mac Pro」のデザインは現行から変わらない?? − RAMの増設は不可との情報も https://taisy0.com/2023/01/09/166830.html apple 2023-01-08 15:37:07
海外TECH DEV Community The useDeferredValue hook - React 17.0 beta features https://dev.to/alfredosalzillo/the-usedeferredvalue-hook-react-170-beta-features-5bpo The useDeferredValue hook React beta features Introduction to the useDeferredValue HookReact s useDeferredValue hook is a new feature that was introduced in React as a beta release It allows a developer to specify a value that should be used with a delay allowing for the possibility of rendering an intermediate state while waiting for the deferred value to resolve This can be useful in situations where you want to optimize the perceived performance of a component by rendering content as quickly as possible even if it is not the most up to date When to Use useDeferredValueOne common use case for useDeferredValue is when you have a slow loading prop that is passed to a component but you don t want to block rendering of the rest of the component while waiting for the prop to resolve Instead you can use a placeholder value or an intermediate state while waiting for the prop to resolve Another use case is when you have a value that is updated frequently but the updates are not critical to the user experience In this case you can use useDeferredValue to only update the value after a certain delay allowing for a smoother experience for the user How to Use useDeferredValueUsing useDeferredValue is similar to using other React hooks First you need to import the hook from the react package import useDeferredValue from react Next you can call the hook within a functional component and pass it two arguments the value you want to defer and the delay time in milliseconds The hook will return the deferred value which you can then use in the component like any other value const MyComponent slowLoadingProp gt const deferredProp useDeferredValue slowLoadingProp return lt div gt deferredProp lt div gt In the example above the component will render with the placeholder value of slowLoadingProp for at least milliseconds before updating with the actual value It s important to note that useDeferredValue only delays the rendering of the value not the resolution of the value itself This means that if the value takes longer than the specified delay to resolve it will still be displayed as soon as it is available ConclusionThe useDeferredValue hook is a useful tool for optimizing the perceived performance of a React component by allowing for the rendering of intermediate states or placeholder values while waiting for slow loading or frequently updated values to resolve It is easy to use and can greatly improve the user experience of your application 2023-01-08 15:35:51
海外TECH DEV Community Flyway Migrations Naming Strategy in a Big Project https://dev.to/kirekov/flyway-migrations-naming-strategy-in-a-big-project-51fp Flyway Migrations Naming Strategy in a Big ProjectFlyway is the great tool for managing database migrations Years ago Martin Fowler described Evolutionary Database Design and the idea still rocks However Flyway has a slight caveat when you work on the same project in a big team of developers In this article I m describing to you the potential problem about out of ordered migrations what s the way to fix it and how you can validate the migration name pattern during the project build You can find the whole project setup in this repository Out of Order Merging ProblemSuppose we have migration V create user sql Look at the DDL below CREATE TABLE users id BIGSERIAL PRIMARY KEY username VARCHAR NOT NULL age INTEGER NOT NULL Also there are two developers working in different Git branches Bob and Kate Bob s task requires him to add user group table He creates the V create user group sql migration Whilst Kate wants to create the role table and defines the new migration name as V create role sql Those tasks neither overlap nor block each other Developers can complete them successfully without waiting for other to create a pull request Anyway there could be a problem Assuming that each merge to the main branch results in deploying the new version to the UAT stand Kate has completed the task earlier than Bob So the new migrations order is V create user sqlV create role sqlWhat happens when Bob merges his pull request The new migration should come between existing ones Unfortunately it ll result in an error during migration execution Validate failed Migrations have failed validationDetected resolved migration not applied to database By default Flyway doesn t allow to add new migrations in between of present ones So we have two problems here to solve Flyway should execute new migrations successfully even if they go in between of the present ones We don t want to make one developer to wait until other completes their job Migrations require a unique id in this case etc So each developer should be able to assign a unique migration id Besides there should be no additional collaborations because it slows down the development and demands a single source of truth containing all existing and acquired migrations ids Therefore the id has to be decentralized Migrations Naming StrategyAs you may guess a regular incrementing number as an id is not sufficient Instead I recommend you to apply this pattern V CURRENT DATE TASK ID DESCRIPTION sqlMigration naming pattern is composite and contains of several blocks CURRENT DATE is the date when the developer added the migration with the pattern YYYY MM DD TASK ID is the unique task id that demands to create new migration It could be Jira task Trello YouTrack and so on DESCRIPTION is the description that clarifies the migration purpose For example this is how creating the new users table can look like with the new migration naming rules V create users table sqlMeaning that one added the migration on th January and the corresponding task has id So now each migration has a unique id because every developer works on a separate task in the particular branch Enabling Out of Order ExecutionAnyway the new naming pattern does not solve the problem of out of order pull requests merging Thankfully all you have to do is to enable flyway outOfOrder parameter Let s replay the case with Bob and Kate described earlier Kate has merged the pull request and the order of migrations is V create users table sqlV create role sqlWhen Bob merges his pull request the order changes to V create users table sqlV create users group table sqlV create role sqlIf you enable the flyway outOfOrder parameter the execution will complete with no errors and Flyway will create all the tables successfully As a matter of fact the developers now can merge the pull requests in any order without bothering about migration order issues However it works only if everyone follows the stated rules about naming You could check it during the code review but it s not efficient There is a possibility of missing a typo We need an approach that ll check the correctness of the naming pattern automatically Validation AutomatizationI m showing you the way of automatization with Gradle but the idea remains the same for any other build tool Look at the Gradle task performing migration names validation def migrationExclusions migration names exclusions task validateFlywayMigrations def migrationPattern V d d d d a z sql def datePattern Pattern compile d d d doLast for def file in fileTree src main resources db migration final String migrationName file getName if file isFile migrationExclusions contains migrationName continue if migrationName matches migrationPattern throw new GradleException Migration migrationName does not match pattern migrationPattern def matcher datePattern matcher migrationName if matcher find def date matcher group try LocalDate parse date DateTimeFormatter ofPattern yyyy MM dd catch DateTimeParseException e throw new GradleException Migration migrationName has invalid date value Couldn t be parsed with pattern yyyy MM dd e else throw new GradleException Migration migrationName has no date by pattern datePattern compileJava dependsOn validateFlywayMigrationsThe idea is trivial We read all files from src main resources db migration directory and check that the name satisfies the RegExp pattern of V d d d d a z sql If it does when we validate that the d d d pattern contains the proper date but not just random string like If any check does not pass the exception occurs and we get non zero result code that leads to shell command fail Due to dependsOn clause the validateFlywayMigrations runs automatically right before the code compilation The migrationExclusions field is helpful when you applying new naming rules to the existing project You cannot change names of existing migrations So you ignore them during the validation process ConclusionAs a result developers don t need to worry neither about uniqueness of Flyway migration names nor about the order of pull requests merging It ll make the programming much more pleasant and less stressed Tell your story in the comments Have you had similar problems in your project If you have then how have you solved the issues That s all I wanted to tell about Flyway migration naming Thanks for reading ResourcesFlywayEvolutionary Database DesignThe repository with code examplesUAT standSingle Source of Truth Decentralized IdentifierThe flyway outOfOrder parameterGradleRegExp 2023-01-08 15:13:07
Apple AppleInsider - Frontpage News Apple's muted 2023 hardware launches to include Mac Pro with fixed memory https://appleinsider.com/articles/23/01/08/apples-muted-2023-hardware-launches-to-include-mac-pro-with-fixed-memory?utm_medium=rss Apple x s muted hardware launches to include Mac Pro with fixed memoryApple s lineup of updates will be muted and headlined by a New Mac Pro one that will look just like the model but with a lack of user upgradable memory The New Mac Pro could look like the old one The product catalog will include a number of typical updates to various lines as usual as well as the possible mixed reality headset However one highly anticipated update may be less of a change than users could expect Read more 2023-01-08 15:30:57
ニュース BBC News - Home Ukraine denies Moscow claim it killed 600 soldiers https://www.bbc.co.uk/news/world-europe-64204048?at_medium=RSS&at_campaign=KARANGA kramatorsk 2023-01-08 15:34:27
ニュース BBC News - Home Ellia Smeding: British long track speed skater wins European 1,000m bronze https://www.bbc.co.uk/sport/winter-sports/64204191?at_medium=RSS&at_campaign=KARANGA Ellia Smeding British long track speed skater wins European m bronzeEllia Smeding becomes the first British woman to win a long track speed skating medal after claiming bronze at the European Sprint Championships in Norway 2023-01-08 15:46:49
北海道 北海道新聞 函館の消えゆく銭湯どう守る 公設民営で対応の室蘭を歩く 無料で送迎、利便性を確保 https://www.hokkaido-np.co.jp/article/784877/ 公設民営 2023-01-09 00:12:07

コメント

このブログの人気の投稿

投稿時間: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件)