GithubHelp home page GithubHelp logo

proxy-client-vue's Introduction

What is Unleash?

Unleash is a powerful open source solution for feature management. It streamlines your development workflow, accelerates software delivery, and empowers teams to control how and when they roll out new features to end users. With Unleash, you can deploy code to production in smaller, more manageable releases at your own pace.

Feature flags in Unleash let you test your code with real production data, reducing the risk of negatively impacting your users' experience. It also enables your team to work on multiple features simultaneously without the need for separate feature branches.

Unleash is the most popular open source solution for feature flagging on GitHub. It supports 15 official client and server SDKs and over 15 community SDKs. You can even create your own SDK if you wish. Unleash is compatible with any language and framework.


Getting Started with Unleash

1. Setting Up Unleash

To get started with Unleash, you need git and docker installed on your machine.

Execute the following commands:

git clone [email protected]:Unleash/unleash.git
cd unleash
docker compose up -d

Then point your browser to localhost:4242 and log in using:

  • username: admin
  • password: unleash4all

If you'd rather run the source code in this repo directly via Node.js, see the step-by-step instructions to get up and running in the contributing guide.

2. Connect your SDK

Find your preferred SDK in our list of official SDKs and import it into your project. Follow the setup guides for your specific SDK.

If you use the docker compose file from the previous step, here's the configuration details you'll need to get going:

  • For front-end SDKs, use:
    • URL: http://localhost:4242/api/frontend/
    • clientKey: default:development.unleash-insecure-frontend-api-token
  • For server-side SDKs, use:
    • Unleash API URL: http://localhost:4242/api/
    • API token: default:development.unleash-insecure-api-token

If you use a different setup, your configuration details will most likely also be different.

Check a feature flag

Checking the state of a feature flag in your code is easy! The syntax will vary depending on your language, but all you need is a simple function call to check whether a flag is available. Here's how it might look in Java:

if (unleash.isEnabled("AwesomeFeature")) {
  // do new, flashy thing
} else {
  // do old, boring stuff
}

Run Unleash on a service?

If you don't want to run Unleash locally, we also provide easy deployment setups for Heroku and Digital Ocean:

Deploy to Heroku Deploy to DigitalOcean

Configure and run Unleash anywhere

The above sections show you how to get up and running quickly and easily. When you're ready to start configuring and customizing Unleash for your own environment, check out the documentation for getting started with self-managed deployments, Unleash configuration options, or running Unleash locally via docker.


Online demo

Try out the Unleash online demo.

The Unleash online demo


Community and help — sharing is caring

We know that learning a new tool can be hard and time-consuming. We have a growing community that loves to help out. Please don't hesitate to reach out for help.

Join Unleash on Slack

💬 Join Unleash on Slack if you want ask open questions about Unleash, feature toggling or discuss these topics in general.

💻 Create a GitHub issue if you have found a bug or have ideas on how to improve Unleash.

📚 Visit the documentation for more in-depth descriptions, how-to guides, and more.

📖 Learn more about the principles of building and scaling feature flag solutions.


Contribute to Unleash

Unleash is the largest open source feature flag solution on GitHub. Building Unleash is a collaborative effort, and we owe a lot of gratitude to many smart and talented individuals. Building it together with the community ensures that we build a product that solves real problems for real people. We'd love to have your help too: Please feel free to open issues or provide pull requests.

Check out the CONTRIBUTING.md file for contribution guidelines and the Unleash developer guide for tips on environment setup, running the tests, and running Unleash from source.

Contributors

The Unleash contributors


Features our users love

Flexibility and adaptability

Security and performance

  • Privacy by design (GDPR and Schrems II). End-user data never leaves your application.
  • Audit logs
  • Enforce OWASP's secure headers via the strict HTTPS-only mode
  • Flexible hosting options: host it on premise or in the cloud (any cloud)
  • Scale the Unleash Proxy independently of the Unleash server to support any number of front-end clients without overloading your Unleash instance

Looking for more features?

If you're looking for one of the following features, please take a look at our Pro and Enterprise plans:


Architecture

Read more in the system overview section of the Unleash documentation.


Unleash SDKs

To connect your application to Unleash you'll need to use a client SDK for your programming language.

Official server-side SDKs:

Official front-end SDKs:

The front-end SDKs connects via the Unleash Proxy in order to ensure privacy, scalability and security.

Community SDKs:

If none of the official SDKs fit your need, there's also a number of community-developed SDKs where you might find an implementation for your preferred language (such as Elixir, Dart, Clojure, and more).


Users of Unleash

Unleash is trusted by thousands of companies all over the world.

Proud Open-Source users: (send us a message if you want to add your logo here)

The Unleash logo encircled by logos for Finn.no, nav (the Norwegian Labour and Welfare Administration), Budgets, Otovo, and Amedia. The encircling logos are all connected to the Unleash logo.


Migration guides

Unleash has evolved significantly over the past few years, and we know how hard it can be to keep software up to date. If you're using the current major version, upgrading shouldn't be an issue. If you're on a previous major version, check out the Unleash migration guide!


Want to know more about Unleash?

Videos and podcasts

Articles and more

proxy-client-vue's People

Contributors

andreas-unleash avatar fredrikoseberg avatar heyjorgedev avatar ked57 avatar kwasniew avatar nunogois avatar olav avatar thomasheartman avatar tymek avatar vojvodics avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

proxy-client-vue's Issues

Allow clients to provide a default value

Describe the feature request

Vue users should be able provide a default value when using useFlag

e.g. the following options to should all be allowed

useFlag('my-cool-flag')
useFlag('my-cool-flag', true)
useFlag('my-cool-flag', false)

The behavior of a default value is outlined in the client specification document https://docs.getunleash.io/client-specification

Background

No response

Solution suggestions

No response

Support Vue2

Describe the feature request

As a developer I would like to support Vue2 and Vue3 code bases

Background

No response

Solution suggestions

No response

Could not find a declaration file for module '@unleash/proxy-client-vue'

Describe the bug

When I use the package in a vue + typescript + vite application with "type": "module" I get the error

Could not find a declaration file for module '@unleash/proxy-client-vue'. '.../node_modules/.pnpm/@Unleash[email protected][email protected]/node_modules/@unleash/proxy-client-vue/dist/index.es.js' implicitly has an 'any' type.
There are types at '.../node_modules/@unleash/proxy-client-vue/dist/index.d.ts', but this result could not be resolved when respecting package.json "exports". The '@unleash/proxy-client-vue' library may need to update its package.json or typings.ts(7016)

Steps to reproduce the bug

  1. Install the package in a vue + typescript + vite application with "type": "module"
  2. When importing the unleash plugin
  3. Typescript should throw an error as shown above

Expected behavior

No error from typescript

Logs, error output, etc.

No response

Screenshots

No response

Additional context

No response

Unleash version

No response

Subscription type

Open source

Hosting type

Self-hosted

SDK information (language and version)

0.1.0

Uncaught TypeError in useFlag

Describe the bug

Calling the useFlag() function in my project raises a TypeError:

useFlag('travel.landing')

My configuration

// main.ts
import { createApp } from 'vue'
import App from './app/index.vue'
import { plugin as unleashPlugin } from '@unleash/proxy-client-vue'

const config = {
  url: 'http://localhost:4242/api/frontend',
  clientKey: 'default:development.unleash-insecure-frontend-api-token',
  refreshInterval: 15,
  appName: 'vue',
}

const app = createApp(App)
app.use(unleashPlugin, { config })
app.mount('#app')
<!-- TaskFooter.vue -->
<template>
  {{ enabled }}
</template>

<script lang="ts" setup>
import { useFlag } from '@unleash/proxy-client-vue'
const enabled = useFlag('travel.landing')
</script>

Steps to reproduce the bug

I tried to reproduce it in a simple Vue app but it worked fine there. It raises the error only in my existing project.

Expected behavior

No response

Logs, error output, etc.

Uncaught (in promise) TypeError: Cannot destructure property 'isEnabled' of 'inject(...)' as it is undefined.
    at useFlag (index.es.js:1581:11)
    at setup (TaskFooter.vue:40:17)
    at callWithErrorHandling (runtime-core.esm-bundler.js:155:22)
    at setupStatefulComponent (runtime-core.esm-bundler.js:7044:29)
    at setupComponent (runtime-core.esm-bundler.js:7000:11)
    at mountComponent (runtime-core.esm-bundler.js:4921:13)
    at processComponent (runtime-core.esm-bundler.js:4896:17)
    at patch (runtime-core.esm-bundler.js:4488:21)
    at mountChildren (runtime-core.esm-bundler.js:4684:13)
    at processFragment (runtime-core.esm-bundler.js:4855:13)

Screenshots

Backtrace:

Screenshot 2023-04-18 at 17 44 19

The line on which this error is raised:

Screenshot 2023-04-18 at 17 44 25

How useFlag() is called:

Screenshot 2023-04-18 at 17 44 40

Additional context

No response

Unleash version

4.22.5

Subscription type

Open source

Hosting type

Self-hosted

SDK information (language and version)

Vuejs 3.2.30

Provide a changelog

Describe the feature request

Without a changelog, it is difficult to know if we are safe to upgrade.

Background

No response

Solution suggestions

No response

Types generated by rollup-plugin-typescript2 are wrong

Describe the bug

The rollup-plugin-typescript2 plugin for vite generates types (d.ts files) that have wrong types in them, compared to when you use tsc or vue-tsc to emit types.

With rollup plugin:

# useFlag.d.ts
declare const useFlag: (name: any) => import("vue").Ref<boolean>;
export default useFlag;

With tsc/vue-tsc:

declare const useFlag: (name: string) => import("vue").Ref<boolean>;
export default useFlag;

The plugin outputs any in multiple places.

Steps to reproduce the bug

Run yarn build and check the dist folder for d.ts files.

Run yarn run tsc --emitDeclarationOnly and check the dist folder for d.ts files.

Expected behavior

The build output should have types that are derived correctly from the typescript source.

Logs, error output, etc.

No response

Screenshots

No response

Additional context

No response

Unleash version

No response

Subscription type

No response

Hosting type

No response

SDK information (language and version)

No response

Default condition should be last one

Describe the bug

Using this dependency in projects with vue3.0.0 and webpack will cause the project build to fail

Steps to reproduce the bug

1.npm install @unleash/proxy-client-vue
2.import { useFlag } from '@unleash/proxy-client-vue'
3.const isEnabled = useFlag('test-toggle')

Expected behavior

No response

Logs, error output, etc.

No response

Screenshots

No response

Additional context

No response

Unleash version

0.1.1

Subscription type

Enterprise

Hosting type

Hosted by Unleash

SDK information (language and version)

No response

inject does not work in dialogs

Describe the bug

When accessing useFlag in dialogs (I am using quasar dialog), I get the following error:
Screenshot 2022-11-23 at 19 29 53

This happens because the values are provided from the root component.

The solution would be - not to use root level component for providing values, but install as a vue plugin.

I can make a PR for the implementation if you want me to - just note that this would be a breaking change

Steps to reproduce the bug

No response

Expected behavior

No response

Logs, error output, etc.

No response

Screenshots

No response

Additional context

No response

Unleash version

No response

Subscription type

No response

Hosting type

No response

SDK information (language and version)

No response

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.