-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Make loaded_files available for failed compilations #3577
Comments
Adding context here, since this seems to be the correct place / upcoming discussion. nex3:
my response:
|
I'll add a bit more info - I tried both Importer and FileImporter and I even debugged a bit on the sass host and it does not even receive a message about files that can be resolved without assistance. The intent seems to be that the importer is only for non standard imports. This behavior seems to match the spec as well, notice how importers trigger after the normal resolution did not return null. https://github.com/sass/sass/blob/main/spec/modules.md#loading-a-source-file |
As this protocol is internal between host and compiler and not visible to end users, making breaking changes only impacts a very small group of developers and does not impact end users. Therefore, I'd rather just take the breaking change and go to protocol 2.0 if necessary. |
The key point here is "normal means"—if you run all imports exclusively through a custom importer, without using a filesystem importer or any load paths, the importer will have full control and visibility into all loads. (Although the cost of this is that you then need to manually reimplement all the filesystem loading logic.)
All right, then let's make this 2.0 once it releases. |
For hosts implementing filesystem watcher APIs, it's important to know which files to watch when determining when to retry a compilation. The
CompileSuccess.loaded_urls
field exposes this information, but it's not available for failed compilations which leaves hosts unable to determine what to watch if the initial compilation fails. We should move it toCompileResult.loaded_urls
(although for backwards compatibility we should leaveCompileSuccess.loaded_urls
as well).The text was updated successfully, but these errors were encountered: