LanceDarkly: manage feature toggles in VS Code

栏目: IT技术 · 发布时间: 6年前

内容简介:I createdWhy did I build LanceDarkly?

I created LanceDarkly: manage feature toggles in VS Code , a VS Code extension to help make it easy to manage LaunchDarkly toggles without leaving the editor. What are LaunchDarkly toggles? It’s a service which enables a way of remotely managing the visibility of app features. Toggles are especially handy for trunk-based development and continuous deployment practices by enabling engineers to build features without the end-user seeing it. When that feature is ready, the toggle can be switched on to make the feature visible for all. LaunchDarkly toggles have many other options including splitting traffic to provide a way to split test.

Why did I build LanceDarkly?

LanceDarkly: manage feature toggles in VS Code LanceDarkly toggle view in VS Code

Problem

Switching between VS Code, LaunchDarkly web app and other toggle integrations are inconvenient during development. Also, the LaunchDarkly app does not provide a view of toggle states (on/off) for all environments. It’s likely you want the new feature visible on local and staging environments but hidden on production when developing. It’s handy to have an overview of these states which LaunchDarkly does not provide.

Solution

A VS Code extension brings LaunchDarkly toggle management closer to your development environment and shows all environment toggle states. Toggle on/off from within VS Code. Essentially a place to view all toggle information including other integrations using a plugin API.

VS Code WebViews using React

I knew that VS Code extensions had the WebViews feature, which enables you to have custom UI elements rather than restricted to the VS Code APIs. Then I thought would it be possible to build a React JS application inside these WebViews. I tried this idea out and discovered it was possible.

VS Code limits the way you can access their APIs from a WebView through a simple pub/sub system . This means you can send a message to the VS Code side to trigger a built-in API, for example: copy toggle key to the clipboard . It also means you can send messages from the VS Code to the WebView. In a way, you can think of VS Code as the server and the WebView as the browser and they send messages to each other.

If you’re interested in how I set up the React application in VS Code extension you can start here, React WebView index . You will see it’s wrapped in a context provider, this listens to messages sent from VS Code and relays that message on to any subscribing function.

I have used Webpack to build both WebViews to use the latest JavaScript features like import . You can run npm run build which will build the development code and watch for changes. When you’re ready to publish, VS Code extensions reads the package.json scripts vscode:prepublish as a hook which will trigger a production Webpack build that optimises the code to make the extension package as small as possible.

If you are interested in contributing you can find LanceDarkly GitHub repo here and follow the contributor guidelines.

Core features of LanceDarkly

Toggle ON/OFF

Confirm with optional message to toggle feature ON/OFF.

LanceDarkly: manage feature toggles in VS Code

Dashboard

Dashboard summary of toggles in the project. It shows the total number of toggles created for a project and ‘group by age’ totals.

LanceDarkly: manage feature toggles in VS Code

Filter/search toggles

Search toggles by name, key or description.

LanceDarkly: manage feature toggles in VS Code

Plugins API

You might have additional integrations which use LaunchDarkly toggles and you want to see that data. Plugins allow you to add read-only data in a toggle view and preventing the need to jump to another app.

The downside of LaunchDarkly is it’s not a free tool but it does have a free trial if you want to give it a go. If you have ideas or feedback for my LanceDarkly extension then please.


以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网

查看所有标签

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。

深入理解计算机系统(原书第2版)

深入理解计算机系统(原书第2版)

(美)Randal E.Bryant、David O'Hallaron / 龚奕利、雷迎春 / 机械工业出版社 / 2011-1-1 / 99.00元

本书从程序员的视角详细阐述计算机系统的本质概念,并展示这些概念如何实实在在地影响应用程序的正确性、性能和实用性。全书共12章,主要内容包括信息的表示和处理、程序的机器级表示、处理器体系结构、优化程序性能、存储器层次结构、链接、异常控制流、虚拟存储器、系统级I/O、网络编程、并发编程等。书中提供大量的例子和练习,并给出部分答案,有助于读者加深对正文所述概念和知识的理解。 本书的最大优点是为程序......一起来看看 《深入理解计算机系统(原书第2版)》 这本书的介绍吧!

HTML 压缩/解压工具
HTML 压缩/解压工具

在线压缩/解压 HTML 代码

XML、JSON 在线转换
XML、JSON 在线转换

在线XML、JSON转换工具

HSV CMYK 转换工具
HSV CMYK 转换工具

HSV CMYK互换工具