GithubHelp home page GithubHelp logo

smartclient-cra's Introduction

SmartClient + create-react-app

This is part of a project aimed to evaluate and compare different react ui framework. Will take part in this evaluation SmartClient, ExtReact and AntDesign.

Criterias for thie evaluation are:

  1. Completeness widgets offerend, with Grids and Dashboards being the focus.
  2. Ease of development and the tools provided by the framework are the other focus of this evaluation
  3. Ability to access rest endpoints independently from the server technology used (For the evaluation we will use the endpoints provided by https://api.collegefootballdata.com)

Running the app

  1. Check out the code
  2. npm install
  3. npm start

Issues

Broken TS Definitions

Compiling with smartclient.d.ts causes the following error:

./src/isomorphic/smartclient.d.ts
SyntaxError: C:\git\smartclient-cra\src\isomorphic\smartclient.d.ts: Binding 'eval' in strict mode (1125:9)

  1123 | * @param {string} Expression to evaluate
  1124 | */
> 1125 | function eval(expression:string):any;
       |          ^
  1126 | /**
  1127 | *  Shorthand for new Date().getTime();, this returns a timeStamp - a large number
  1128 | *  which is incremented by 1 every millisecond. Can be used to generate unique identifiers,

It can be mitigated by manually commenting line 1125, but this approach is unfit with a CI/CD workflow.

To replicate: Uncomment line in ts file

TS definition does not compile in CI mode

Trying to build the application in a CI/CD environment we see a failure caused by the TS definifion file.

https://github.com/jimmyfm/smartclient-cra/runs/845824483

To replicate: https://create-react-app.dev/docs/running-tests/#on-your-own-environment

ISC can't be of type isc

Trying to import isc while associating to it the correct type as showsn below results in the following error Cannot use namespace 'isc' as a type.ts(2709).

const ISC: isc = window['isc'];

This also makes necessary to cast each single component to its type in order to use TS with it (ex: let grid = ISC.ListGrid.create({...}) as isc.ListGrid;).

We need to define isc as any which defeats the utility of a TS definition.

To replicate: Change line 5 in App.tsx

Cors call not working

Despite enabling cross domain calls with ISC.RPCManager.allowCrossDomainCalls = true; and testing that the remote API can be reached with the snippet below

// This works, no CORS issues
fetch('https://api.collegefootballdata.com/conferences?testing=cors')
  .then(r => r.json())
  .then(j => console.log(`testing remote fetch`, j));

Trying to change the dataURL from dataURL: "/conferences", to dataURL: "https://api.collegefootballdata.com/conferences", will cause the datasource to not load and throw the following error

Server returned TRANSPORT_ERROR with no error message performing operation 'isc_DataSource_0_fetch'

smartclient-cra's People

Contributors

jimmyfm avatar

Watchers

 avatar  avatar  avatar

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.