-
-
Notifications
You must be signed in to change notification settings - Fork 250
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
Don't pass source-map param if disabled for Scss #994
Conversation
Don't pass source-map param if disabled for Scss
madskristensen#994 is duplicate of madskristensen#844 and its wrong. This PR reverts it back. We are creating source map for both LESS and SASS regardless of settings. We are using these interim maps for editor enhancements. We extract out Base-64 VLQ values, decode it and use that info for features which require source-to-source mapping context (see madskristensen#787). After parsing map files & extracting the desired info, the map-file is deleted; if generate-map option is disabled.
Seems like the wrong way to go about it as this would only give you editor enhancement features on what you had last saved. Any changes (until save) wouldn't have these feature and would also cause .map files to not map correctly to their corresponding files. |
This is the limitation we have in every node-depended feature in W.E. For instance, you have a variable in a LESS/SCSS selector which depends on another variable which is defined in some import file. This kind of context can only be resolved by the compiler. In order to preview, you need to save the file. Even on opening the source file, we also compile once to get the latest bits. With or without sourcemaps is not the catch here and it is not burdening the process. For the other point that its not a good idea; then we would need to implement native compilers LESS, SASS, CoffeeScript, LiveScript etc. to perform quick compile in real time. Since the specs for all those technologies are changing rather rapidly (adding/dropping features every week), its way beyond the scope of Web Essentials. Also, the node-based compilation is extremely expensive for a keystroke change. Perhaps a node-based compilation service could be the solution to such problems. See #381; we are still waiting for more feedback to finalize its architecture. |
To add more context, I did this pull request to prep for integrating Autoprefixer. I have it mostly working, however since Autoprefixer post-processes the CSS files it runs into issues due to files being locked while the sourcemap comment is being removed. I would love to discuss more so we can get Autoprefixer added. I will add my working branch soon so you can check it out. |
@tysonmatanich, this is an awesome idea! There are couple of moving parts here. Lets start with how can we go about implementing Starting by removing this outdated comment on CssCompilerBase.cs Line 21, after line 22; we can add another method This way we can avoid File I/O deadlocks (for this particular feature). Other considerations: There occur quite a number of file I/O ops on compilation. For that matter I used Microsoft Enterprise library (see #909) to consume retry policy. There were still issues reported afterwards that even after a fair number of retries it still throw "file in use" exception. So I changed it to keep trying indefinitely #981, assuming in extremely edge case scenario it would throw StackOverFlow which we will catch later (once we get hands on reproduction steps). Surprisingly, today we get other reports saying its still throwing FileInUseException #1013 and other reporting FileNotFound exception causing VS crash and that attaching debugger slows down #1011. I made a minor change 3c98e55 putting limit on re-retry. Yet @ghorsey (via #1013) reported that issue still persists. Reminds me of @jaredpar's quote: "The file system is the enemy of reliable programs." 😄 Some of such issues are way too subjective and needs detailed reproduction steps. We thought making "Contribution guidelines" would improve the quality of feedback, but still getting wooly details. So, after TIA. |
madskristensen#994 is duplicate of madskristensen#844 and its wrong. This PR reverts it back. We are creating source map for both LESS and SASS regardless of settings. We are using these interim maps for editor enhancements. We extract out Base-64 VLQ values, decode it and use that info for features which require source-to-source mapping context (see madskristensen#787). After parsing map files & extracting the desired info, the map-file is deleted; if generate-map option is disabled.
Thanks for your feedback. I just submitted a pull request #1054 |
No description provided.