akveo / nebular

:boom: Customizable Angular UI Library based on Eva Design System :new_moon_with_face::sparkles:Dark Mode
https://akveo.github.io/nebular
MIT License
8.06k stars 1.51k forks source link

Compilation of Nebular theme is too slow #2031

Open mathisGarberg opened 5 years ago

mathisGarberg commented 5 years ago

Issue type

I'm submitting a ...

Issue description

I'm recently upgraded from Nebular v. 3.5 > v.4.4 and Angular v. 7.4 > 8.2. The migration went well, and everything is currently sat up and working. The problem I'm experiences has too to do with the compilation time of the Nebular theme(s). When adding it, the compiler stops for about 10-20 seconds before continuing, a time-span that reduces productivity across the team.

compilation-time-nebular-theme-issue

Expected behavior: The compilation time of the Nebular theme(s) should be more or less fluent.

Steps to reproduce: The reproduction of the problem has the minimum requirement for a Nebular application with two themes. When cloning the repository and running npm start, you will see the compilation of the application is stopping when it hits the styles.scss file.

You can view the entire application setup at the following GitHub repository.

Other information:

-------------------------------
"@angular/animations": "~8.2.7",
"@angular/cdk": "^8.0.0",
"@angular/common": "~8.2.7",
"@angular/compiler": "~8.2.7",
"@angular/core": "~8.2.7",
"@angular/forms": "~8.2.7",
"@angular/platform-browser": "~8.2.7",
"@angular/platform-browser-dynamic": "~8.2.7",
"@angular/router": "~8.2.7",
"@nebular/eva-icons": "4.4.0",
"@nebular/theme": "^4.4.0",
"@nebular/date-fns": "4.3.1",

Note: If you want me to provide any further information, please let me know.

armoucar commented 5 years ago

Yep, I just started a new Angular project, only added nebular & started a new custom theme.

It takes about 20 seconds to build the scss, each time I save a file. Computer I'm working has a pretty good hardware configuration, so I don't think it's because of it.

sazalihisham88 commented 4 years ago

Any workaround for this?

armoucar commented 4 years ago

I put together the smallest part of something I'm doing at work, maybe you can find some utility in it.

https://github.com/armoucar/nebular-custom-theme

I could get it running faster this way. But I still want to take a look and see if I can do the same sass compilation process in the Nebular getting started project.

$ time gulp sass:themes
Using gulpfile ~/dev/workspace/nebular-custom-theme/gulpfile.js
Starting 'sass:themes'...
Finished 'sass:themes' after 2.46 s
gulp sass:themes  2.84s user 0.11s system 101% cpu 2.906 total

$ time gulp sass:themes
Using gulpfile ~/dev/workspace/nebular-custom-theme/gulpfile.js
Starting 'sass:themes'...
Finished 'sass:themes' after 2.47 s
gulp sass:themes  2.86s user 0.11s system 101% cpu 2.921 total
Gonoshift commented 4 years ago

Fiddling with Nebular at the moment and I've noticed that a big slowdown while compiling scss is still present, there's no way to speed it up? It makes you waste like 20 seconds for every single change, at the end of the day seconds become hours!

wadinj commented 4 years ago

This issue should be re-open. I still have the issue with the current version (about 30s for. each change in the theme style)

wadinj commented 4 years ago

Hi,

Does anyone found a workaround to this ?

jboucly commented 4 years ago

News ? I just started on Nebular for a personal project and compare to my pro projects under Ng-Zorro (less) the compilation takes minimum 10min before starting the server :sob:

Octopixell commented 3 years ago

So I just noticed this same issue and I am wondering if it's possible to speed this up? Almost seems like a better idea at this point to pre-compile Nebular and simply load the result while not having it being compiled every change?

Perhaps someone by now has found a workaround?

VincentPeraud commented 3 years ago

Hi, I found a workaround, enable css custom properties in your themes.scss file and compilation time will reduce to a few seconds

image

jboucly commented 3 years ago

Hi, I found a workaround, enable css properties in your themes.scss file and compilation time will reduce to a few seconds

image

I confirm it speeds up a bit thank you ! :pray:

cgcdoss commented 8 months ago

Hi, I found a workaround, enable css custom properties in your themes.scss file and compilation time will reduce to a few seconds

image

Really worked. Thank you. However I'd like to know what disadvantages this could cause in my project. Perhaps a larger styles.scss file?