Skip to content

feat(builder): broccoli bump to 1.0 #299

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

Closed
wants to merge 1 commit into from

Conversation

jkuri
Copy link
Contributor

@jkuri jkuri commented Mar 12, 2016

I rewritten TypeScript Broccoli Plugin to be compatible with Broccoli 1.0.
According to my tests builds are now ~50% faster.
I also added SASS and LESS plugins which works right off (SASS needs gem install sass) and they work with encapsulation.

@filipesilva
Copy link
Contributor

I was under the impression that these files were compiled versions of the ones present in https://github.com/angular/angular/tree/master/tools/broccoli .

If that is so, then we shouldn't alter them ourselves. @hansl, do you have some more context on this?

@jkuri
Copy link
Contributor Author

jkuri commented Mar 13, 2016

They are in the current master. I made some investigation on this as I did have feeling that this could work faster than 114ms per changed single file. I found out that some plugins (really complex ones) are not needed in 1.0 version of broccoli anymore (in my opinion) and these are the ones that are slowing down the compile/build time.
With this I got approximately 62ms build time per changed file, sort of like plain tsc.
I will not be offended if this is not going to be merged although I spend some time with this, just wanted to show what can be done with more simple approach comparing changed files. It isn't the more complex way always the best way, I think.
Did you try using this Filipe?

@filipesilva
Copy link
Contributor

I did not try using it, no.

I was just going through the files on a top level review and remembered that we had problems with past PRs that changed them because they came from another repo, so I thought I should mention it. See #206 (comment)

I usually steer clear of those, because personally I do not understand them very well.

@jkuri
Copy link
Contributor Author

jkuri commented Mar 13, 2016

I actually rewrite this specifically for our needs and did use some code from current one.
Lets see what Hans and Igor will say about this. In the meantime (when you will have time) please try this.. any feedback is welcome.

@jkuri jkuri force-pushed the broccoli-1.0beta branch 8 times, most recently from bd03f24 to d9646fe Compare March 14, 2016 05:00
@filipesilva
Copy link
Contributor

@jkuri had me in a videocall and stuff looked nice!

For me the most relevant bits were:

  • docs for the old brocolli version are out of date/unexisting
  • optional sass/less support without anything else done

Tbh if we can have sass/less without the user having to do anything (like ng install sass) and without overheads, I don't see why have them jump through hoops.

Still worried about desync'ing these files from the main angular repo. Also if we just abandon that build step, perhaps it's better to move to a different build system altogether. Dunno.

@hansl needs your input on this

@jkuri
Copy link
Contributor Author

jkuri commented Mar 16, 2016

@hansl I would appreciate your opinion on this, when you will have time please ping me on slack.

@zackarychapple
Copy link
Contributor

I want to echo @filipesilva on the worries as well as the need for a different build system. This discussion around builds and feature enhancements. Having a build system, particularly one that is extensible is going to be critical to the CLI.

@jkuri
Copy link
Contributor Author

jkuri commented Mar 16, 2016

Maybe, but any "node package" aka compiler/preprocessor can be reworked as a broccoli plugin so I don't see a blocker here. I like the performance and I will advocate broccoli here as I think that is not possible to achieve better build times with anything else, at most equal. So, my vote goes to broccoli.

@zackarychapple
Copy link
Contributor

So maybe we need a Broccoli equivalent of DefinitelyTyped where we wrap packages we want to use or others want to use in a Broccoli friendly way.

@jkuri
Copy link
Contributor Author

jkuri commented Mar 16, 2016

You mean 3rd party packages? I am working on that right now with ng install command.
Otherwise, we'll move to webpack after the ng-conf if I remember correctly.

@filipesilva
Copy link
Contributor

We definitely don't want to go down the angular-* approach to packages though. That's a problem with Angular 1 at the moment that we've talked about avoiding.


let trees = [vendorNpmTree, assetTree, tsNodeTree, jsTree, this.index()];

if (require.resolve('node-sass') && sh.which('sass')) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So you're hard coding sass/less? What if the user wants to use Compass?

@hansl
Copy link
Contributor

hansl commented Mar 16, 2016

This PR is crazy; please reduce it to moving Broccoli to version 1, and remove the rest. We already want to cover SASS/LESS with ng install, there's no need for this.

@jkuri
Copy link
Contributor Author

jkuri commented Mar 16, 2016

crazy :-) ok, will do.

@jkuri jkuri force-pushed the broccoli-1.0beta branch from d9646fe to 450b5cf Compare March 16, 2016 19:51
@jkuri jkuri changed the title feat(builder): broccoli bump to 1.0 + LESS & SASS Plugins feat(builder): broccoli bump to 1.0 Mar 16, 2016
@jkuri jkuri force-pushed the broccoli-1.0beta branch from 450b5cf to c0fc136 Compare March 16, 2016 20:01
const Funnel = require('broccoli-funnel');
const mergeTrees = require('broccoli-merge-trees');
const ts = require('./broccoli-typescript');
const sass = require('./broccoli-sass');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requires not needed anymore.


const assetTree = new Funnel(src, {
include: ['**/*.*'],
exclude: ['**/*.ts', '**/*.js', '**/*.scss', '**/*.sass', '**/*.less'],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For now, just exclude ts, js and css.

@hansl
Copy link
Contributor

hansl commented Mar 17, 2016

You need to fix references to the broccoli stuff from the scaffold.

@jkuri
Copy link
Contributor Author

jkuri commented Mar 17, 2016

Thanks, I would forgot this.

On Thursday, 17 March 2016, Hans [email protected] wrote:

You need to fix references to the broccoli stuff from the scaffold.


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#299 (comment)

@@ -42,6 +42,7 @@
"lodash": "^4.6.1",
"resolve": "^1.1.7",
"shelljs": "^0.6.0",
"multidep": "^2.0.0",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not needed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is used by broccoli 1.0 for installing additional plugins. Does not work without that for me.

@hansl
Copy link
Contributor

hansl commented Mar 21, 2016

Unfortunately closing this in favor of #332. It's just really inconvenient for me to push to a branch forked on jkuri's account, so instead I'll just make a new PR.

@hansl hansl closed this Mar 21, 2016
@jkuri jkuri deleted the broccoli-1.0beta branch April 3, 2016 00:06
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants