2018-11-20 20:34:42 +01:00
/ * *
* Copyright ( c ) 2017 - present , Facebook , Inc .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
* /
const React = require ( 'react' ) ;
const CompLibrary = require ( '../../core/CompLibrary.js' ) ;
const MarkdownBlock = CompLibrary . MarkdownBlock ; /* Used to read markdown */
const Container = CompLibrary . Container ;
const GridBlock = CompLibrary . GridBlock ;
const siteConfig = require ( ` ${ process . cwd ( ) } /siteConfig.js ` ) ;
function imgUrl ( img ) {
return ` ${ siteConfig . baseUrl } img/ ${ img } ` ;
}
function docUrl ( doc , language ) {
return ` ${ siteConfig . baseUrl } docs/ ${ language ? ` ${ language } / ` : '' } ${ doc } ` ;
}
function pageUrl ( page , language ) {
return siteConfig . baseUrl + ( language ? ` ${ language } / ` : '' ) + page ;
}
2021-01-26 09:46:56 +01:00
const Button = ( { className = '' , href , target , children } ) => (
< div className = "pluginWrapper buttonWrapper" >
< a className = { [ "button" , className ] . join ( ' ' ) } href = { href } target = { target } >
{ children }
< / a >
< / d i v >
) ;
2018-11-20 20:34:42 +01:00
Button . defaultProps = {
target : '_self' ,
} ;
const SplashContainer = props => (
< div className = "homeContainer" >
< div className = "homeSplashFade" >
< div className = "wrapper homeWrapper" > { props . children } < / d i v >
< / d i v >
< / d i v >
) ;
const Logo = props => (
< div className = "projectLogo" >
< img src = { props . img _src } alt = "Project Logo" / >
< / d i v >
) ;
2021-02-25 12:42:18 +01:00
const LogoSvg = ( { style } ) => (
< svg style = { style } viewBox = "0 0 200 60" xmlns = "http://www.w3.org/2000/svg" >
< g transform = "translate(280.822 -299.303)" >
< text
style = { {
lineHeight : "0%" ,
InkscapeFontSpecification : "'Ubuntu, Medium'" ,
textAlign : "start" ,
} }
fontFamily = "Ubuntu"
x = "-227.697"
y = "343.108"
>
< tspan
style = { {
lineHeight : "100%" ,
InkscapeFontSpecification : "'Ubuntu, Medium'" ,
textAlign : "start" ,
} }
fontSize = "37.5"
x = "-227.697"
y = "343.108"
>
Unleash
< / t s p a n >
< / t e x t >
< rect
height = "22.483"
width = "40.186"
fill = "#0b1700"
rx = "9.74"
x = "-272.312"
y = "318.151"
/ >
< rect
height = "12.604"
width = "14.489"
fill = "#fff"
rx = "4.135"
x = "-251.511"
y = "323.352"
/ >
< / g >
< / s v g >
) ;
2018-11-20 20:34:42 +01:00
const ProjectTitle = ( ) => (
< h2 className = "projectTitle" >
2021-02-25 16:15:20 +01:00
< img src = { imgUrl ( 'unleash-oss-logo-v2.png' ) } alt = "Unleash" / >
2018-11-20 20:34:42 +01:00
< small > { siteConfig . tagline } < / s m a l l >
< / h 2 >
) ;
const PromoSection = props => (
< div className = "section promoSection" >
< div className = "promoRow" >
< div className = "pluginRowBlock" > { props . children } < / d i v >
< / d i v >
< / d i v >
) ;
class HomeSplash extends React . Component {
render ( ) {
const language = this . props . language || '' ;
return (
< SplashContainer >
< div className = "inner" >
2021-01-26 09:46:56 +01:00
< Survey / >
2018-11-20 20:34:42 +01:00
< ProjectTitle / >
< a
className = "github-button"
href = { siteConfig . repoUrl }
2020-12-15 13:18:38 +01:00
data - size = "large"
2018-11-20 20:34:42 +01:00
data - count - href = "/unleash/unleash/stargazers"
data - show - count = "true"
data - count - aria - label = "# stargazers on GitHub"
aria - label = "Star this project on GitHub" >
Star
< / a >
2021-01-26 09:46:56 +01:00
< FeatureCallout / >
2018-11-20 20:34:42 +01:00
< PromoSection >
2021-02-25 16:46:29 +01:00
< Button className = "primary" href = { docUrl ( 'deploy/getting_started' , language ) } > Getting Started < / B u t t o n >
2018-11-20 20:34:42 +01:00
< Button href = "#try" > Try It Out < / B u t t o n >
< Button href = { siteConfig . repoUrl } > GitHub < / B u t t o n >
< / P r o m o S e c t i o n >
2020-02-26 21:55:56 +01:00
< br / >
< SASSOffering / >
2018-11-20 20:34:42 +01:00
< / d i v >
< / S p l a s h C o n t a i n e r >
) ;
}
}
const Block = props => (
< Container
padding = { [ 'bottom' , 'top' ] }
id = { props . id }
background = { props . background } >
< GridBlock align = "left" contents = { props . children } layout = { props . layout } / >
< / C o n t a i n e r >
) ;
const FeatureCallout = ( ) => (
2021-01-26 09:46:56 +01:00
< div className = "productShowcaseSection" style = { { textAlign : 'center' } } >
2018-11-20 20:34:42 +01:00
< p >
2019-03-05 09:26:34 +01:00
Unleash is a feature toggle system , that gives you a great overview of all feature toggles across
2019-10-03 08:41:27 +02:00
all your applications and services . It comes with official client implementations for Java , Node . js , Go , Ruby , Python and . Net .
2018-11-20 20:34:42 +01:00
< / p >
< p >
The main motivation for doing feature toggling is to decouple the process for deploying code to production
and releasing new features . This helps reducing risk , and allow us to easily manage which features to enable
< / p >
< / d i v >
) ;
2021-01-26 09:46:56 +01:00
const Survey = ( ) => (
< div className = "productShowcaseSection" >
< p className = "alert alert-warning" >
Support us in making Unleash even better by participating in this & nbsp ;
< a href = "https://docs.google.com/forms/d/e/1FAIpQLSeCM5RUG-r8x4iynYNAlge_RCI77NDg61t28rixV3BBgVra0w/viewform" target = "_blank" >
Unleash Open - Source survey .
< / a > & n b s p ;
By participating you will also have the chance to win a $25 Amazon gift card .
< / p >
< / d i v >
) ;
2020-02-26 21:55:56 +01:00
const SASSOffering = ( ) => (
< div className = "productShowcaseSection" >
2021-01-26 09:46:56 +01:00
< p className = "alert alert-primary" >
Unleash also comes in a enterprise edition with additional features and a hosted option . < br / >
Check out & nbsp ;
2020-02-26 21:55:56 +01:00
< a href = "https://www.unleash-hosted.com/open-source" > unleash - hosted . com < / a >
< / p >
< / d i v >
) ;
2018-11-20 20:34:42 +01:00
const UnleashClient = ( ) => (
< Container padding = { [ 'bottom' , 'top' ] } id = "unleash-client" background = { 'light' } >
2021-02-26 07:49:31 +01:00
< h2 > Client SDK < / h 2 >
2018-11-20 20:34:42 +01:00
< p >
2021-02-26 07:49:31 +01:00
Unleash has official SDK for Java , Node . js , Go , Ruby , Python and . Net . And we will be happy to add implementations in other languages written by you ! These libraries make it very easy to use Unleash in your application .
2018-11-20 20:34:42 +01:00
< / p >
2018-11-22 20:33:28 +01:00
< div className = "gridBlock" >
< div className = "blockElement twoByGridBlock" >
< div className = "blockContent" >
< h3 > Official client SDKs : < / h 3 >
< ul >
< li > < MarkdownBlock > [ unleash / unleash - client - java ] ( https : //github.com/unleash/unleash-client-java)</MarkdownBlock></li>
< li > < MarkdownBlock > [ unleash / unleash - client - node ] ( https : //github.com/unleash/unleash-client-node)</MarkdownBlock></li>
< li > < MarkdownBlock > [ unleash / unleash - client - go ] ( https : //github.com/unleash/unleash-client-go)</MarkdownBlock></li>
< li > < MarkdownBlock > [ unleash / unleash - client - ruby ] ( https : //github.com/unleash/unleash-client-ruby)</MarkdownBlock></li>
< li > < MarkdownBlock > [ unleash / unleash - client - python ] ( https : //github.com/Unleash/unleash-client-python)</MarkdownBlock></li>
2019-10-03 08:41:27 +02:00
< li > < MarkdownBlock > [ unleash / unleash - client - core ] ( https : //github.com/Unleash/unleash-client-core) (.Net Core)</MarkdownBlock></li>
2018-11-22 20:33:28 +01:00
< / u l >
< / d i v >
< / d i v >
< div className = "blockElement twoByGridBlock" >
< div className = "blockContent" >
< h3 > Clients written by awesome enthusiasts : < / h 3 >
< ul >
2020-08-10 10:14:51 +02:00
< li > < MarkdownBlock > [ cognitedata / unleash - client - rust ] ( https : //github.com/cognitedata/unleash-client-rust) (Rust)</MarkdownBlock></li>
< li > < MarkdownBlock > [ uekoetter . dev / unleash - client - dart ] ( https : //pub.dev/packages/unleash) (Dart)</MarkdownBlock></li>
2020-08-17 11:31:28 +02:00
< li > < MarkdownBlock > [ silvercar / unleash - client - kotlin ] ( https : //github.com/silvercar/unleash-client-kotlin) (Kotlin)</MarkdownBlock></li>
< li > < MarkdownBlock > [ minds / unleash - client - php ] ( https : //gitlab.com/minds/unleash-client-php) (PHP)</MarkdownBlock></li>
2019-10-03 08:41:27 +02:00
< li > < MarkdownBlock > [ afontaine / unleash _ex ] ( https : //gitlab.com/afontaine/unleash_ex) (Elixir)</MarkdownBlock></li>
2020-01-15 07:54:10 +01:00
< li > < MarkdownBlock > [ mikefrancis / laravel - unleash ] ( https : //github.com/mikefrancis/laravel-unleash) (Laravel - PHP)</MarkdownBlock></li>
2020-11-11 09:58:30 +01:00
< li > < MarkdownBlock > [ AppsFlyer / clojure - unleash ] ( https : //github.com/AppsFlyer/unleash-client-clojure) (Clojure)</MarkdownBlock></li>
2020-12-24 15:14:55 +01:00
< li > < MarkdownBlock > [ pmb0 / nestjs - unleash ] ( https : //github.com/pmb0/nestjs-unleash) (NestJS - Node.js)</MarkdownBlock></li>
2018-11-22 20:33:28 +01:00
< / u l >
< / d i v >
< / d i v >
< / d i v >
2018-11-20 20:34:42 +01:00
< / C o n t a i n e r >
) ;
const TryOut = ( ) => (
< Block id = "try" >
{ [
{
content : 'We have deployed a demo version of [Unleash on Heroku](https://unleash.herokuapp.com). ' +
2018-11-22 20:33:28 +01:00
'Here you can play with the Unleash UI, define some feature toggles and get a feel of how to use Unleash. <br /><br />' +
'It is even possible to use one of the Unleash client SDKs and test it out Unleash your application. ' +
2019-03-05 09:26:34 +01:00
'To do this, you should connect one of the clients using the hosted API URL: https://unleash.herokuapp.com/api/.' ,
2019-05-31 09:08:46 +02:00
image : imgUrl ( 'dashboard_new.png' ) ,
2018-11-20 20:34:42 +01:00
imageAlign : 'left' ,
align : 'left' ,
title : 'Try Unleash' ,
} ,
] }
< / B l o c k >
) ;
const ActivationStrategies = ( ) => (
< Block background = "dark" >
{ [
{
2019-03-05 09:26:34 +01:00
content : 'It\'s great to have a system for turning stuff on and off. Sometimes, however, we want more granular control, and we want to decide who the toggle should be enabled for. This is where activation strategies come into the picture. Activation strategies take arbitrary config and allow us to enable a toggle in various ways.' ,
2018-11-20 20:34:42 +01:00
image : imgUrl ( 'logo-inverted.png' ) ,
imageAlign : 'right' ,
title : 'Activation strategies' ,
} ,
] }
< / B l o c k >
) ;
const Showcase = props => {
if ( ( siteConfig . users || [ ] ) . length === 0 ) {
return null ;
}
const showcase = siteConfig . users . filter ( user => user . pinned ) . map ( user => (
< a href = { user . infoLink } key = { user . infoLink } >
< img src = { user . image } alt = { user . caption } title = { user . caption } / >
< / a >
) ) ;
return (
< div className = "productShowcaseSection paddingBottom" >
2018-11-22 20:33:28 +01:00
< h2 > Who is Using Unleash ? < / h 2 >
< p > Unleash is used by < / p >
2018-11-20 20:34:42 +01:00
< div className = "logos" > { showcase } < / d i v >
< div className = "more-users" >
< a className = "button" href = { pageUrl ( 'users.html' , props . language ) } >
More { siteConfig . title } Users
< / a >
< / d i v >
< / d i v >
) ;
} ;
class Index extends React . Component {
render ( ) {
const language = this . props . language || '' ;
return (
< div >
< HomeSplash language = { language } config = { this . props . config } / >
2020-02-26 21:55:56 +01:00
2020-12-15 13:18:38 +01:00
< div className = "mainContainer" style = { { paddingTop : 0 } } >
2018-11-20 20:34:42 +01:00
< UnleashClient / >
< TryOut / >
< ActivationStrategies / >
< Showcase language = { language } / >
< / d i v >
< / d i v >
) ;
}
}
module . exports = Index ;