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

nanoc 3.6.6 not compile my scss files #350

Closed
phklevets opened this Issue Nov 17, 2013 · 11 comments

Comments

Projects
None yet
4 participants
@phklevets

phklevets commented Nov 17, 2013

nanoc 3.6.5 - all work fine
nanoc 3.6.6 - not work, in console I get message "INFO - Compilation succeeded.", but result .css file not refreshed

@Leolik

This comment has been minimized.

Show comment
Hide comment
@Leolik

Leolik commented Nov 17, 2013

+1

@ddfreyne

This comment has been minimized.

Show comment
Hide comment
@ddfreyne

ddfreyne Nov 17, 2013

Member

Can either of you provide a sample site that exhibits this problem?

Member

ddfreyne commented Nov 17, 2013

Can either of you provide a sample site that exhibits this problem?

@ddfreyne

This comment has been minimized.

Show comment
Hide comment
@ddfreyne

ddfreyne Nov 27, 2013

Member

@phklevets @Leolik I’m unable to reproduce this problem. Do you have a sample site that illustrates the problem?

Member

ddfreyne commented Nov 27, 2013

@phklevets @Leolik I’m unable to reproduce this problem. Do you have a sample site that illustrates the problem?

@Leolik

This comment has been minimized.

Show comment
Hide comment
@Leolik

Leolik Nov 29, 2013

a problem in nesting import scss files
you can check https://bitbucket.org/leolik/my_nanoc_default/src

  1. clone git repository
  2. start project bundle exec guard or ./run.sh
  3. for example, create new file content/scss/blocks/_b-test.scss with content:
.b-test {
  width: 100%;
}
  1. add:
@import "blocks/b-test";

to the content/scss/screen/_home.scss
5) save created _b-test.scss file and after try add/remove some css options in this file. In console you will see only 12:03:12 - INFO - Compilation succeeded., but style.css file not will be updated with new styles. If you add/remove some css options in _home.scss file, style.css will be updated correctly. _home.scss imported in style.scss.
Problem reproduced only in nanoc 3.6.6, in <=3.6.5 - all work correctly.
P.S. Sorry for my English.

Leolik commented Nov 29, 2013

a problem in nesting import scss files
you can check https://bitbucket.org/leolik/my_nanoc_default/src

  1. clone git repository
  2. start project bundle exec guard or ./run.sh
  3. for example, create new file content/scss/blocks/_b-test.scss with content:
.b-test {
  width: 100%;
}
  1. add:
@import "blocks/b-test";

to the content/scss/screen/_home.scss
5) save created _b-test.scss file and after try add/remove some css options in this file. In console you will see only 12:03:12 - INFO - Compilation succeeded., but style.css file not will be updated with new styles. If you add/remove some css options in _home.scss file, style.css will be updated correctly. _home.scss imported in style.scss.
Problem reproduced only in nanoc 3.6.6, in <=3.6.5 - all work correctly.
P.S. Sorry for my English.

@Leolik

This comment has been minimized.

Show comment
Hide comment
@Leolik

Leolik Nov 29, 2013

I think I understand what the problem. You something change with scss(sass) file paths. If use my example from previous comment and change

@import "blocks/b-test";

to the

@import "../blocks/b-test";

nanoc 3.6.6 compile style.css correctly.

