Closed siavolt closed 8 years ago
this breaks compatibility with native node modules, which is basically the reason babel standalone was introduced. I'm interested about your performance issue findings, so far the main killer is the runtime gir-to-js scanner wheneer you require('Gtk')
or others, where Gtk
is probably the most expensive namespace.
I cannot lazy load the namespace for the simple reason some signal might send unknown, no npatched, types at any time.
But if you dont you use this optional flag, you dont have any problem with compatibility. If a developer uses this flag, he knows what he is doing. For example, in my case i create project build with all needed babel plugins, and after this i dont need do transpiling again.
my webpack config:
const query = {
babelrc: false,
plugins: [
'transform-class-properties',
'syntax-flow',
'transform-flow-strip-types',
'transform-es2015-object-super',
'transform-es2015-classes',
'syntax-async-functions',
'transform-regenerator'
]
};
module.exports = {
entry: './src/client/app.js',
output: {
path: process.cwd(),
filename: './builds/ui.js',
library: true,
libraryTarget: 'commonjs2'
},
module: {
loaders: [ {
test: /\.js$/,
loader: 'babel',
exclude: [/node_modules/, /public/],
query: query
}
{ test: /\.json$/, loader: 'json-loader' } ]
},
externals: {
GLib: 'GLib',
Gio: 'Gio',
Gtk: 'Gtk',
Gdk: 'Gdk',
GObject: 'GObject',
fs: 'fs',
Soup: 'Soup'
}
};
I need to rethink the patch anyway because it causes internal inconsistencies. You use webpack but that's not what everyone else is doing (i.e. I don't) so I'll implement the flag but I won't merge this PR because it's too dirty (it also search runtime each time ARGV entries)
actually I have a question: how can you be sure that fs
module, in your externals, doesn't need to be transpiled?
FS work fine now, but i agree maybe for other modules need transpiling.
About PR, agree, we can make this better.
Thank for you response!
please try 0.11.0
and let me know if it works. The flag is --no-transform
since transform
is the actual operation that Babel, in this case but it could be another transformer, does.
Hope it works.
Yes, it works. But i test 0.11.0 version with
ARGV.some(arg => arg === '--no-transform')}
And I could not understand what the problem is =) Now all is perfect. Thanks!
Hi. This option needed when you use babel transform before run application with jsgtk. So you save a lot of time to run.