Giter Site home page Giter Site logo

javascript-sdk's Introduction

JavaScript SDKs

REUSE status

This repository contains a collection of packages consumed by the white label apps, and all players running javascript. The idea is to enable as much code sharing as possible between the various apps and players.

Packages

  • rbm-ott-sdk. An auto generated integration to the ExposureApi. Includes data type definitions and methods for fetching data.
  • app-sdk. A package managing data fetching and transformation for the white label apps, including an integration with the white label cms, and various utilities for generating carousels and components.
  • app-sdk-react. A react wrapper based on react-query around app-sdk and rbm-ott-sdk. Contains various hooks for for accessing data withing the react lifecycle.
  • conventional-changelog-redbeemedia. A commandline tool for generating changelogs based on git history.
  • etcd-client A simple etcd-client. Used by the imagedeliveryservice
  • nodejs-logger Simple logger for nodejs services built around the winston-logger
  • exposure-sdk DEPRECATED. Replaced by rbm-ott-sdk. Data models and data fetching from the exposure api.
  • whitelabel-sdk DEPRECATED. Replaced by app-sdk. A package managing data type definitions and data fetching from the whitelabelinternalapi
  • whitelabel-react DEPRECATED. replaced by app-sdk-react. A react wrapper based on react-query around whitelabel-sdk and exposure-sdk. Contains various hooks for for accessing data withing the react lifecycle

Development

Make sure you read Working with git before getting started.

  1. npm install, this will install all dependencies and link together all packages in this repo
  2. npm run build to build once and npm run watch to rebuild on changes
  3. npm install <path-to-this-repo>/packages/<package-to-work-with> run this from any project using these packages.
  4. npm run demo to run the demo appliction in the app-sdk-react package

Release packages

To release and publish the NPM package to GitHub run the following in master branch:

npm run lerna:version 

This will create a specific commit message that will trigger a GitHub Actions workflow. The script will automatically detect updated packages and resolve any dependencies, it will also prompt you to select a version bump type, please follow the semver standard.

Used by

javascript-sdk's People

Contributors

simonwallin avatar bwallberg avatar slowmove avatar friday avatar sellebr8n avatar tengosc007 avatar oscnord avatar shobaki avatar arkadiusz-polak avatar olivbraun avatar johanspaedtke avatar lucasmaupin avatar

Watchers

 avatar Leonard Norberg avatar Gabriel Vilén avatar Jenkins avatar Johan Svedberg avatar Razvan Mielcioiu avatar

javascript-sdk's Issues

do not use navigator.userAgent inside wl or exposure sdk

In order to keep the sdks compatible with react native we can't use navigator.userAgent or other web only apis in the sdk. Right now the only issue is the webp util in the image scaler. Hence it should be fixed in a compatible way or broken out into a separate package.

Rewrite image scaler.

  • No need for it to be a class. We should align with most other utils and just write it as simple functions.
  • It should live in the exposure sdk, since there is nothing wl-specific about it.
  • It should have a configurable roundOffFactor, just in case someone sends in device.width to it.

Deprecate and remove deserialize and jsonProperty

deserialize function in web app sometimes deserializes items in array into separate arrays ( jsonArray => Model[][] instead of jsonArray => Model[]). This should be investigated. See example in playerPage.component in web app.

Some work has been done for this. Needs to be finished.

Refactor SubType types.

We have WLComponentSubType on WLReference and CarouselSubType on WLCarousel ( which extends WLComponent ), should have consistent naming, and are they actually different?

Rename this repo and package?

In the RedBee documentation Client SDKs -> Javascript refers to the player, and in JIRA, "Javascript-SDK" also means the player.

The way I think of this repo is "TypeScript (not javascript) wrappings for the Exposure API", but that's just one of the packages. There's also whitelabel and whitelabel-react, and a couple of other very small packages.

Anyone have a good name suggestion (assuming you agree)?

A couple of suggestions: "exposure-ts", "player-sdks" or "typescript-sdks".

Edit: My current suggestion after more discussions on Slack is "internal-player-libs" (even if some of them are for the apps). whitelabel-react is an actual sdk, while the others are more of api-wrappers or isolated tools from what I understand.

Improve the translations util

translations.getText("") should include a second argument "values", the util should replace templated values always if not provided it should remove it and or detect it in some fashion and log it.

Make it possible to use fetch in services

As long as we keep the same interface, it should be possible to move over to fetch and node fetch rather than axios. Maybe we could pass an http client to the BaseService class? That would let's the user of the sdkt decide on exactly what to use.

Ideas for a potential 1.0.0

  • Remove @jsonPropery and serialize/deserialize
  • exposure-sdk should not map responses into classes, it should rather just return typed json data
  • remove axios dependancy. We still want it to be usable in node and browser, so let's think about how to handle that.
  • the service in whitelabel sdk can smply just extend exposure service. No longer any need to use two instances.
  • add whitelabel exposure endpoints to exposure service, for easy use in whitelabelinternalapi.
  • we could break out the transformation logic Asset => WLAsset into the sdk, making it possible to bypass whitelabelinternalapi if we want to.

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.