But compass and sass applications works correctly with relative paths and absolute paths from the scss(sass) root, nanoc 3.6.6 not work with absolute paths from the scss(sass) root (( I think it's a bug, because, for using nanoc 3.6.6 need change paths for scss files in all projects, where using absolute paths ((

Leolik commented Nov 29, 2013

I think I understand what the problem. You something change with scss(sass) file paths. If use my example from previous comment and change

@import "blocks/b-test";

to the

@import "../blocks/b-test";

nanoc 3.6.6 compile style.css correctly.

But compass and sass applications works correctly with relative paths and absolute paths from the scss(sass) root, nanoc 3.6.6 not work with absolute paths from the scss(sass) root (( I think it's a bug, because, for using nanoc 3.6.6 need change paths for scss files in all projects, where using absolute paths ((

@ddfreyne

This comment has been minimized.

Show comment
Hide comment
@ddfreyne

ddfreyne Nov 29, 2013

Member

Ah, yikes. I’ll fix this ASAP, probably this weekend (or if you want to take a stab at fixing it, you can! PRs are definitely welcome). In the mean time, you can stick to nanoc 3.6.5. Sorry for the inconvenience.

Member

ddfreyne commented Nov 29, 2013

Ah, yikes. I’ll fix this ASAP, probably this weekend (or if you want to take a stab at fixing it, you can! PRs are definitely welcome). In the mean time, you can stick to nanoc 3.6.5. Sorry for the inconvenience.

@ddfreyne

This comment has been minimized.

Show comment
Hide comment
@ddfreyne

ddfreyne Dec 1, 2013

Member

After a bit more research, I found that the problem existed in 3.6.5 but was masked by the fact that the Sass filter generated superfluous dependencies. With these superfluous dependencies gone, the Sass filter no longer works properly.

nanoc has a Sass::Importers::Filesystem subclass that registers @imported files, but in the test case this importer finds no files to import, yet Sass compiles just fine. Weird. Needs more research.

Member

ddfreyne commented Dec 1, 2013

After a bit more research, I found that the problem existed in 3.6.5 but was masked by the fact that the Sass filter generated superfluous dependencies. With these superfluous dependencies gone, the Sass filter no longer works properly.

nanoc has a Sass::Importers::Filesystem subclass that registers @imported files, but in the test case this importer finds no files to import, yet Sass compiles just fine. Weird. Needs more research.

@ddfreyne

This comment has been minimized.

Show comment
Hide comment
@ddfreyne

ddfreyne Dec 5, 2013

Member

Some observations:

  • I tried overriding Sass::Importers::Filesystem's #_find method in my subclass that records @include’d filenames, but even if #_find returns nil, Sass somehow still finds the right files to include.
  • If neither #find_real_file nor #possible_files seem to return anything, Sass also finds the right files to include.
  • Sass.load_paths seems to be empty in #_find.

I’m likely hooking into the wrong thing here. I specify :filesystem_importer in the options passed to Sass::Engine.new; is this the right thing to do? Does Sass fall back to a default importer if the specified filesystem importer does not find anything?

Member

ddfreyne commented Dec 5, 2013

Some observations:

  • I tried overriding Sass::Importers::Filesystem's #_find method in my subclass that records @include’d filenames, but even if #_find returns nil, Sass somehow still finds the right files to include.
  • If neither #find_real_file nor #possible_files seem to return anything, Sass also finds the right files to include.
  • Sass.load_paths seems to be empty in #_find.

I’m likely hooking into the wrong thing here. I specify :filesystem_importer in the options passed to Sass::Engine.new; is this the right thing to do? Does Sass fall back to a default importer if the specified filesystem importer does not find anything?

@Leolik

This comment has been minimized.

Show comment
Hide comment
@Leolik

Leolik Dec 6, 2013

Maybe @chriseppstein from Sass team help us?

Leolik commented Dec 6, 2013

Maybe @chriseppstein from Sass team help us?

@chriseppstein

This comment has been minimized.

Show comment
Hide comment
@chriseppstein

chriseppstein Dec 6, 2013

Contributor

The :filesystem_importer option is used to transform strings passed in the :load_paths array into importer objects. So an existing importer object on the load_path could potentially find this file without the tracking you need. This is particularly likely if you are using compass.

For your use case, I suggest that you extend the existing Sass filesystem importer class with some meta-programming instead of replacing the importer class in the options.

FWIW, I recently accepted a pull request to compass that respects the :filesystem_importer option :) Compass/compass@7c50b90

Contributor

chriseppstein commented Dec 6, 2013

The :filesystem_importer option is used to transform strings passed in the :load_paths array into importer objects. So an existing importer object on the load_path could potentially find this file without the tracking you need. This is particularly likely if you are using compass.

For your use case, I suggest that you extend the existing Sass filesystem importer class with some meta-programming instead of replacing the importer class in the options.

FWIW, I recently accepted a pull request to compass that respects the :filesystem_importer option :) Compass/compass@7c50b90

@ddfreyne

This comment has been minimized.

Show comment
Hide comment
@ddfreyne

ddfreyne Dec 9, 2013

Member

Fixed by #370.

Member

ddfreyne commented Dec 9, 2013

Fixed by #370.

@ddfreyne ddfreyne closed this Dec 9, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment