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.


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

查看所有标签

猜你喜欢:

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

移动社交时代的互动搜索营销(全彩)

移动社交时代的互动搜索营销(全彩)

萧秋水、秋叶、南方锈才 / 电子工业出版社 / 2014-8-1 / 55.00元

《移动社交时代的互动搜索营销(全彩)》跳出搜索引擎的局限,告诉读者如何利用互联网找到客户的思维。《移动社交时代的互动搜索营销(全彩)》只谈如何有效利用搜索引擎(包括移动端搜索)、电商网站、新媒体,不传播所谓的一夜暴红、一夜暴富的神话。《移动社交时代的互动搜索营销(全彩)》作者利用其丰富的实战经验,结合大量国内不同行业的实际应用案例,生动地告诉读者,怎样正确地利用搜索引擎,以很小的投资获得巨大的回报......一起来看看 《移动社交时代的互动搜索营销(全彩)》 这本书的介绍吧!

CSS 压缩/解压工具
CSS 压缩/解压工具

在线压缩/解压 CSS 代码

在线进制转换器
在线进制转换器

各进制数互转换器

SHA 加密
SHA 加密

SHA 加密工具