dsehnal / LiteMol

A library/plugin for handling 3D structural molecular data (not only) in the browser.
Other
157 stars 38 forks source link

Build issues of BasicNode Example tasks #72

Closed cycle20 closed 3 years ago

cycle20 commented 3 years ago

Hi,

I cannot re-build the complete project. I needed to fix gulpfile.ts:

sed -i 's/UTF-8/utf-8/g' gulpfile.ts

I purged files related to previous node version - since I tried a wide range and struggled with various issues. As I see node 10 works with the least upgrade efforts:

# switch to node 10
sudo n 10

# clean ups; install; default build
rm -rf package-lock.json \
  node_modules/ \
  ~/.npm  \
  && npm i \
  && gulp

Outputs of commands above are attached: tsc_errors_basic_node_inline.txt

Some considerable issues - except for warnings and vulnerabilities:

[22:56:26] Finished 'Example-BinaryCIFInspect-inline' after 17 s
[22:56:39] [tsc] node_modules/@types/node/assert.d.ts(12,28): error TS2304: Cannot find name 'unknown'.
[22:56:39] [tsc] node_modules/@types/node/assert.d.ts(12,64): error TS2304: Cannot find name 'asserts'.
[22:56:39] [tsc] node_modules/@types/node/assert.d.ts(12,72): error TS1144: '{' or ';' expected.
...
[22:56:39] [tsc] node_modules/@types/node/assert.d.ts(400,108): error TS2304: Cannot find name 'T'.
...
[22:56:39] [tsc] node_modules/@types/node/buffer.d.ts(164,19): error TS2304: Cannot find name 'unknown'.
[22:56:39] [tsc] node_modules/@types/node/buffer.d.ts(166,26): error TS2304: Cannot find name 'globalThis'.
...
[22:56:39] [tsc] node_modules/@types/node/buffer.d.ts(212,45): error TS2304: Cannot find name 'SharedArrayBuffer'.
...
[22:56:39] [tsc] node_modules/@types/node/buffer.d.ts(869,36): error TS2304: Cannot find name 'bigint'.
...
[22:56:39] [tsc] node_modules/@types/node/events.d.ts(217,106): error TS2304: Cannot find name 'AsyncIterableIterator'.
[22:56:39] [tsc] node_modules/@types/node/fs.d.ts(209,33): error TS2304: Cannot find name 'AsyncIterable'.
[22:56:39] [tsc] node_modules/@types/node/fs.d.ts(218,17): error TS2339: Property 'asyncIterator' does not exist on type 'SymbolConstructor'.
[22:56:39] [tsc] node_modules/@types/node/fs.d.ts(218,35): error TS2304: Cannot find name 'AsyncIterableIterator'.

How can I resolve these? Is it require some kind of upgrade steps?

I tried to add TypeScript 4 and reconfigure compile parameters for ES2021 in some tsconfig.json, but I am not familiar with the different module concepts of JavaScript and TS (CommonJS, AMD, UMD... what???) etc... various issues popped up - a complete nightmare.

Csongor

dsehnal commented 3 years ago

Hi,

yeah, welcome to "modern" webdev I guess. Would it be an option for you to use https://molstar.org? It has all the features of LiteMol & more.

David

cycle20 commented 3 years ago

yeah, welcome to "modern" webdev I guess.

:+1: I really "enjoy" it :rofl: I hope a new PASCAL -> WASM compiler is coming soon :roll_eyes: :smile:

Would it be an option for you to use https://molstar.org?

Yes, that would be an option, but we are currently migrating from it back to the future (or past). :smile:

It has all the features of LiteMol & more.

Sometimes less is more. I hope in this case as well and I will not have to ask too many questions in the future.


My elegant solution was excluding BasicNode Example tasks from gulpfile.ts.

dsehnal commented 3 years ago

Sure, if it works for you. The thing with TypeScript too is that there are breaking changes between version, so LiteMol would have to be changed to accommodate that.

Glad you found a workaround.