Giter VIP home page Giter VIP logo

tjek-js-sdk's People

Contributors

dependabot[bot] avatar djarnis avatar izotos avatar jrlarano avatar klarstrup avatar martensievers avatar mortenbo avatar reilly1993 avatar zerplin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

tjek-js-sdk's Issues

[Incito] Avoid image borders pre-load

Right now, images show a standard browser outline/border whilst the images load or init lazyload. We should make the images invisible until they have loaded.

CoreKit.request `body` behavior

Prior to 2.2.11 SGN.CoreKit.request would assume any provided request body should be JSON encoded and sent off with JSON mime headers: https://github.com/shopgun/shopgun-js-sdk/blob/dad037561f49c3c18b140b764a0d5e66bef825aa/lib/coffeescript/kits/core/request.coffee#L10

As of 2.2.11 this is no longer the case and currently it is necessary to write out those things:

    const session = await SGN.CoreKit.request({
      url: "/v2/sessions",
      method: "PUT",
      headers: {
        Accept: "application/json",
        "Content-Type": "application/json",
      },
      body: JSON.stringify({
        email,
        password,
      }),
    });

I'm going to restore this behavior as well as reintroduce the "json" option.

[EventsKit] Make event-tracker-pool instantiation lazy

Currently event-tracker-pool is set on localStorage on all sites with shopgun-sdk included in any way, regardless of whether an EventTracker is even active on the page. The code also runs serverside on any node server that require('shopgun-sdk'); (but doesn't do anything except cost a few cycles to throw a couple of caught errors).

getContentRect error

31955299-4147fbfa-b8e8-11e7-907d-9b950edfc267

This issue occurs because we try to render hotspots too fast where the page isn't ready. Wrapping hotspotsRequested event trigger into a setTimeout with a delay of 0 fixes it but there might be a more elegant solution.

Create a CJS build

With the current setup importing shopgun-sdk in a webpack setup everything blows up, we should provide a CommonJS build where we don't rely on things like coffee-script/register. That kind of monkey patching globals is really not something you want a dependency doing.

Cannot find module "child_process"

Getting this error after updating to 2.1.4:
bundle.js:28802 Uncaught Error: Cannot find module "child_process"
at webpackMissingModule (bundle.js:28802)
at bundle.js:28802
at Object. (bundle.js:28805)
at Object. (bundle.js:40988)
at webpack_require (bootstrap 938a2135e317cbe97e17:19)
at Object. (es7.string.pad-end.js:8)
at webpack_require (bootstrap 938a2135e317cbe97e17:19)
at Object.defineProperty.value (es7.string.match-all.js:6)
at webpack_require (bootstrap 938a2135e317cbe97e17:19)
at Object. (es7.reflect.get-own-metadata-keys.js:4)

2018-03-23_1231

Add Promise support to .request methods

Let the .request methods of the graphkit and the corekit return a Promise when not passed a callback function in the last argument, so as to provide an API like so:

SGN.CoreKit.request({ url: '/v2/catalogs' })
    .then(function(data){/* handle data */})
    .catch(function(error){/* handle error */})

Check the environment for support and throw an error if support is not present. Said error should suggest using the callback style or adding a Promise polyfill.

[PagedPublicationKit] Take a page(not spread) to start on in configuration.

This is hacked in in react-lab like

let versoPosition;
if (this.props.position === 'end') {
  versoPosition = viewer._core.verso.pageSpreads.length - 1;
} else {
  // PagedPublicationKit should expose this sorta thing
  versoPosition = +viewer._core.verso.pageIds[`page${this.props.position}`].id
    .replace('double-', '')
    .replace('single-', '');
}
viewer.navigateTo(versoPosition);

Unify browser & node entries, simplify build

This should serve to clean up our messy entry split+build config and move any feature detection complexity to where the feature is used or to the package consumer(for example, them trying to initialize a *-publicationkit on a node environment fails for obvious reasons, but importing the package does not and they should be able to use our isomorphic features just fine(corekit, graphkit)).

We can do this once these PRs are merged and next versions published:
tjek/verso-browser#4
tjek/incito-browser#2

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.