-
Notifications
You must be signed in to change notification settings - Fork 215
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Architecture questions #18
Comments
It's possible to make a linting plugin that returns its input tree (so it's a no-op), but if it encounters linting errors it either prints a warning or fails the build. In dev mode, it seems that failing on linting errors is not a good strategy - as I refactor or debug code, I'll often have intermediate code that doesn't pass JSHint but that I still want to run. So I'm wondering if linting generally just belongs at the end of the test suite, and shouldn't be part of the build process. If linting were done by a Broccoli plugin, we'd have the advantage that we can cache lint results quite easily, so we'd get constant-time (near-instantaneous) linting. JSHinting the Ember sources (87 KLOC) takes 10 seconds, so it can be a worthwhile optimization. I'm really unsure.
Maybe. Node-task and vinyl (which I believe derives from node-task) both use in-memory representations, which I'm not a fan of. That said, Broccoli's plugin API is quite simple, and it could conceivably be shared with other build systems, or you could build broccoli adapters for other build systems. I'm happy to coordinate with other build tool authors. (If necessary, we can even rename the plugin API spec to something that doesn't have "broccoli" in its name.)
I don't have any plans for logging in Broccoli so far. (Of course you can do console.error or load your own logging library.) Can you elaborate what you need it for? And do you think it should live in Broccoli core? |
Leaving logging completely up to the individual tasks makes things like standard logging vs. verbose logging difficult to manage. Verbose logging has been really helpful while developing and debugging complex tasks. |
Chat with @scottgonzalez. Re logging: Jo Liss: Re https://github.com/joliss/broccoli/issues/18#issuecomment-35437425 , is this about developing tasks (plugins), or writing/debugging build definitions? Re linting: Scott González: The linting issue is interesting as well. |
The approach we're planning on using in Ember is hierarchical logging namespaces ( For example, you could imagine a listener that collects up every transition, and then sends the user's path through the app to the server together with any errors that it sees. We're planning on having a nice logging pane in the Ember inspector that makes use of this infrastructure; it would make sense for it to be available standalone to non-Ember users as well who use any of the many libraries in the Ember ecosystem that make use of the logger. |
For reference, some related discussion on linting in ember-cli/ember-cli#36. |
@cowboy Do you feel like weighing in here? |
I ask because I know you've spent a TON of time thinking about this problem. |
I've spent a ton of time thinking about the logging problem, and it's not the easiest one to handle. All plugins of a certain type should have a standard API for logging, but I'm not 100% sure what that should be. It could be an event emitter or logging methods. The latter most likely just being a basic abstraction around the former. Regardless of the implementation, I like these logging levels:
I don't think there should be an I've been toying with the idea of a "progress" abstraction, but haven't had time to get into it lately. Either way, that could just be another thing that gets logged, maybe at the And, of course, the thing running the plugin should listen for these events and actually log the provided messages in a sane way. |
I have some questions about the plans for architecture that the 0.1.0 blog post doesn't cover (or I missed it):
The text was updated successfully, but these errors were encountered: