Our pure JavaScript Scheduler component


Post by drichter »

We're using Scheduler Pro and want to use the same scheduling logic also on the server side. It looks like the Bryntum Scheduling Engine (https://bryntum.com/dist/gantt/docs/engine/) would be the way to implment it.

  • The Scheduling Engine uses Chronograph (https://github.com/bryntum/chronograph) under the hood, but not much happened on the public repository in the last few years. Is this the same code that is actually used in Scheduler Pro?

  • The documentation of Chronograph is completely broken (all links on the right resulting in "404 Not Found") for at least a year (https://github.com/bryntum/chronograph/issues/20). Are there plans to fix it in the near future or is there another documentation?

  • Are there best-practices to perform server-side scheduling with Bryntum Scheduler Pro?

  • Does the Scheduling Engine run on GraalVM?


Post by nickolay »

Hello,

Answering your questions:

  • You should be able to use the same module on server side, in Node.js, the model/store/project APIs should work (if they won't - please file a ticket). Trying to instantiate a widget will throw of course. You probably will need to implement your own "Transport" class for the CRUD manager, to avoid pulling in browser dependencies.

  • No, it is covered by the Scheduler Pro license

  • Yes, Scheduler Pro and Gantt are based on the ChronoGraph v1 (master branch of https://github.com/bryntum/chronograph). There's also v2 branch in the same repository, which however, has contradicting metrics (faster regular computations, slower initial instantiation), so we don't put it into production. ChronoGraph v1 receives bug fixes and small improvements as long as that is required by the general course of Gantt/Scheduler Pro development.

  • You can find the ChronoGraph documentation in the scheduling engine docs.
    Recommending to start with Basic features guide, then continue to Advanced features guide

  • ChronoGraph documentation is written inline, in the source files. It is then extracted with the TypeDoc. There are very little pure-doc files (only guides).

  • Currently not that many clients are performing scheduling on the server-side, so we don't have any specific best-practices for that. Current "contract" is that "everything should work the same way as in browsers", except trying to "touch" the browser-related globals of course. In general you should just give it a try and let us know if you'll find any issues - we'll fix them promptly.

  • We haven't tested Scheduling Engine with GraalVM so far. In theory it should just work, as scheduling engine was written as pure TS codebase, w/o using any browser-related APIs. Need to verify that of course.

Hopefully this clarifies the things and please feel free to ask any further questions.


Post by drichter »

Hello nickolay,

thanks for your reply!

I've set up a Node.js project (get it running on GraalVM was too hard) and pulled in the Bryntum Scheduler Pro library. As far as I've understood this is the way to use the Scheduling Engine (though a smaller library would be sufficient in principle, but I haven't found one). However, if I try to instantiate a class from  the documentation (new SchedulerProProjectMixin) the class can not be found.

What is the recommended way to get the Scheduling Engine (https://bryntum.com/dist/gantt/docs/engine/) in a Node.js project? What npm package should be fetched?


Post by nickolay »

Hello, sure, yw.

Try instantiating ProjectModel?

In general, you should be using the same API as a regular browser package, the scheduling engine currently is not distributed as a separate package.


Post by drichter »

If I try to use the Bryntum Scheduler in a Nest.js application, I get a very long JavaScript output like the following (shortened):


0x1b22,0x133e)](){function aMe(a,b){return _spaf(a,b-0x539);}return{'draggable':![],'groupable':![],'hideable':![],'showColumnPicker':![],'filterable':![],'sorta

ble':![],'searchable':![],'editor':![],'enableCellContextMenu':![],'tooltipRenderer':![],'minWidth':0x0,'resizable':![],'cellCls':aMe(-0x4a6,0x8b5),'locked':!![]

,'flex':0x1,'alwaysClearCell':![]};}get[_spaf(0x575,-0x11b)](){return![];}['construct'](a){function aMf(a,b){return _spaf(a,b-0x4d3);}super[aMf(0xcb9,0xc55)](...

arguments),this[aMf(0x1b97,0x2ed9)]=new VerticalTimeAxis({'model':this['grid'][aMf(0x3ae4,0x2a70)],'client':this['grid']});}[_spaf(-0x2e4,0xe8d)]({cellElement:a,

size:b}){function aMg(a,b){return _spaf(a,b-0x10f);}this[aMg(0x16c1,0x2b15)][aMg(0xd57,0x1177)](a),b[aMg(0x3b35,0x2714)]=this[aMg(0x303c,0x2b15)]['height'];}[_sp

af(-0x228,0x3a6)](a){const b=super[aMh(0x686,-0x275)](a);function aMh(a,b){return _spaf(b,a-0x2e0);}return delete b['id'],delete b[aMh(0x90e,0x1974)],delete b[aM

h(0x61d,0x83e)],delete b[aMh(0x1df8,0xfce)],delete b['ariaLabel'],delete b[aMh(0x2926,0x20fe)],b;}}_defineProperty(VerticalTimeAxisColumn,'$name',_spaf(0x1bf7,0x

2d56)),ColumnStore[_spaf(0x217e,0x1bc4)](VerticalTimeAxisColumn),VerticalTimeAxisColumn[_spaf(0x1041,0x533)]=_spaf(0x1dfb,0x2d56);var AbstractCrudManagerValidati

on=a=>class b extends a{static get[_spaf(0x24b2,0x1fdd)](){function aMi(a,b){return _spaf(b,a-0x1c0);}return aMi(0x2115,0x1420);}static get[_spaf(0x3df,0x1229)](

){function aMj(a,b){return _spaf(a,b-0x109);}return{'validateResponse':!![],'skipSuccessProperty':!![],'crudLoadValidationWarningPrefix':aMj(0x192a,0x2b16),'crud

SyncValidationWarningPrefix':'CrudManager\x20sync\x20response\x20error(s):','supportShortSyncResponseNote':aMj(0x1474,0x2d7),'disableValidationNote':'Note:\x20To

\x20disable\x20this\x20validation\x20please\x20set\x20the\x20\x22validateResponse\x22\x20config\x20to\x20false'};}get['crudLoadValidationMandatoryStores'](){retu

rn[];}[_spaf(0x2d3,0x114a)](c,d,e){const f=[],{storeId:g}=c,h=this['crudLoadValidationMandatoryStores'],i={[g]:{}};function aMk(a,b){return _spaf(b,a-0x5db);}if(

d)!d['rows']&&(f['push']('-\x20\x22'+g+aMk(0x2ebd,0x434e)),i[g][aMk(0x1f99,0x1ce1)]=[aMk(0x26d5,0x1f82)]);else h!==null&&h!==void 0x0&&h[aMk(0x24ad,0xfa3)](g)&&(

f[aMk(0x57e,-0x4e3)](aMk(0x16a6,0x1b68)+g+aMk(0xe53,0x2618)),i[g][aMk(0x1f99,0x2cfb)]=[aMk(0x26d5,0x288f)]);return f[aMk(0x18ee,0x3e8)]&&Object[aMk(0xb73,0x222e)

followed by the error message:


SyntaxError: Unexpected token 'export'

    at internalCompileFunction (node:internal/vm:73:18)

    at wrapSafe (node:internal/modules/cjs/loader:1176:20)

    at Module._compile (node:internal/modules/cjs/loader:1218:27)

    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1308:10)

    at Module.load (node:internal/modules/cjs/loader:1117:32)

    at Function.Module._load (node:internal/modules/cjs/loader:958:12)

    at Module.require (node:internal/modules/cjs/loader:1141:19)

    at require (node:internal/modules/cjs/helpers:110:18)

    at Object.<anonymous> (C:\my-project\src\app.service.ts:2:1)

    at Module._compile (node:internal/modules/cjs/loader:1254:14)

It looks like somethind would be wrong with the module system in use. I tried several settings in the tsconfig.json, but nothing worked so far. The tsconfig.json looks like this


{

  "compilerOptions": {

    "allowSyntheticDefaultImports": true,

    "allowUnreachableCode": false,

    "allowUnusedLabels": false,

    "baseUrl": "./",

    "declaration": true,

    "emitDecoratorMetadata": true,

    "experimentalDecorators": true,

    "forceConsistentCasingInFileNames": true,

    "incremental": true,

    "module": "commonjs",

    "noFallthroughCasesInSwitch": true,

    "noImplicitOverride": true,

    "noImplicitReturns": true,

    "noPropertyAccessFromIndexSignature": true,

    "noUncheckedIndexedAccess": true,

    "noUnusedLocals":true,

    "noUnusedParameters": true,

    "outDir": "./dist",

    "removeComments": true,

    "skipLibCheck": false,

    "sourceMap": true,

    "strict": true,

    "target": "es2017",

  }

}

And that is my litle example Nest.js controller:


import { Injectable } from "@nestjs/common"

import { ProjectModel } from "@bryntum/schedulerpro"




@Injectable()

export class AppService {

  async getHello(): Promise<string> {

    const scheduler = new ProjectModel({

      events: [

        {

          id: "id1",

          name: "my event",

          duration: 1200,

          durationUnit: "second",

          unscheduled: true,

        },

      ],

    })

    await scheduler.commitAsync()

    return "Hello World!"

  }

}

Post by nickolay »

Can you provide a sample package that demonstrates the problem?


Post by drichter »

npmrc-file not includes because if licence.

Attachments
scheduler-test.zip
(81.29 KiB) Downloaded 17 times

Post by sergey.maltsev »


Post by nickolay »

Sorry, it seems as mentioned in the guide, the special Node.js bundles are not included in the trial packages. We'll be fixing this problem in one of the nearest releases.


Post by yyy7 »

Hi Nickolay,

I'm a coworker of drichter. Could you please let us know here when the trial release is fixed? (But maybe the purchase would be completed then, anyway.)


Post Reply