You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 27, 2019. It is now read-only.
Repository navigation
This repository was archived by the owner on Mar 27, 2019. It is now read-only.
I'd like to add the feature of syntax error checking to component build. If any of the components have a syntax error, it would error out. Had a look at the code and it seems the proper place to put it would be component-builder. However, component itself isn't linking to the latest version of builder, see here. When I tried to update component to point to builder's latest, I got this error
/Users/airportyh/Home/Code/component/bin/component-build:77
builder.copyAssetsTo(program.out);
^
TypeError: Object #<Builder> has no method 'copyAssetsTo'
at Object.<anonymous> (/Users/airportyh/Home/Code/component/bin/component-build:77:9)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:902:3
Not sure which route to pursue. Please help point me in the right direction.
Adding a linter builder plugin could make the most sense for this I think. That way it could just pick up a bunch of different things including syntax errors.
oh yeah. i run lint in a separate process on every build. it's super slow though - 50ms builds and 2.5s lint? which is why i don't run lint in the same process as the builder and don't really want to advocate putting it in the builder (unless someone makes it really fast with caching n stuff, though i lint my server-side js at the same time for the hell of it)
Syntax error checking can actually be done fast w/o using Esprima - by executing the script and then checking if a syntax error was thrown, see syntax-error. This is what's being done in browserify, and is indeed fast (I've some experience doing perf tuning in browserify recently). I can put in some benchmarks to prove it if needed. I think this is a nice improvement in UX w/o performance penalty.
@visionmedia so new development should be done on 0.10.x branch? are there plans to upgrade component to the latest of builder?
Activity
anthonyshort commentedon Feb 14, 2014
Adding a linter builder plugin could make the most sense for this I think. That way it could just pick up a bunch of different things including syntax errors.
jonathanong commentedon Feb 14, 2014
i'm not sure how to do this without actually parsing the javascript with esprima or jshint or something, which would make builds VERY SLOW.
would be better as a plugin for now, then we can think about adding it once it's working well
anthonyshort commentedon Feb 14, 2014
or something.
jonathanong commentedon Feb 14, 2014
oh yeah. i run lint in a separate process on every build. it's super slow though - 50ms builds and 2.5s lint? which is why i don't run lint in the same process as the builder and don't really want to advocate putting it in the builder (unless someone makes it really fast with caching n stuff, though i lint my server-side js at the same time for the hell of it)
tj commentedon Feb 14, 2014
I pretty much never lint haha, IMO this more of a CI / editor feature. it could be a plugin for component but definitely not core
tj commentedon Feb 14, 2014
@airportyh as far as your issue goes, use the 0.10.x releases of builder
airportyh commentedon Feb 15, 2014
Syntax error checking can actually be done fast w/o using Esprima - by executing the script and then checking if a syntax error was thrown, see syntax-error. This is what's being done in browserify, and is indeed fast (I've some experience doing perf tuning in browserify recently). I can put in some benchmarks to prove it if needed. I think this is a nice improvement in UX w/o performance penalty.
@visionmedia so new development should be done on 0.10.x branch? are there plans to upgrade component to the latest of builder?
tj commentedon Feb 15, 2014
yup we want to upgrade eventually but we need some more breaking changes to 0.12.x
ericgj commentedon Feb 15, 2014
👍 it would be nice to use something like this as a plugin in the new builder API.