Reid  Rohan

Reid Rohan

1649151180

@ts-tools/robotrix: Useful TypeScript Transpilation Transformers

@ts-tools/robotrix

Useful TypeScript transpilation transformers.

Getting started

Install the library:

npm i @ts-tools/robotrix

Transformers

Node Env Transformer

Replaces process.env.[PARAM] expressions with string literals, using provided env.

import ts from 'typescript';
import { createNodeEnvTransformer } from '@ts-tools/robotrix';

const nodeEnvTransformer = createNodeEnvTransformer(process.env);

const transpileOutput = ts.transpileModule(code, { transformers: { before: [nodeEnvTransformer] } });

React Dev Transformer

Adds meta-data which is used by React for development error messages.

It adds the following attributes to all JSX elements:

  • __self={this}
  • __source={{ fileName: __jsxFileName, lineNumber: [jsx line number], pos: [jsx node position], end: [jsx node end] }}

if __source was added, the following declaration is prepended to source file: const __jsxFileName = [absolute file path]

import ts from 'typescript';
import { reactDevTransformer } from '@ts-tools/robotrix';

const transpileOutput = ts.transpileModule(code, { transformers: { before: [reactDevTransformer] } });

Dead Ifs Transformer

Detects and removes dead if branches. Checks the expression of every if statement, and cancels out always falsy branches.

It detects true, false, and basic string equality comparison (==, ===, !=, !==).

import ts from 'typescript';
import { deadIfsTransformer } from '@ts-tools/robotrix';

const transpileOutput = ts.transpileModule(code, { transformers: { before: [deadIfsTransformer] } });

Remap Imports Transformer

Remaps targets of esnext's static or dynamic imports/re-exports.

import ts from 'typescript';
import { createRemapImportsTransformer } from '@ts-tools/robotrix';

const remapImportsTransformer = createRemapImportsTransformer({
  remapTarget(target: string, containingFile: string): string {
    // remaps 'lodash' to 'lodash-es'
    // all others targets are untouched
    return target === 'lodash' ? 'lodash-es' : target;
  },
});

const transpileOutput = ts.transpileModule(code, { transformers: { before: [remapImportsTransformer] } });

CommonJS to ESM Transformer

Transforms CommonJS calls/exports to ESM syntax. If a source file is identified as using require, module, or exports, it is wrapped with the following:

[generated imports]

let exports = {}, module = { exports }

[original code]

export default module.exports

Each require(...) call with a string request is converted to a generated import statement with a unique identifier.

import ts from 'typescript';
import { createCjsToEsmTransformer } from '@ts-tools/robotrix';

const cjsToEsmTransformer = createCjsToEsmTransformer();
const transpileOutput = ts.transpileModule(code, { transformers: { before: [cjsToEsmTransformer] } });

createCjsToEsmTransformer() also accepts an optional options object, where one can currently specify shouldTransform to control whether to transform require(...) calls based on their target.

const blacklisted = new Set(['fs', 'another', 'etc']);

// doesn't convert any require(...) calls that target items in blacklisted
const cjsToEsmTransformer = createCjsToEsmTransformer({
  shouldTransform: (request) => !blacklisted.has(request),
});

Resolved Modules Transformer

Remaps static/dynamic esm imports/re-exports to the actual files resolved by TypeScript. It ignores relative targets (./ or ../) or ones resolved to definition (.d.ts) files.

Unlike other transformers in robotrix, this transformer requires TypeScript to resolve imports as part of a typed-checked transpilation (where a ts.Program is involved). This means it can be used when creating a custom ts.LanguageService and specifying getCustomTransformers() during host creation.

import ts from 'typescript';
import { resolvedModulesTransformer } from '@ts-tools/robotrix';

const languageServiceHost: ts.LanguageServiceHost = {
  getCustomTransformers() {
    return {
      before: [resolvedModulesTransformer],
    };
  },
  // ...rest of the host implementation is up to you
};

const languageService = ts.createLanguageService(languageServiceHost);

Author: AviVahl
Source Code: https://github.com/AviVahl/ts-tools/tree/main/packages/robotrix 
License: MIT License

#typescript 

What is GEEK

Buddha Community

@ts-tools/robotrix: Useful TypeScript Transpilation Transformers

The Definitive Guide to TypeScript & Possibly The Best TypeScript Book

TypeScript Deep Dive

I've been looking at the issues that turn up commonly when people start using TypeScript. This is based on the lessons from Stack Overflow / DefinitelyTyped and general engagement with the TypeScript community. You can follow for updates and don't forget to ★ on GitHub 🌹

Reviews

  • Thanks for the wonderful book. Learned a lot from it. (link)
  • Its probably the Best TypeScript book out there. Good Job (link)
  • Love how precise and clear the examples and explanations are! (link)
  • For the low, low price of free, you get pages of pure awesomeness. Chock full of source code examples and clear, concise explanations, TypeScript Deep Dive will help you learn TypeScript development. (link)
  • Just a big thank you! Best TypeScript 2 detailed explanation! (link)
  • This gitbook got my project going pronto. Fluent easy read 5 stars. (link)
  • I recommend the online #typescript book by @basarat you'll love it.(link)
  • I've always found this by @basarat really helpful. (link)
  • We must highlight TypeScript Deep Dive, an open source book.(link)
  • Great online resource for learning. (link)
  • Thank you for putting this book together, and for all your hard work within the TypeScript community. (link)
  • TypeScript Deep Dive is one of the best technical texts I've read in a while. (link)
  • Thanks @basarat for the TypeScript Deep Dive Book. Help me a lot with my first TypeScript project. (link)
  • Thanks to @basarat for this great #typescript learning resource. (link)
  • Guyz excellent book on Typescript(@typescriptlang) by @basarat (link)
  • Leaning on the legendary @basarat's "TypeScript Deep Dive" book heavily at the moment (link)
  • numTimesPointedPeopleToBasaratsTypeScriptBook++; (link)
  • A book not only for typescript, a good one for deeper JavaScript knowledge as well. link
  • In my new job, we're using @typescriptlang, which I am new to. This is insanely helpful huge thanks, @basarat! link
  • Thank you for writing TypeScript Deep Dive. I have learned so much. link
  • Loving @basarat's @typescriptlang online book basarat.gitbooks.io/typescript/# loaded with great recipes! link
  • Microsoft doc is great already, but if want to "dig deeper" into TypeScript I find this book of great value link
  • Thanks, this is a great book 🤓🤓 link
  • Deep dive to typescript is awesome in so many levels. i find it very insightful. Thanks link
  • @basarat's intro to @typescriptlang is still one of the best going (if not THE best) link
  •  
  • This is sweet! So many #typescript goodies! link

Get Started

If you are here to read the book online get started.

Translations

Book is completely free so you can copy paste whatever you want without requiring permission. If you have a translation you want me to link here. Send a PR.

Other Options

You can also download one of the Epub, Mobi, or PDF formats from the actions tab by clicking on the latest build run. You will find the files in the artifacts section.

Special Thanks

All the amazing contributors 🌹

Share

Share URL: https://basarat.gitbook.io/typescript/

Author: Basarat
Source Code: https://github.com/basarat/typescript-book/ 
License: View license

#typescript #opensource 

Reid  Rohan

Reid Rohan

1649151180

@ts-tools/robotrix: Useful TypeScript Transpilation Transformers

@ts-tools/robotrix

Useful TypeScript transpilation transformers.

Getting started

Install the library:

npm i @ts-tools/robotrix

Transformers

Node Env Transformer

Replaces process.env.[PARAM] expressions with string literals, using provided env.

import ts from 'typescript';
import { createNodeEnvTransformer } from '@ts-tools/robotrix';

const nodeEnvTransformer = createNodeEnvTransformer(process.env);

const transpileOutput = ts.transpileModule(code, { transformers: { before: [nodeEnvTransformer] } });

React Dev Transformer

Adds meta-data which is used by React for development error messages.

It adds the following attributes to all JSX elements:

  • __self={this}
  • __source={{ fileName: __jsxFileName, lineNumber: [jsx line number], pos: [jsx node position], end: [jsx node end] }}

if __source was added, the following declaration is prepended to source file: const __jsxFileName = [absolute file path]

import ts from 'typescript';
import { reactDevTransformer } from '@ts-tools/robotrix';

const transpileOutput = ts.transpileModule(code, { transformers: { before: [reactDevTransformer] } });

Dead Ifs Transformer

Detects and removes dead if branches. Checks the expression of every if statement, and cancels out always falsy branches.

It detects true, false, and basic string equality comparison (==, ===, !=, !==).

import ts from 'typescript';
import { deadIfsTransformer } from '@ts-tools/robotrix';

const transpileOutput = ts.transpileModule(code, { transformers: { before: [deadIfsTransformer] } });

Remap Imports Transformer

Remaps targets of esnext's static or dynamic imports/re-exports.

import ts from 'typescript';
import { createRemapImportsTransformer } from '@ts-tools/robotrix';

const remapImportsTransformer = createRemapImportsTransformer({
  remapTarget(target: string, containingFile: string): string {
    // remaps 'lodash' to 'lodash-es'
    // all others targets are untouched
    return target === 'lodash' ? 'lodash-es' : target;
  },
});

const transpileOutput = ts.transpileModule(code, { transformers: { before: [remapImportsTransformer] } });

CommonJS to ESM Transformer

Transforms CommonJS calls/exports to ESM syntax. If a source file is identified as using require, module, or exports, it is wrapped with the following:

[generated imports]

let exports = {}, module = { exports }

[original code]

export default module.exports

Each require(...) call with a string request is converted to a generated import statement with a unique identifier.

import ts from 'typescript';
import { createCjsToEsmTransformer } from '@ts-tools/robotrix';

const cjsToEsmTransformer = createCjsToEsmTransformer();
const transpileOutput = ts.transpileModule(code, { transformers: { before: [cjsToEsmTransformer] } });

createCjsToEsmTransformer() also accepts an optional options object, where one can currently specify shouldTransform to control whether to transform require(...) calls based on their target.

const blacklisted = new Set(['fs', 'another', 'etc']);

// doesn't convert any require(...) calls that target items in blacklisted
const cjsToEsmTransformer = createCjsToEsmTransformer({
  shouldTransform: (request) => !blacklisted.has(request),
});

Resolved Modules Transformer

Remaps static/dynamic esm imports/re-exports to the actual files resolved by TypeScript. It ignores relative targets (./ or ../) or ones resolved to definition (.d.ts) files.

Unlike other transformers in robotrix, this transformer requires TypeScript to resolve imports as part of a typed-checked transpilation (where a ts.Program is involved). This means it can be used when creating a custom ts.LanguageService and specifying getCustomTransformers() during host creation.

import ts from 'typescript';
import { resolvedModulesTransformer } from '@ts-tools/robotrix';

const languageServiceHost: ts.LanguageServiceHost = {
  getCustomTransformers() {
    return {
      before: [resolvedModulesTransformer],
    };
  },
  // ...rest of the host implementation is up to you
};

const languageService = ts.createLanguageService(languageServiceHost);

Author: AviVahl
Source Code: https://github.com/AviVahl/ts-tools/tree/main/packages/robotrix 
License: MIT License

#typescript 

Why Use WordPress? What Can You Do With WordPress?

Can you use WordPress for anything other than blogging? To your surprise, yes. WordPress is more than just a blogging tool, and it has helped thousands of websites and web applications to thrive. The use of WordPress powers around 40% of online projects, and today in our blog, we would visit some amazing uses of WordPress other than blogging.
What Is The Use Of WordPress?

WordPress is the most popular website platform in the world. It is the first choice of businesses that want to set a feature-rich and dynamic Content Management System. So, if you ask what WordPress is used for, the answer is – everything. It is a super-flexible, feature-rich and secure platform that offers everything to build unique websites and applications. Let’s start knowing them:

1. Multiple Websites Under A Single Installation
WordPress Multisite allows you to develop multiple sites from a single WordPress installation. You can download WordPress and start building websites you want to launch under a single server. Literally speaking, you can handle hundreds of sites from one single dashboard, which now needs applause.
It is a highly efficient platform that allows you to easily run several websites under the same login credentials. One of the best things about WordPress is the themes it has to offer. You can simply download them and plugin for various sites and save space on sites without losing their speed.

2. WordPress Social Network
WordPress can be used for high-end projects such as Social Media Network. If you don’t have the money and patience to hire a coder and invest months in building a feature-rich social media site, go for WordPress. It is one of the most amazing uses of WordPress. Its stunning CMS is unbeatable. And you can build sites as good as Facebook or Reddit etc. It can just make the process a lot easier.
To set up a social media network, you would have to download a WordPress Plugin called BuddyPress. It would allow you to connect a community page with ease and would provide all the necessary features of a community or social media. It has direct messaging, activity stream, user groups, extended profiles, and so much more. You just have to download and configure it.
If BuddyPress doesn’t meet all your needs, don’t give up on your dreams. You can try out WP Symposium or PeepSo. There are also several themes you can use to build a social network.

3. Create A Forum For Your Brand’s Community
Communities are very important for your business. They help you stay in constant connection with your users and consumers. And allow you to turn them into a loyal customer base. Meanwhile, there are many good technologies that can be used for building a community page – the good old WordPress is still the best.
It is the best community development technology. If you want to build your online community, you need to consider all the amazing features you get with WordPress. Plugins such as BB Press is an open-source, template-driven PHP/ MySQL forum software. It is very simple and doesn’t hamper the experience of the website.
Other tools such as wpFoRo and Asgaros Forum are equally good for creating a community blog. They are lightweight tools that are easy to manage and integrate with your WordPress site easily. However, there is only one tiny problem; you need to have some technical knowledge to build a WordPress Community blog page.

4. Shortcodes
Since we gave you a problem in the previous section, we would also give you a perfect solution for it. You might not know to code, but you have shortcodes. Shortcodes help you execute functions without having to code. It is an easy way to build an amazing website, add new features, customize plugins easily. They are short lines of code, and rather than memorizing multiple lines; you can have zero technical knowledge and start building a feature-rich website or application.
There are also plugins like Shortcoder, Shortcodes Ultimate, and the Basics available on WordPress that can be used, and you would not even have to remember the shortcodes.

5. Build Online Stores
If you still think about why to use WordPress, use it to build an online store. You can start selling your goods online and start selling. It is an affordable technology that helps you build a feature-rich eCommerce store with WordPress.
WooCommerce is an extension of WordPress and is one of the most used eCommerce solutions. WooCommerce holds a 28% share of the global market and is one of the best ways to set up an online store. It allows you to build user-friendly and professional online stores and has thousands of free and paid extensions. Moreover as an open-source platform, and you don’t have to pay for the license.
Apart from WooCommerce, there are Easy Digital Downloads, iThemes Exchange, Shopify eCommerce plugin, and so much more available.

6. Security Features
WordPress takes security very seriously. It offers tons of external solutions that help you in safeguarding your WordPress site. While there is no way to ensure 100% security, it provides regular updates with security patches and provides several plugins to help with backups, two-factor authorization, and more.
By choosing hosting providers like WP Engine, you can improve the security of the website. It helps in threat detection, manage patching and updates, and internal security audits for the customers, and so much more.

Read More

#use of wordpress #use wordpress for business website #use wordpress for website #what is use of wordpress #why use wordpress #why use wordpress to build a website

Sunny  Kunde

Sunny Kunde

1597848060

Top 12 Most Used Tools By Developers In 2020

rameworks and libraries can be said as the fundamental building blocks when developers build software or applications. These tools help in opting out the repetitive tasks as well as reduce the amount of code that the developers need to write for a particular software.

Recently, the Stack Overflow Developer Survey 2020 surveyed nearly 65,000 developers, where they voted their go-to tools and libraries. Here, we list down the top 12 frameworks and libraries from the survey that are most used by developers around the globe in 2020.

(The libraries are listed according to their number of Stars in GitHub)

1| TensorFlow

**GitHub Stars: **147k

Rank: 5

**About: **Originally developed by researchers of Google Brain team, TensorFlow is an end-to-end open-source platform for machine learning. It has a comprehensive, flexible ecosystem of tools, libraries, and community resources that lets researchers push the state-of-the-art research in ML. It allows developers to easily build and deploy ML-powered applications.

Know more here.

2| Flutter

**GitHub Stars: **98.3k

**Rank: **9

About: Created by Google, Flutter is a free and open-source software development kit (SDK) which enables fast user experiences for mobile, web and desktop from a single codebase. The SDK works with existing code and is used by developers and organisations around the world.


#opinions #developer tools #frameworks #java tools #libraries #most used tools by developers #python tools

50+ Useful DevOps Tools

The article comprises both very well established tools for those who are new to the DevOps methodology.

What Is DevOps?

The DevOps methodology, a software and team management approach defined by the portmanteau of Development and Operations, was first coined in 2009 and has since become a buzzword concept in the IT field.

DevOps has come to mean many things to each individual who uses the term as DevOps is not a singularly defined standard, software, or process but more of a culture. Gartner defines DevOps as:

“DevOps represents a change in IT culture, focusing on rapid IT service delivery through the adoption of agile, lean practices in the context of a system-oriented approach. DevOps emphasizes people (and culture), and seeks to improve collaboration between operations and development teams. DevOps implementations utilize technology — especially automation tools that can leverage an increasingly programmable and dynamic infrastructure from a life cycle perspective.”

As you can see from the above definition, DevOps is a multi-faceted approach to the Software Development Life Cycle (SDLC), but its main underlying strength is how it leverages technology and software to streamline this process. So with the right approach to DevOps, notably adopting its philosophies of co-operation and implementing the right tools, your business can increase deployment frequency by a factor of 30 and lead times by a factor of 8000 over traditional methods, according to a CapGemini survey.

The Right Tools for the Job

This list is designed to be as comprehensive as possible. The article comprises both very well established tools for those who are new to the DevOps methodology and those tools that are more recent releases to the market — either way, there is bound to be a tool on here that can be an asset for you and your business. For those who already live and breathe DevOps, we hope you find something that will assist you in your growing enterprise.

With such a litany of tools to choose from, there is no “right” answer to what tools you should adopt. No single tool will cover all your needs and will be deployed across a variety of development and Operational teams, so let’s break down what you need to consider before choosing what tool might work for you.

  • Plan and collaborate: Before you even begin the SDLC, your business needs to have a cohesive idea of what tools they’ll need to implement across your teams. There are even DevOps tools that can assist you with this first crucial step.
  • Build: Here you want tools that create identically provisioned environments. The last you need is to hear “But it works for me on my computer”
  • Automation: This has quickly become a given in DevOps, but automation will always drastically increase production over manual methods.
  • Continuous Integration: Tools need to provide constant and immediate feedback, several times a day but not all integrations are implemented equally, will the tool you select be right for the job?
  • Deployment: Deployments need to be kept predictable, smooth, and reliable with minimal risks, automation will also play a big part in this process.

With all that in mind, I hope this selection of tools will aid you as your business continues to expand into the DevOps lifestyle.

Tools Categories List:

Infrastructure As Code

Continuous Integration and Delivery

Development Automation

Usability Testing

Database and Big Data

Monitoring

Testing

Security

Helpful CLI Tools

Development

Visualization

Infrastructure As Code

#AWSCloudFormation

1. AWS CloudFormation

AWS CloudFormation is an absolute must if you are currently working, or planning to work, in the AWS Cloud. CloudFormation allows you to model your AWS infrastructure and provision all your AWS resources swiftly and easily. All of this is done within a JSON or YAML template file and the service comes with a variety of automation features ensuring your deployments will be predictable, reliable, and manageable.

Link: https://aws.amazon.com/cloudformation/

2. Azure Resource Manager

Azure Resource Manager (ARM) is Microsoft’s answer to an all-encompassing IAC tool. With its ARM templates, described within JSON files, Azure Resource Manager will provision your infrastructure, handle dependencies, and declare multiple resources via a single template.

Link: https://azure.microsoft.com/en-us/features/resource-manager/

#Google Cloud Deployment Manager

3. Google Cloud Deployment Manager

Much like the tools mentioned above, Google Cloud Deployment Manager is Google’s IAC tool for the Google Cloud Platform. This tool utilizes YAML for its config files and JINJA2 or PYTHON for its templates. Some of its notable features are synchronistic deployment and ‘preview’, allowing you an overhead view of changes before they are committed.

Link: https://cloud.google.com/deployment-manager/

4. Terraform

Terraform is brought to you by HashiCorp, the makers of Vault and Nomad. Terraform is vastly different from the above-mentioned tools in that it is not restricted to a specific cloud environment, this comes with increased benefits for tackling complex distributed applications without being tied to a single platform. And much like Google Cloud Deployment Manager, Terraform also has a preview feature.

Link: https://www.terraform.io/

#Chef

5. Chef

Chef is an ideal choice for those who favor CI/CD. At its heart, Chef utilizes self-described recipes, templates, and cookbooks; a collection of ready-made templates. Cookbooks allow for consistent configuration even as your infrastructure rapidly scales. All of this is wrapped up in a beautiful Ruby-based DSL pie.

Link: https://www.chef.io/products/chef-infra/

#Ansible

#tools #devops #devops 2020 #tech tools #tool selection #tool comparison