WebReflection / jsgtk

A simplified approach to GJS for Node.JS and JavaScript developers.
https://webreflection.github.io/jsgtk/
Other
85 stars 9 forks source link

"Code generator ... it exceeds the max of "100KB" #16

Closed softwareishappiness closed 7 years ago

softwareishappiness commented 7 years ago

I am endeavoring to write a Gnome client for Digital Ocean to manage hosted resources. Apparently, Digital Ocean node module, "do-wrapper", which provides the client API generates the following error message when required. After reading Babel documentation I am unsure if I need to set "compact" to false or exclude node_modules. In either case, I also do not know how to pass these options to jsgtk. Please expose options or advise. I am very excited and wish to use jsgtk.

Source Code

#!/usr/bin/env jsgtk

const Gtk = require('Gtk');
const Promise = require('es6-promise').Promise;
const DigitalOcean = require('do-wrapper');

Error Output

michael@michael-laptop:~/Source/digitalocean.com$ ./app.js 
[ERROR] [BABEL] Note: The code generator has deoptimised the styling of "unknown"
as it exceeds the max of "100KB".

(gjs:25031): Gjs-WARNING **: JS ERROR: ReferenceError: Buffer is not defined
anonymous@/usr/local/bin/jsgtk:249
evaluateModule@/usr/local/bin/jsgtk:160
load@/usr/local/lib/jsgtk/jsgtk_modules/jsgtk/node_modules.js:130
requireWithPath@/usr/local/bin/jsgtk:173
require@/usr/local/bin/jsgtk:155
anonymous@/usr/local/bin/jsgtk:175
evaluateModule@/usr/local/bin/jsgtk:160
load@/usr/local/lib/jsgtk/jsgtk_modules/jsgtk/node_modules.js:130
requireWithPath@/usr/local/bin/jsgtk:173
require@/usr/local/bin/jsgtk:155
anonymous@/usr/local/bin/jsgtk:151
evaluateModule@/usr/local/bin/jsgtk:160
load@/usr/local/lib/jsgtk/jsgtk_modules/jsgtk/node_modules.js:130
requireWithPath@/usr/local/bin/jsgtk:173
require@/usr/local/bin/jsgtk:155
anonymous@/usr/local/bin/jsgtk:151
evaluateModule@/usr/local/bin/jsgtk:160
load@/usr/local/lib/jsgtk/jsgtk_modules/jsgtk/node_modules.js:130
requireWithPath@/usr/local/bin/jsgtk:173
require@/usr/local/bin/jsgtk:155
anonymous@/usr/local/bin/jsgtk:159
evaluateModule@/usr/local/bin/jsgtk:160
load@/usr/local/lib/jsgtk/jsgtk_modules/jsgtk/node_modules.js:130
requireWithPath@/usr/local/bin/jsgtk:173
require@/usr/local/bin/jsgtk:155
anonymous@/usr/local/bin/jsgtk:294
evaluateModule@/usr/local/bin/jsgtk:160
load@/usr/local/lib/jsgtk/jsgtk_modules/jsgtk/node_modules.js:130
requireWithPath@/usr/local/bin/jsgtk:173
require@/usr/local/bin/jsgtk:155
anonymous@/usr/local/bin/jsgtk:165
evaluateModule@/usr/local/bin/jsgtk:160
load@/usr/local/lib/jsgtk/jsgtk_modules/jsgtk/node_modules.js:130
requireWithPath@/usr/local/bin/jsgtk:173
require@/usr/local/bin/jsgtk:155
anonymous@/usr/local/bin/jsgtk:165
evaluateModule@/usr/local/bin/jsgtk:160
load@/usr/local/lib/jsgtk/jsgtk_modules/jsgtk/node_modules.js:130
requireWithPath@/usr/local/bin/jsgtk:173
require@/usr/local/bin/jsgtk:155
anonymous@/usr/local/bin/jsgtk:155
evaluateModule@/usr/local/bin/jsgtk:160
load@/usr/local/lib/jsgtk/jsgtk_modules/jsgtk/node_modules.js:130
requireWithPath@/usr/local/bin/jsgtk:173
@/usr/local/bin/jsgtk:199
@/usr/local/bin/jsgtk:243

JS_EvaluateScript() failed
WebReflection commented 7 years ago

Turns out GJS moved faster than JSGtk and there's tons of things that aren't working now in JSGtk land.

I am coding right now on a replacement for JSGtk which is a deprecated/abandoned project at this time, 'cause unsustainable (zero tips/contributors) and it's also too big to be maintained by one person.

I can suggest to use GJS as it is, or wait few days until I've got my new spinning project (very similar, quite a lot of shared code, but cleaner/faster/better core).

Apologies if this was not the answer you were hoping for.

Regards

softwareishappiness commented 7 years ago

Wow such a disappointment well definitely count me in for your upcoming projects I'm certainly interested in contributing

WebReflection commented 7 years ago

Wow such a disappointment

Why are you disappointed?

GJS is now based on SpiderMonkey 52+ which means all the un-maintainable and ultra slow Babel runtime transpilation is not needed anymore, which is already a huge win!

You can extend GTK classes via modern ES2015+ syntax, which is a win.

If you want camelCase namespaces you have already alternatives: https://gist.github.com/WebReflection/c1a438d90708e71cf1f2bd742a721311

And that's also a performance win ... in few words, with current GJS you are by default 10X faster than jsgtk and the only missing thing is the CommonJS compatible env.

I know that's a big gap to fill, but my new project is entirely based on that bit and that bit only, including core modules.

I already have a proof of concept (once you've got the right require.resolve you've got 70% of the issues solved) but I want to do differently this time.

With JSGtk I was supposed to keep updated the whole NodeJS core at once in a different, GLib based, repository, for a language that already has very few contributors.

My plan is to bring gradually the entirety of CommonJS and NodeJS core runtime to GJS without needing to maintain everything at once.

This is also a win for everyone.

TL;DR you should be glad this project is deprecated, it would've been a nightmare for everyone to keep it up to date. Early mistakes, too much excitement ... lesson learned, and ready to move forward in a better way (and without touching GJS since there is interest in core to bring camleCase API already).

I will point at the new project once it's out.

Regards

WebReflection commented 7 years ago

The new project is live and contributors are more than welcome.

https://github.com/WebReflection/cgjs

softwareishappiness commented 7 years ago

Thanks. Looking forward to using CommonJS and NodeJS w/GJS

WebReflection commented 7 years ago

Not NodeJS ... just its API via GJS/GLib/GObject, etc ... which is why I need contributors there

softwareishappiness commented 7 years ago

The reason I wanted to use jsgtk was because I thought I would be able to create a Gnome application using GJS and leverage NodeJS modules. Is this not your goal?

WebReflection commented 7 years ago

Yes, that's the goal. Using GJS and npm modules.

That's still technically different from using NodeJS :wink:

softwareishappiness commented 7 years ago

Okay, great. Thanks :+1: