<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Basestack</title>
    <description>The latest articles on Forem by Basestack (@basestack).</description>
    <link>https://forem.com/basestack</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Forganization%2Fprofile_image%2F7457%2F07ada37f-cb43-4d9b-88d7-e7461af32d42.jpg</url>
      <title>Forem: Basestack</title>
      <link>https://forem.com/basestack</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/basestack"/>
    <language>en</language>
    <item>
      <title>Feature Flags in Action: 13 Real-World Scenarios</title>
      <dc:creator>Vitor Amaral</dc:creator>
      <pubDate>Fri, 06 Oct 2023 16:36:25 +0000</pubDate>
      <link>https://forem.com/basestack/feature-flags-in-action-13-real-world-scenarios-57k8</link>
      <guid>https://forem.com/basestack/feature-flags-in-action-13-real-world-scenarios-57k8</guid>
      <description>&lt;p&gt;Feature flags have a wide range of use cases in software development and product management. They provide flexibility and control over feature releases and can be applied in various scenarios to improve development processes and user experiences. &lt;/p&gt;

&lt;p&gt;Here are some common use cases for feature flags:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Phased Rollouts&lt;/strong&gt;: Gradual feature rollouts are one of the primary use cases for feature flags. By releasing a feature to a small subset of users initially and gradually expanding access, you can closely monitor its performance and gather feedback, which helps identify and fix issues before a full-scale release.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;A/B Testing&lt;/strong&gt;: Feature flags enable A/B testing, where different variations of a feature are tested with distinct user groups to determine which version performs better in terms of user engagement, conversion rates, or other key metrics. This approach helps make data-driven decisions about feature design and functionality.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Canary Releases&lt;/strong&gt;: Canary releases involve deploying a new feature to a subset of your production environment. Feature flags make it easy to create canary releases, allowing you to test new features in a real-world environment with reduced risk. If issues arise, you can quickly disable the feature for the affected users.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Hotfixes and Rollbacks&lt;/strong&gt;: In the event of a critical bug or security vulnerability, feature flags can be used to quickly disable the problematic feature without requiring a full software redeployment. This ensures that the issue is mitigated while a fix is implemented.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Feature Toggles for SaaS Products&lt;/strong&gt;: SaaS (Software as a Service) providers can use feature flags to control access to premium features or provide early access to new functionality for specific customers or user groups.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;User Permissions and Entitlements&lt;/strong&gt;: Feature flags can be used to manage user permissions and entitlements dynamically. They allow you to control which users or user groups have access to specific features based on subscription levels, user roles, or other criteria.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Configuration Management&lt;/strong&gt;: Feature flags can be used for dynamic configuration management, enabling you to adjust application behavior without requiring code changes or redeployment. This is valuable for configuring application settings, external service endpoints, or feature parameters.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Feature Gating for Beta Programs&lt;/strong&gt;: When running beta programs, feature flags can control which participants have access to beta features. This allows you to gather feedback from a select group of users before a wider release.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Dark Launching&lt;/strong&gt;: Dark launching involves deploying a feature to production but keeping it hidden from users. Feature flags are essential for this use case, as they allow you to activate the feature for internal testing or monitoring while keeping it hidden from external users.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Geo-Targeting and Localization&lt;/strong&gt;: Feature flags can be used to deliver region-specific or language-specific features to users in different geographical locations or language preferences. This is especially useful for global applications.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;User Onboarding and Feature Tours&lt;/strong&gt;: Feature flags can control the visibility of onboarding experiences and feature tours for new users, ensuring that they receive a guided introduction to the application's key features.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Performance Optimization&lt;/strong&gt;: Feature flags can be used to enable or disable resource-intensive features dynamically to optimize application performance during peak usage times or on devices with limited capabilities.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Emergency Kill Switches&lt;/strong&gt;: In the case of a critical issue or security breach, feature flags can serve as emergency kill switches, allowing you to instantly disable specific features across all instances of your application to mitigate the problem.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;These use cases illustrate the versatility and power of feature flags in modern software development, enabling teams to manage features, test hypotheses, and respond to changing circumstances with agility and control.&lt;/p&gt;




&lt;h4&gt;
  
  
  Basestack Platform
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://basestack.co/"&gt;Basestack&lt;/a&gt;&lt;/strong&gt; is an open-source stack designed specifically for developers and startups. It offers a suite of tools, including Feature Flags, with additional tools such as Feedback, Forms, and more on the horizon. Our goal is to empower you to build great products.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://basestack.co/"&gt;🌐 Website&lt;/a&gt; | &lt;a href="https://docs.basestack.co/"&gt;📘 Docs&lt;/a&gt; | &lt;a href="https://github.com/basestack-co/basestack"&gt;💻 Github&lt;/a&gt; | &lt;a href="https://twitter.com/basestack_co"&gt;🐦 Twitter&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--w4-NuGnD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://i.imgur.com/Oq3YxXR.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--w4-NuGnD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://i.imgur.com/Oq3YxXR.gif" alt="Basestack Feature Flags Demo" width="800" height="502"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>programming</category>
      <category>opensource</category>
    </item>
    <item>
      <title>September 🧑‍💻 Changelog</title>
      <dc:creator>Vitor Amaral</dc:creator>
      <pubDate>Thu, 28 Sep 2023 17:19:44 +0000</pubDate>
      <link>https://forem.com/basestack/september-changelog-17np</link>
      <guid>https://forem.com/basestack/september-changelog-17np</guid>
      <description>&lt;p&gt;This month, our focus was on enhancing deployment options for the platform and introducing the ability to access the complete project activity history.&lt;/p&gt;

&lt;h3&gt;
  
  
  Here are some of the key highlights from this month's updates:
&lt;/h3&gt;

&lt;p&gt; &lt;/p&gt;

&lt;h4&gt;
  
  
  🚢 Deploy to Render
&lt;/h4&gt;

&lt;p&gt;We have recently added a deployment guide to our &lt;a href="https://docs.basestack.co/feature-flags/deployment/deploy-render" rel="noopener noreferrer"&gt;documentation&lt;/a&gt; that provides step-by-step instructions on how to deploy the platform on &lt;a href="https://render.com/" rel="noopener noreferrer"&gt;Render&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;To simplify the process, we have included a &lt;code&gt;render.yaml&lt;/code&gt; file at the root of the project, which contains all the essential services required to run the entire platform seamlessly within Render. These services include the Database, the PgBouncer Service, and the Feature Flags Platform.&lt;/p&gt;

&lt;p&gt;When you fork and clone the &lt;a href="https://github.com/basestack-co/basestack" rel="noopener noreferrer"&gt;repository&lt;/a&gt; and import it into your Render Account, Render will automatically detect the configuration file and provide guidance on filling in the necessary details.&lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;h4&gt;
  
  
  🪐 Deploy to Netlify
&lt;/h4&gt;

&lt;p&gt;Much like &lt;a href="https://vercel.com/" rel="noopener noreferrer"&gt;Vercel&lt;/a&gt;, &lt;a href="https://www.netlify.com/" rel="noopener noreferrer"&gt;Netlify&lt;/a&gt; simplifies the deployment of front-end applications for developers. We've now included a comprehensive guide in our &lt;a href="https://docs.basestack.co/feature-flags/deployment/deploy-netlify" rel="noopener noreferrer"&gt;documentation&lt;/a&gt; on deploying the Feature Flags Platform with Netlify. The platform leverages Netlify Functions to deploy serverless code efficiently. &lt;/p&gt;

&lt;p&gt;Please note that you will still require an external Postgres Database Service (such as &lt;a href="https://neon.tech/" rel="noopener noreferrer"&gt;Neon&lt;/a&gt;) for seamless operation.&lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;h4&gt;
  
  
  ⌛ Project Activity Page
&lt;/h4&gt;

&lt;p&gt;We initially introduced the Feature Flags Platform with the capability to track Flag Activity, which proved invaluable for team collaboration. However, we noticed that once a Flag was deleted, the associated activity was no longer visible. &lt;/p&gt;

&lt;p&gt;To address this, we've now introduced a General Activity Modal for the Project. This enhancement allows any developer or team member to access a comprehensive activity log, even when a flag has been deleted. It's a valuable addition to tracking project changes and maintaining transparency within your team.&lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;h4&gt;
  
  
  ⛓️ Upgrade to Node 18
&lt;/h4&gt;

&lt;p&gt;We were using Node.js version 16, but to stay up-to-date with security enhancements and Node.js features, we upgraded to Node.js version 18. As a result, the required version to run the project or deploy is now Node.js 18.&lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;h4&gt;
  
  
  🎯 Improvements and fixes
&lt;/h4&gt;

&lt;p&gt;As part of our routine maintenance, we've cleaned up, fixed, and improved various aspects of the platform. Additionally, we've upgraded the packages used to ensure we stay current with the latest features and security patches.&lt;/p&gt;




