python |
Pythonタグが付けられた新着投稿 - Qiita |
Djangoで本番(DEBUG=False)でCSSとFaviconが読み込めなかった件 |
https://qiita.com/hideoyaji/items/61a7794980ba3b366316
|
withdebugturnedoninproduc |
2023-02-07 22:25:39 |
AWS |
AWSタグが付けられた新着投稿 - Qiita |
AWS ソリューションアーキテクト(SAA-C03)の振り返り |
https://qiita.com/ying/items/c2c770b720c73145329a
|
資格 |
2023-02-07 22:27:50 |
AWS |
AWSタグが付けられた新着投稿 - Qiita |
ネットワーク解析ツールのBatfishを導入する |
https://qiita.com/Trick_Trick/items/b57ddb2f9394bfed94e0
|
batfish |
2023-02-07 22:11:39 |
Docker |
dockerタグが付けられた新着投稿 - Qiita |
WSL2のUbuntu 22.04でDockerが起動しない問題対応 |
https://qiita.com/motoJinC25/items/c6fbb10f00230f6a5a97
|
ubuntu |
2023-02-07 22:30:45 |
Docker |
dockerタグが付けられた新着投稿 - Qiita |
ネットワーク解析ツールのBatfishを導入する |
https://qiita.com/Trick_Trick/items/b57ddb2f9394bfed94e0
|
batfish |
2023-02-07 22:11:39 |
Ruby |
Railsタグが付けられた新着投稿 - Qiita |
【Rails】モデルのカラムで選択肢を指定したいときはEnumerizeを使おう |
https://qiita.com/ysk91_engineer/items/bf718c055267be49a18d
|
enumerize |
2023-02-07 22:00:56 |
技術ブログ |
Developers.IO |
クラスメソッド データアナリティクス通信(AWSデータ分析編) – 2023年2月号 |
https://dev.classmethod.jp/articles/cm-da-news-analytics-202302/
|
reinvent |
2023-02-07 13:48:11 |
海外TECH |
MakeUseOf |
How to Add Static Date and Time in Google Sheets |
https://www.makeuseof.com/add-static-date-time-google-sheets/
|
sheets |
2023-02-07 13:30:15 |
海外TECH |
MakeUseOf |
LockBit Ransomware Gang Claims Royal Mail Attack |
https://www.makeuseof.com/lockbit-ransomware-gang-claims-royal-mail-attack/
|
cyberattack |
2023-02-07 13:22:21 |
海外TECH |
DEV Community |
Moving From Electron to Tauri |
https://dev.to/pgenfer/moving-from-electron-to-tauri-3791
|
Moving From Electron to TauriPart Interprocess Communication ーporting a Typescript based message system of an Electron App to Tauri and Rust TL DR Tauri is a Rust based Electron alternative However porting an existing Electron application to Tauri requires some work This post explains how UMLBoard s message system used for inter process communication could be ported to Rust without much effort Many people would agree that native apps if done right provide better user experience and performance compared to hybrid or cross platform solutions However having separate apps also means maintaining different code bases each written in its own language Keeping them all in sync is quite a lot of work for a single developer usually more than what we ve planned for our side projects The Electron framework is a compromise It provides a convenient way to write platform independent applications using a web based technology stack most people are familiar with Also the framework is very mature and actively supported by a large community But nevertheless it s only a compromise Its platform independence comes with the cost of larger binaries and higher memory consumption compared to native apps Take for instance UMLBoard s macOS binaries The universal platform package ends up with a total size of MB that s a massive number for a lightweight drawing tool Still alternatives with the same level of maturity as Electron are relatively rare Tauri however is one of these alternatives that looks very promising A First look at TauriWhile Electron and Tauri share some similarities like using separate processes for their core and rendering logic they follow divergent philosophies regarding bundle size Instead of deplyoing your application with a complete browser frontend Tauri relies on the built in Webviews the underlying operating systems provide resulting in much smaller applications Despite that Tauri uses Rust as the language of choice for its Core process resulting in better performance compared to Electron s node js backend While porting UMLBoard from Electron to Rust won t happen overnight exploring how some of its core concepts could be translated from TypeScript to Rust would still be interesting The following list contains some crucial features of UMLBoard Some of them are real show stoppers in case they don t work A possible port would have to deal with these issues first x Porting the inter process communication to Tauri this post here Accessing a document based local data store with Rust Validate the SVG compatibility of different Webview Check if Rust has a library for automatic graph layoutingThe remaining post is dedicated to the first bullet point We will investigate how UMLBoard s existing inter process communication could be ported to Tauri The other topics may be the subjects of further articles Ok but enough said let s start Sending Messages between Electron ProcessesUMLBoard s current implementation uses a React front end with Redux state management Every user interaction dispatches an action that a reducer translates into a change resulting in a new front end state If for instance a user starts editing a classifier s name a renamingClassifier action gets dispatched The classifier reducer reacts to this action and updates the classifier s name triggering a rerender of the component So far this is all standard Redux behavior A user input dispatches a redux action that leads to a state update in the front end But UMLBoard even goes one step further and uses the same technique for sending notifications to Electron s main process Taking our previous example when the user hits the ENTER key a renameClassifier action is dispatched indicating that the user finished editing This time however the action gets processed by a custom middleware instead of a reducer The middleware opens an IPC channel and sends the action directly to the main process There a previously registered handler reacts to the incoming action and processes it It updates the domain model accordingly and persists the new state to the local datastore If all that goes well a response action is sent back on the same channel The middleware receives the response and dispatches it like a regular action This keeps the front end state in sync again with the domain state See the following diagram for an overview of this process Inter Process Communication between renderer and main process in UMLBoard It might look a bit odd to extend Redux to the main process but from the view of a lazy developer like me it has some benefits Since both mechanisms Redux and IPC rely on plain serializable JSON objects everything that goes through a Redux dispatcher can also go through an IPC channel This is very convenient as it means we can reuse our actions and their payloads without writing additional data conversions or DTO objects We also don t have to write any custom dispatching logic We only need a simple middleware to connect the Redux front end with the IPC channel This action based messaging system is the backbone of UMLBoard s process communication so let s see how we can achieve this in Tauri Porting to TauriFor our proof of concept we will create a small demo application in Tauri The app will use a React Redux front end with a single text field Pressing a button will send the changes to the backend Tauri s Core process The example app we re going to implement We are only interested in inter process communication so we will skip all state tracking in the core process this will be part of a future blog entry That s why our Cancel method behaves a bit weird as it will always restore the original class name But for proving our concept this should be sufficient We basically have to implement four tasks Declare Rust equivalents of our Redux actionsSending actions from Webview to Core processHandling incoming actions in the Core processSending response actions back to WebviewLet s go through the implementation step by step Declare Rust equivalents of Redux actionsRedux actions are plain JSON objects with a string identifying their type and a field holding their payload Rust has a similar concept we could use to mimic this behavior the Enum type Enums in Rust are more powerful than in other languages because they allow storing additional data for each variant In that way we could define our Redux actions as a single Enum where each variant represents an individual type of action derive Serialize Deserialize Display serde rename all serialize camelCase deserialize camelCase serde tag type content payload enum ClassiferAction received from webview when user changed name RenameClassifier EditNameDto user canceled name change operation CancelClassifierRename response action after successful change ClassifierRenamed EditNameDto response action for cancel operation ClassifierRenameCanceled EditNameDto error response ClassifierRenameError To convert our Redux action into a Rust Enum and vice versa we can use Rust s serde macro We specify that the variant s name should be serialized into a type field and its data into a field called payload This corresponds precisely to the scheme we use to define our Redux actions But we can even go one step further by using the ts rs crate This library can generate the TypeScript interfaces for the action payloads straight from our Rust code We don t have to write a single line of TypeScript code for this That s really neat Decorating our Rust struct with the relevant macros derive TS ts export rename all camelCase struct EditNameDto new name String gives us the following auto generated TypeScript interface for our action payloads This file was generated by ts rs Do not edit this file manually export interface EditNameDto newName string Ok we have the correct data types on both edges of our communication channel let s now see how we can send data between them Sending actions from Webview to Core processInterprocess communication in Tauri is done through commands These commands are implemented as Rust functions and can be called within the Webviews using the invoke API One problem we face is that the Redux Toolkit generates the type for identifying an action by concatenating the name of the slice where the action is defined with the action s name In our case the resulting type would therefore be classifier renameClassifier instead of just renameClassifier This first part classifier is also called the domain to which this action belongs Unfortunately this naming convention does not work for Rust as it would result in invalid names for our Enum options We can avoid this by separating the domain from the action type and wrapping everything up in an additional object the IpcMessage before submitting See the following diagram for the complete invocation process Invoking a Tauri command from the Webview process Handling incoming actions in the Core processOn the backend side we must also define a Rust struct for our IpcMessage Since we don t know the concrete type of the payload yet we keep it stored as a JSON value and parse it later when needed data structure to store incoming messages derive Deserialize Serialize struct IpcMessage domain String action Value We can now define the signature of the method for our Tauri command Our function ipc message will receive an IpcMessage processes it somehow and at the end returns another IpcMessage as a response tauri command fn ipc message message IpcMessage gt IpcMessage TODO implement Ok but what would the actual implementation look like The function should take the domain from the message see if a handler is registered for this domain and if yes call the corresponding handler with the action stored inside our IpcMessage Since we will have many different domains and handlers later it makes sense to minimize the implementation effort by extracting common behavior into a separate ActionHandler trait trait that must be implemented by every domain servicepub trait ActionHandler specifies the domain actions this trait can handle type TAction DeserializeOwned Serialize std fmt Display the domain for which this handler is responsible fn domain amp self gt amp str must be implemented by derived structs fn handle action amp self action Self TAction gt Result lt Self TAction serde json Error gt boiler plate code for converting actions to and from json fn receive action amp self json action Value gt Result lt Value serde json Error gt convert json to action let incoming Self TAction serde json from value json action call action specific handler let response self handle action incoming convert response to json let response json serde json to value response Ok response json The trait uses the TemplateMethod design pattern The receive action specifies the general workflow for converting the action The handle action method contains the actual logic for processing a specific action In our case a ClassifierService could be responsible for processing all actions of the domain classifier ClassifierService handles all classifier specific actionsstruct ClassifierService impl ClassifierService pub fn update classifier name amp self new name amp str gt TODO implement domain logic here impl ActionHandler for ClassifierService type TActionType ClassifierAction fn domain amp self gt amp str CLASSIFIER DOMAIN fn handle action amp self action Self TActionType gt Result lt Self TActionType serde json Error gt here happens the domain logic let response match action ClassifierAction RenameClassifier data gt update data store self update classifier name amp data new name ClassifierAction ClassifierRenamed data ClassifierAction CancelClassifierRename gt user has canceled return previous name here we just return an example text ClassifierAction ClassifierRenameCanceled EditNameDto new name Old Classname to string if front end sends different actions something went wrong gt ClassifierAction ClassifierRenameError Ok response Sending response actions back to WebviewWe re almost done We have the signature of our Tauri command and the code we need to handle an action and generate a response If we glue everything together our final ipc message function may look like the following snippet tauri command fn ipc message message IpcMessage gt IpcMessage This code is just for demonstration purposes In a real scenario this would be done during application startup let service ClassifierService let mut handlers HashMap new handlers insert service domain amp service this is were our actual command begins let message handler handlers get amp message domain unwrap let response message handler receive action message action unwrap IpcMessage domain message handler domain toString action response Please note that the service creation and registration code are only for demonstration purposes In an actual application we would instead use a managed state to store our action handlers during application startup We also omitted the error handling here to keep the code simple However there are quite some scenarios we should check e g what should happen if no handler is found or how should we proceed if parsing an action into an enum goes wrong etc ConclusionOur proof of concept was successful Sure some parts of the implementation can be tweaked but porting UMLBoard s IPC messaging from Electron TypeScript to Tauri Rust is definitely manageable Rust s enums are an elegant and type safe way to implement our message system We only have to ensure that potential serialization errors are handled when converting JSON objects into our enum variants In the next post in this series we will try to use a document based local database to store our domain model Hopefully by then I ll finally understand how the borrow checker works What s your opinion on that Have you already worked with Tauri and Rust and what were your experiences Please share your thoughts in the comments or via Twitter umlboard Title Image from Wallpaper Flare Source code for this project is available on Github Originally published at |
2023-02-07 13:50:29 |
海外TECH |
DEV Community |
5 React Tools to Use in an Ecommerce Stack |
https://dev.to/medusajs/5-react-tools-to-use-in-an-ecommerce-stack-1ojo
|
React Tools to Use in an Ecommerce StackEcommerce has become more popular as businesses turn to online sales to increase their reach JavaScript and React are among the most popular stacks for building ecommerce applications React is a JavaScript library for designing user interfaces It enables developers to produce reusable modular components that are simple to integrate into bigger applications It s a wonderful option for creating ecommerce apps because it makes it easier to create dynamic and complicated user interfaces This article highlights React based tools for your ecommerce stack The ease of use and adaptability of these technologies make them popular among developers They can assist you in creating effective and sophisticated ecommerce websites and applications What is Medusa Medusa is a composable commerce platform that provides essential ecommerce components as modular building blocks Benefits of Using React for EcommerceUsing React tools have a number of benefits Improved Performance and User Experience React is a popular tool used to create user interfaces and websites It speeds up updates to the real DOM by using a virtual Document Object Model resulting in a better user experience This is especially important for ecommerce websites as a slow loading page may discourage users from making a purchase Reusable Components With React you have access to reusable components and React developer tools which can be used across different pages and features of the website or commerce app This makes development with React and React projects more efficient and easier to maintain Strong Community Support There are many different plugins and libraries available for use with React based ecommerce projects This offers a great variety of options for users and developers can quickly add new functionality to their projects Easy Integration with Other Technologies React is designed to be easily integrated with other technologies making it a good choice for ecommerce projects that may require integration with other systems or platforms You can integrate payment gateways shipping programs customer relationship management CRM programs and others SEO Friendly React is also SEO friendly which is crucial for ecommerce websites whose traffic is largely derived from search engines React s virtual DOM enables quicker rendering times which can enhance the site s search engine indexing React Based Tools for Your Ecommerce Stack Medusa ReactMedusa React is a library that allows developers to build custom React storefronts and React based frameworks that interact seamlessly with the Medusa backend It provides a set of components utilities and hooks to facilitate this interaction and makes use of the react query library for server side state management Medusa React is used for building ecommerce websites or applications It uses the Medusa backend for tasks such as managing orders processing payments and tracking inventory Advantages of Using Medusa React for EcommerceCustom Storefronts By using Medusa React you can build custom storefronts that are tailored to your specific needs and requirements This is particularly useful if you have specific requirements or constraints that cannot be met by an off the shelf solution Next js and Gatsby are good examples of custom storefronts you can build with Medusa ReactHooks for Fetching Data and Performing Mutations Medusa React exposes a set of hooks for fetching data queries and performing mutations on the server side These hooks are built on top of react query s useQuery and useMutation hooks and allow developers to easily access data from the Medusa backend and perform server side effects Server Side State Management The library uses react query as a solution for server side state management which can help you to manage complex data structures and relationships between different components in your storefront Utility Functions for Displaying Localized Money Amounts Medusa React provides utility functions for converting and displaying money amounts in a localized format This can be useful for ecommerce applications that need to display prices and other monetary values to users in different regions Robust and Well Supported Medusa React is a library that is well maintained and supported by Medusa s core team This means that you can count on it to work as expected and receive updates and bug fixes over time This gives you the confidence to use it in your projects Next jsNext JS is a popular framework for building server rendered React applications it supports static site rendering and client site rendering It is designed to make it simple for developers to build apps or create react apps that are fast and can be rendered on both the server and the client The complexity of server rendering and code splitting is handled by Next js allowing developers to concentrate on creating their applications Advantages of Using Next js for EcommerceImproved Performance and User Experience One of the main advantages of using Next js for ecommerce is its ability to deliver a fast and smooth user experience using server side rendering Here the initial render is done on the server rather than the client leading to a shorter website load time SEO Friendly Next js is both SEO friendly and easy to use making it perfect for creating server rendered React applications Additionally its pre rendering feature helps with SEO as the HTML for the page is generated on the server and sent to the client This makes it easy for search engines to access and index the content Automatic Code Splitting Next js has automatic code splitting which divides the JavaScript bundle into smaller pieces that may be loaded as demanded This can improve the performance of the site as the client does not need to download the entire JavaScript bundle upfront Serverless Deployment Next js makes application deployment to serverless platforms like Vercel AWS Lambda or Google Cloud Functions simple This can be a more affordable option than maintaining their own servers as they only pay for the resources they use Stripe ElementsStripe Elements is a set of pre built UI components that make it easy to add secure and custom payment forms to a website or application It is built on top of the Stripe API which allows developers to process payments and manage customer information React and Stripe work great together and Stripe Elements makes it easy to add payment processing to your website or application Advantages of Using Stripe Elements for EcommerceSecure Payment Processing Having the ability to accept payments securely is one of the key benefits of using Stripe Elements for ecommerce Stripe is a well known trusted payment gateway with strong security measures in place to protect customer information Custom Made Payment Forms Using Stripe Elements payment forms can be customized to match the branding and look of a website or application It can make the payment process more convenient for customers which in turn enhances their experience Strong Community Support Since Stripe has an active developer community Stripe Elements users have access to a variety of information and support It comes with plugins and frameworks that can be quickly added to React based ecommerce projects It also has a robust ecosystem of tools and services GatsbyGatsby is a popular open source framework built on react that helps developers build fast modern websites and applications Gatsby provides several rendering options It provides a deferred static generation which builds a page the first time a user requests it It also provides server side rendering that generates pages on the fly with data fetched each time a user visits the page and static site generation that generates pages at build time By employing a static site generator approach rather than relying on server side rendering or client side rendering it builds a totally static HTML website at build time Gatsby websites and apps are fast and efficient because they can be served from a Content Delivery Network without a server Advantages of Using Gatsby for EcommerceImproved Performance and User Experience Gatsby has the ability to deliver a fast and smooth user experience Websites and applications can be served from a CDN thanks to Gatsby s static site generator technique which enables speedy delivery to users wherever they may be Easy Integration with Ecommerce Platforms and APIs With Gatsby integrating with a variety of ecommerce platforms tools and APIs is simple including options like Medusa and Stripe As a result developers don t have to worry about creating their own backend or integrating with various payment methods SEO Friendly Gatsby websites and applications are SEO friendly due to being built with static HTML and easily crawled by search engines Gatsby automatically offers drop in support for server rendering of metadata which is added to the static HTML pages improving the site s ranking in search engines Scalability Gatsby is a popular tool for ecommerce websites that handle a lot of traffic It is static meaning it doesn t need to be updated frequently and it is cheap to operate This makes it a great choice for growing companies Algolia React InstantSearchAlgolia React InstantSearch is a React library that allows you to quickly build a search interface for your ecommerce website It is a component of the robust search engine Algolia Search API This library can assist you in creating quick accurate and user friendly search experiences for your customers You can use React InstantSearch s pre built components to create a search bar search results filters shopping carts product buttons add to cart buttons and other features Algolia React InstantSearch can also be used with other search engines like MeiliSearch Advantages of Using Algolia React InstantSearch for EcommerceUsing Algolia React InstantSearch for your ecommerce stack has a number of benefits Fast Search Results Algolia is known for its fast search results which is crucial for ecommerce websites Customers expect fast and relevant search results and Algolia delivers on that front Custom Made Search Experience React InstantSearch allows you to customize the search experience to fit your brand and business needs To provide your consumers with a special search experience you can either design your own react components or choose from a variety of pre built ones Integration with Other Algolia Products React InstantSearch integrates with other Algolia products such as Algolia Analytics which allows you to track the performance of your search experience and make data driven decisions Ease of Use React InstantSearch is simple to use and doesn t need much setting up You can quickly start using a search interface thanks to its simple integration into an existing application ConclusionReact tools provide advantages for developing and scaling ecommerce websites They are simple to use and may assist you in developing quick secure and user friendly websites These websites offer consumers a seamless online experience If you re looking to take your ecommerce business to the next level then you ll want to check out these React ecommerce tools These tools can help you create a top notch website or optimize an existing one which can lead to increased sales With a composable ecommerce platform like Medusa you can expect more flexibility and scalability in terms of your user interface and underlying architecture which can lead to better performance and growth opportunities for your ecommerce business in the long run Get started with Medusa by following this quickstart guide Should you have any issues or questions related to Medusa then feel free to reach out to the Medusa team via Discord |
2023-02-07 13:22:40 |
海外TECH |
DEV Community |
[Safe-TypeORM] AnyORM becomes the real TypeORM |
https://dev.to/samchon/safe-typeorm-make-anyorm-to-be-the-real-typeorm-478n
|
Safe TypeORM AnyORM becomes the real TypeORM SummaryMake anyorm to be real typeorm safe typeorm is a helper library of typeorm enhancing type safety like below When writing SQL query Errors would be detected in the compilation levelAuto Completion would be providedType Hint would be supportedYou can implement App join very convenientlyWhen SELECTing for JSON conversionApp Join with the related entities would be automatically doneExact JSON type would be automatically deducedThe performance would be automatically tuned AnyORMThe most famous ORM library in TypeScript is typeorm However Korean TypeScript backend developers jokingly call the TypeORM as AnyORM It s because the typeorm does not guarantee type safety so that cause lots of critical runtime errors As you can see from below code JOIN or SELECT queries are written as a string typed value and it never be validated in the compilation level TypeScript developers can identify error only when running the backend server code Such type unsafety is the reason why I ve developed safe typeorm a wrapper library typeorm to make it from AnyORM to be real typeorm class User PrimaryGeneratedColumn id number Column name string OneToMany gt Photo photo gt photo user photos Photo const users await dataSource getRepository User createQueryBuilder user leftJoinAndSelect user photos photo unsafe andWhere user id id id fuXXing unsafe getMany PrismaWhen I ve completed the safe typeorm library another ORM library prisma has been newly inveted and it was much elegant than typeorm As the prisma ensures perfect type safety and much convenient to use than typeorm I also moved from typeorm to prisma Therefore no reason to maintain the safe typeorm due to I m not using typeorm more RevivalHowever unlike my case abandoned typeorm and adapted prisma many companies have been suffering by AnyORM typeorm and its type unsafety One of such company traveled my Github Account and unearthed the safe typeorm The company requested me like below We have been suffering from type unsafety of TypeORM We had wrapped the TypeORM to our self developed module for enhancing type safety but it had been too hard works for us In nowadays we ve found your safe typeorm library and it seems like the solution what we ve looked for Can you write a Guide Documents I was a little bit surprised and could hear lots of voices from another companies using NestJS in South Korea What they had in common was that they are suffering from AnyORM but it was too risky to migrate their currently running commercial backend server to prisma Most of them are dreaming to prisma but it is not possible by legacy code Thus I urgently wrote a Guide Documents It took years after the completion of safe typeorm library that the Guide Documents was created It is a pleasure story for me that there re some people who want my old libraries but I also feel regretful that I left it for two years because I couldn t think of such specific requirements Contents of Guide Documents written in two days RelationshipsPrefaceBelongs ManyToOneBelongs OneToOneHas OneToOneHas OneToManyHas ManyToManyBuildersPrefaceJoinQueryBuilderAppJoinBuilderJsonSelectBuilderInsertionsinitializeInsertCollectionEntityUtilUtilitiesEncryptedColumnPaginatorPasswordSnakeCaseStrategy Enhance Type Safety JoinQueryBuilderWith safe typeorm you can easily construct SQL queries just by utilzing auto completion If you ve taken a mistake during the SQL query construction compilation error will help you When writing SQL query Errors would be detected in the compilation levelAuto Completion would be providedType Hint would be supported AppJoinBuildertypeorm does not support complicate application level join However safe typeorm does You can implement App join very conveniently JsonSelectBuilderJSON conversion with automatic query construction and performance tuning When you want to convert DB records to JSON data with a specific type maybe DTO you don t need to write any SQL query like SELECT or JOIN Just by listing up neighborhoold entities to join and columns to use safe typeorm will construct optimal SQL queries and application level joining plan by itself When SELECTing for JSON conversionApp Join with the related entities would be automatically doneExact JSON type would be automatically deducedThe performance would be automatically tunedimport safe from safe typeorm export async function demo app join builder groups BbsGroup Promise lt IBbsGroup gt const builder new safe JsonSelectBuilder BbsGroup articles new safe JsonSelectBuilder BbsArticle group safe DEFAULT category new safe JsonSelectBuilder BbsCategory parent recursive as const tags new safe JsonSelectBuilder BbsArticleTag tag gt tag value OUTPUT CONVERSION BY MAPPING contents new safe JsonSelectBuilder BbsArticleContent files join as const return builder getMany groups Safe Insertions initializeWhen creating a new entity instance typeorm cannot detect the omission of required properties However safe typeorm supports safe entity instance creation by initialize function import as orm from typeorm import safe from safe typeorm No error when compliation However becomes runtime error due to writer property omission async function new bbs article group BbsGroup Promise lt BbsArticle gt const article new BbsArticle await article group set group await article category set null article writer Samchon article ip article created at new Date return article Type safe factory function Compilation error occurs due to writer property omission function initialize bbs article group BbsGroup BbsArticle return safe initialize BbsArticle group group category null writer Samchon ip created at new Date deleted at null InsertCollectionWhen inserting multiple records of multiple entities you have to consider their dependency relationships when using typeorm However with safe typeorm you don t need to consider such complicate dependency relationships safe typeorm will automatically analyze dependency relationships and insert records in the right order import safe from safe typeorm async function insert tags BbsArticleTag articles BbsArticle contents BbsArticleContent groups BbsGroup contentFiles BbsArticleContentFile categories BbsCategory files AttachmentFile Promise lt void gt although you ve pushed entity records without considering dependency relationships const collection safe InsertCollection new safe InsertCollection collection push tags collection push articles collection push contents collection push groups collection push contentFiles collection push categories collection push files InsertCollection would automatically sort insertion order just by analyzing dependency relationships by itself await collection execute EntityUtilWith EntityUtil class of safe typeorm you can merge duplicated records safely even if target entity has complicate dependency relationships The safety would be always keeped even when unique key constraint exists in the dependency relationships import as orm from typeorm import safe from safe typeorm async function unify original Manufacturer duplicates Manufacturer Promise lt void gt await safe EntityUtil unify original duplicates manufacturers would be unified products would be unified product images would be unified orm Entity class Manufacturer id string name string orm Entity orm Unique manufacturer id name class Product id string manufacturer safe Belongs ManyToOne lt Manufacturer uuid gt name string orm Entity orm Unique product id name class ProductImage id string product safe Belongs ManyToOne lt Product uuid gt name string url string ConclusionWhen adapting ORM library of TypeScript I recommend to use prisma However if your legacy project is dependent on typeorm what about adapt safe typeorm |
2023-02-07 13:09:24 |
Apple |
AppleInsider - Frontpage News |
If you need an instant vintage Apple collection, here's where to get it |
https://appleinsider.com/articles/23/02/07/if-you-need-an-instant-vintage-apple-collection-heres-where-to-get-it?utm_medium=rss
|
If you need an instant vintage Apple collection here x s where to get itIf you always wanted a pile of old Apple hardware a retro computing website is selling its vast lot of old Macs displays drives printers and Mac paraphernalia The seller vintageapple org has been storing and cataloging classic Apple documents online for decades It is now selling a huge vintage Mac collection on eBay due to time constraints and presumably storage ones as well The giant collection includes over Mac related items including Apple Lisa computers Macs add in cards displays printers and old Mac laptops It also includes not just whole units but also spare parts for Apple s first laser printer the LaserWriter Read more |
2023-02-07 13:46:46 |
Apple |
AppleInsider - Frontpage News |
Ignite a romantic Valentine's Day with big sales on Bluetti power stations & solar panels |
https://appleinsider.com/articles/23/02/07/ignite-a-romantic-valentines-day-with-big-sales-on-bluetti-power-stations-solar-panels?utm_medium=rss
|
Ignite a romantic Valentine x s Day with big sales on Bluetti power stations amp solar panelsThere are big discounts across Bluetti s power station and solar panel lines just in time for Valentine s Day Bluetti Valentine s saleWith Valentine s Day right around the corner lovebirds are racking their brains to find more creative gifts than traditional flowers or chocolate Luckily Bluetti has rolled out loads of savings on a wide selection of solar generators as of Feb to bolster the sweet celebration with someone special at home outdoor entertainment or RV trips on the road Read more |
2023-02-07 13:08:00 |
Apple |
AppleInsider - Frontpage News |
MIcrosoft Outlook users suffered overnight outage, fixes rolling out |
https://appleinsider.com/articles/23/02/07/outlook-users-cant-send-emails-as-microsoft-suffers-overnight-outage?utm_medium=rss
|
MIcrosoft Outlook users suffered overnight outage fixes rolling outMicrosoft Outlook suffered a major outage overnight with users waking on Tuesday morning to find they couldn t access or send emails through neither the application nor the website ーbut things seem to be gradually getting better Microsoft OutlookA series of tweets from the official Microsoft Status Twitter account details the discovery investigation and attempts to rectify a problem with Outlook One which prevented users from performing some core functions with the communications tool Read more |
2023-02-07 13:04:29 |
海外TECH |
Engadget |
Meta reportedly plans to open Horizon Worlds to younger teens as soon as March |
https://www.engadget.com/meta-open-horizon-worlds-younger-teens-march-131930554.html?src=rss
|
Meta reportedly plans to open Horizon Worlds to younger teens as soon as MarchOnly adults and older can sign up for Meta s Horizon Worlds at the moment but according to The Wall Street Journal that could change very very soon Meta is reportedly opening up its virtual reality social experience to younger players aged to as soon as this March as part of its efforts to grow Horizon s numbers and improve user retention The Journal says it saw the information in a memo entitled Horizon Goals and Strategy in which Gabriel Aul Meta s VP for the VR experience outlined its goals for the first half of nbsp In the memo Aul reportedly wrote that these younger users are the true digital citizens of the metaverse and that Meta needs to ensure that it serves them for Horizon to succeed Meta spokesperson Joe Osborne told the publication that t eens are already spending time in a variety of VR experiences on Quest and the company wants to ensure that it can provide them with a great experience in Horizon Worlds as well with age appropriate tools and protections in place nbsp Osborn didn t say what the experience will offer in the way of protecting young users In The Journal reported that the company s own researchers found Instagram harmful for a sizable percentage of teens particularly teenage girls Meta paused its work on an Instagram for Kids as a result and it has also launched a bunch of teen safety features for the app since then It also automatically limited triggering or sensitive content for new users under nbsp In addition to welcoming younger teens to Horizon Meta is aiming to grow the game s monthly active users to from within the first half of the year Perhaps more importantly at this point in time it s targeting a retention rate of percent Apparently Horizon had an percent retention rate in January which means only one in nine users returned to the experience the following month Meta is hoping to achieve those goals by improving the service s reliability and performance and getting rid of bugs that may affect people s enjoyment nbsp The company is aiming to release new Horizon experiences built by third party studios in an effort to win more people over as well Plus it s apparently hoping to make the VR game a lot more accessible by rolling out a web version for mobile and desktopf by June Meta teased the web version of the experience in the past but the company missed its initial launch target last year This year the company is not only hoping to launch Horizon s web version within the next few months it s also looking to have as many as monthly cross screen Horizon users in the first half of nbsp |
2023-02-07 13:19:30 |
Cisco |
Cisco Blog |
Overcoming Imposter Syndrome to Find My Place in Tech |
https://blogs.cisco.com/wearecisco/overcoming-imposter-syndrome-to-find-my-place-in-tech
|
Overcoming Imposter Syndrome to Find My Place in TechLauren R s career switch came with feelings of imposter syndrome but she realized she wasn t alone See how she found her confidence as a software engineer |
2023-02-07 13:00:53 |
Cisco |
Cisco Blog |
SASE – Necessary for the Future of Work |
https://blogs.cisco.com/financialservices/sase-necessary-for-the-future-of-work
|
SASE Necessary for the Future of WorkNo one could have predicted how important and quickly SASE which was first coined in would become relevant to almost every business in order to function in today s environment Here s how Cisco is making it work for financial services clients |
2023-02-07 13:00:43 |
金融 |
RSS FILE - 日本証券業協会 |
パブリックコメントの募集の結果について |
https://www.jsda.or.jp/about/public/kekka/index.html
|
募集 |
2023-02-07 15:00:00 |
ニュース |
BBC News - Home |
Ukraine war: Russians seen reinforcing east ahead of offensive |
https://www.bbc.co.uk/news/world-europe-64551937?at_medium=RSS&at_campaign=KARANGA
|
luhansk |
2023-02-07 13:18:55 |
ニュース |
BBC News - Home |
Mark Cavendish robbery: Two men jailed for raid at cyclist's home |
https://www.bbc.co.uk/news/uk-england-essex-64541757?at_medium=RSS&at_campaign=KARANGA
|
cavendish |
2023-02-07 13:34:25 |
ニュース |
BBC News - Home |
Man arrested over 11-year-old girl's disappearance in Galashiels |
https://www.bbc.co.uk/news/uk-scotland-64557459?at_medium=RSS&at_campaign=KARANGA
|
borders |
2023-02-07 13:46:06 |
ニュース |
BBC News - Home |
Richard Sharp: BBC chairman denies facilitating loan for Boris Johnson |
https://www.bbc.co.uk/news/entertainment-arts-64552571?at_medium=RSS&at_campaign=KARANGA
|
johnson |
2023-02-07 13:38:50 |
ニュース |
BBC News - Home |
Beyoncé tour: UK fans snap up tickets despite Ticketmaster glitches |
https://www.bbc.co.uk/news/entertainment-arts-64533856?at_medium=RSS&at_campaign=KARANGA
|
queue |
2023-02-07 13:41:16 |
ニュース |
BBC News - Home |
Turkey earthquake: Three Britons missing, says Foreign Office |
https://www.bbc.co.uk/news/uk-64557448?at_medium=RSS&at_campaign=KARANGA
|
officemore |
2023-02-07 13:30:31 |
ニュース |
BBC News - Home |
Turkey earthquake: Erdogan announces three-month state of emergency in quake area |
https://www.bbc.co.uk/news/world-europe-64548985?at_medium=RSS&at_campaign=KARANGA
|
syria |
2023-02-07 13:04:53 |
ニュース |
BBC News - Home |
Turkey earthquake: Before and after images show extent of destruction |
https://www.bbc.co.uk/news/world-europe-64544998?at_medium=RSS&at_campaign=KARANGA
|
syria |
2023-02-07 13:09:12 |
コメント
コメントを投稿