&lt;h4&gt;
  
  
  Basestack Platform
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://basestack.co/" rel="noopener noreferrer"&gt;Basestack&lt;/a&gt;&lt;/strong&gt; is an open-source stack designed specifically for developers and startups. It offers a suite of tools, including Feature Flags, with additional tools such as Feedback, Forms, and more on the horizon. Our goal is to empower you to build great products.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://basestack.co/" rel="noopener noreferrer"&gt;🌐 Website&lt;/a&gt; | &lt;a href="https://docs.basestack.co/" rel="noopener noreferrer"&gt;📘 Docs&lt;/a&gt; | &lt;a href="https://github.com/basestack-co/basestack" rel="noopener noreferrer"&gt;💻 Github&lt;/a&gt; | &lt;a href="https://twitter.com/basestack_co" rel="noopener noreferrer"&gt;🐦 Twitter&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi.imgur.com%2FOq3YxXR.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi.imgur.com%2FOq3YxXR.gif" alt="Basestack Feature Flags Demo"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>react</category>
      <category>github</category>
    </item>
    <item>
      <title>Feature Flags with JavaScript Proxies</title>
      <dc:creator>Vitor Amaral</dc:creator>
      <pubDate>Tue, 12 Sep 2023 18:20:20 +0000</pubDate>
      <link>https://forem.com/basestack/feature-flags-with-javascript-proxies-34la</link>
      <guid>https://forem.com/basestack/feature-flags-with-javascript-proxies-34la</guid>
      <description>&lt;p&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy"&gt;JavaScript Proxies&lt;/a&gt; are objects that can intercept and customize the behavior of fundamental operations on other objects, such as getting and setting properties, invoking functions, and much more.&lt;/p&gt;

&lt;p&gt;With JavaScript Proxies, you can create "virtual" objects that behave like real objects. This is achieved by intercepting calls to certain methods and functions and allowing you to customize the behavior of those calls.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;targetObject&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Alice&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;age&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;28&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;handler&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;get&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;target&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;property&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`Getting &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;property&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;target&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;property&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="na"&gt;set&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;target&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;property&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`Setting &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;property&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt; to &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="nx"&gt;target&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;property&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;proxyObject&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nb"&gt;Proxy&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;targetObject&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;handler&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;proxyObject&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// Logs "Getting name" and "Alice"&lt;/span&gt;
&lt;span class="nx"&gt;proxyObject&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;age&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;29&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// Logs "Setting age to 29"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Proxies can be used to implement feature flags in JavaScript in a flexible and powerful way. Here are some of the benefits of using proxies for feature flags:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Dynamic feature flag evaluation&lt;/strong&gt;: Using proxies, you can dynamically evaluate whether or not a particular feature flag is enabled or disabled. This allows you to change the behavior of your application in real-time, without having to restart the application or update the code.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Customizable flag behavior&lt;/strong&gt;: Proxies allow you to customize the behavior of a feature flag based on the context of the application. For example, you could enable a feature flag for a particular user or group of users, or enable a feature flag only in a particular environment.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Separation of concerns&lt;/strong&gt;: By using proxies to implement feature flags, you can separate the concerns of feature flag management and application logic. This allows you to more easily manage your feature flags and update them without having to modify the application code.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Testing and experimentation&lt;/strong&gt;: Using proxies, you can experiment with different feature flag configurations and test the impact of those changes on your application. This allows you to make data-driven decisions about feature flag behavior and optimize the user experience.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Examples of how you can use JavaScript proxies to implement feature flags:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Dynamic flag evaluation
&lt;/h3&gt;

&lt;p&gt;In this example, we use a proxy to dynamically evaluate the &lt;code&gt;newFeatureEnabled&lt;/code&gt; feature flag based on the current date. The &lt;code&gt;get&lt;/code&gt; method of the proxy intercepts calls to the &lt;code&gt;newFeatureEnabled&lt;/code&gt; property and returns &lt;code&gt;true&lt;/code&gt; if the current date is after September 1, 2023. This allows us to enable the new feature dynamically without having to restart the application or update the code.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;featureFlags&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nb"&gt;Proxy&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;newFeatureEnabled&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;
&lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;target&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;property&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;property&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;newFeatureEnabled&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;date&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nb"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
      &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;date&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nb"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;2023-09-01&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;target&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;property&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;featureFlags&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;newFeatureEnabled&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c1"&gt;// Code for new feature goes here&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  2. Customizable flag behavior
&lt;/h3&gt;

&lt;p&gt;In this example, we use a proxy to customize the behavior of the &lt;code&gt;newFeatureEnabled&lt;/code&gt; feature flag based on the current user. The &lt;code&gt;get&lt;/code&gt; method of the proxy intercepts calls to the &lt;code&gt;newFeatureEnabled&lt;/code&gt; property and returns &lt;code&gt;true&lt;/code&gt; if the current user has access to the new feature. This allows us to enable the new feature for certain users or groups of users.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;featureFlags&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nb"&gt;Proxy&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;newFeatureEnabled&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;
&lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;target&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;property&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;property&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;newFeatureEnabled&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;user&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;getCurrentUser&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
      &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;hasAccessToNewFeature&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;target&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;property&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;featureFlags&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;newFeatureEnabled&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c1"&gt;// Code for new feature goes here&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  3. Separation of concerns
&lt;/h3&gt;

&lt;p&gt;In this example, we use a proxy to separate the concerns of feature flag management and application logic. The &lt;code&gt;get&lt;/code&gt; method of the proxy intercepts calls to any property and fetches the corresponding feature flag value from the server. This allows us to update the feature flag values without having to modify the application code.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;featureFlags&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nb"&gt;Proxy&lt;/span&gt;&lt;span class="p"&gt;({},&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;target&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;property&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// Fetch feature flag value from server&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;value&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;fetchFeatureFlagValue&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;property&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;featureFlags&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;newFeatureEnabled&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c1"&gt;// Code for new feature goes here&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  4. Testing and experimentation
&lt;/h3&gt;

&lt;p&gt;In this example, we use a proxy to experiment with the &lt;code&gt;newFeatureEnabled&lt;/code&gt; feature flag. The &lt;code&gt;get&lt;/code&gt; method of the proxy intercepts calls to the &lt;code&gt;newFeatureEnabled&lt;/code&gt; property and returns &lt;code&gt;true&lt;/code&gt; for users in the experimental group. This allows us to test the impact of the new feature on a small group of users before rolling it out to everyone.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;featureFlags&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nb"&gt;Proxy&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;newFeatureEnabled&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;
&lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;target&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;property&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;property&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;newFeatureEnabled&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;experimentGroup&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;getCurrentExperimentGroup&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
      &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;experimentGroup&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;experimentalGroup&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
      &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;target&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;property&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;featureFlags&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;newFeatureEnabled&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c1"&gt;// Code for new feature goes here&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;Overall, using proxies for feature flags can provide a more flexible and powerful way to manage feature flag behavior in your JavaScript application. By separating the concerns of feature flag management and application logic, you can more easily manage your feature flags and optimize the user experience of your application.&lt;/p&gt;




&lt;h4&gt;
  
  
  Basestack Platform
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://basestack.co/"&gt;Basestack&lt;/a&gt;&lt;/strong&gt; is an open-source stack designed specifically for developers and startups. It offers a suite of tools, including Feature Flags, with additional tools such as Feedback, Forms, and more on the horizon. Our goal is to empower you in building great products.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--w4-NuGnD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://i.imgur.com/Oq3YxXR.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--w4-NuGnD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://i.imgur.com/Oq3YxXR.gif" alt="Basestack Feature Flags Demo" width="800" height="502"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://basestack.co/"&gt;Website&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.basestack.co/"&gt;Docs&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/basestack-co/basestack"&gt;Github&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://twitter.com/basestack_co"&gt;Twitter&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>programming</category>
      <category>opensource</category>
    </item>
    <item>
      <title>Hello, World!</title>
      <dc:creator>Vitor Amaral</dc:creator>
      <pubDate>Thu, 31 Aug 2023 19:04:27 +0000</pubDate>
      <link>https://forem.com/basestack/hello-world-37g5</link>
      <guid>https://forem.com/basestack/hello-world-37g5</guid>
      <description>&lt;p&gt;This simple "Hello, World!" is here to introduce you to &lt;a href="https://basestack.co/"&gt;Basestack&lt;/a&gt; and let you know that we're developing this project transparently and in the open.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What Exactly is Basestack?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Basestack is an open-source stack designed specifically for developers and startups. It offers a comprehensive suite of tools, including Feature Flags, with additional tools such as Feedback, Forms, and more on the horizon. Our goal is to empower you in building great products.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why Choose Our Feature Flags Platform?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Basestack Feature Flags is a self-hosting platform that provides an effortless method to host your very own Feature Flags management platform. By leveraging services like &lt;a href="https://vercel.com"&gt;Vercel&lt;/a&gt;, any developer, whether an indie or startup, gains full control over their features and data. Ultimately, the platform is housed in your account, under your management, giving you complete control over your data.&lt;/p&gt;

&lt;h4&gt;
  
  
  Tools
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;⛳ Feature Flags (&lt;em&gt;Beta&lt;/em&gt;) &lt;a href="https://docs.basestack.co/feature-flags"&gt;Docs&lt;/a&gt; | &lt;a href="https://basestack.co/"&gt;Website&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;📄 Forms (Planned)&lt;/li&gt;
&lt;li&gt;💬 Feedback (Planned)&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Check more at:
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/basestack-co/basestack"&gt;Github Repo&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://twitter.com/basestack_co"&gt;Twitter&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>flags</category>
      <category>opensource</category>
      <category>github</category>
      <category>typescript</category>
    </item>
  </channel>
</rss>
