Skip to content

Conversation

@stof
Copy link
Member

@stof stof commented Mar 13, 2021

This restores backward compatibility on the compile() method by keeping a string return value.
The modern API using a CompilationResult object is now available through compileString instead. This modern API does not write the sourcemap to the filesystem when configuring an external sourcemap. This is expected to be done by the caller (similar to the fact the CSS is not written to disk). However, the sourcemap comment is present in the CSS.

Closes #320

This restores backward compatibility on the compile() method by keeping
a string return value.
The modern API using a CompilationResult object is now available through
compileString instead. This modern API does not write the sourcemap to
the filesystem when configuring an external sourcemap. This is expected
to be done by the caller (similar to the fact the CSS is not written to
disk). However, the sourcemap comment is present in the CSS.
@stof stof force-pushed the refactor_compile branch from 3061080 to 3280a3b Compare March 14, 2021 22:35
*
* @throws SassException when the source fails to compile
*/
public function compileString($source, $path = null)
Copy link
Member Author

Choose a reason for hiding this comment

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

I named the parameter source rather than code, as I think that's a better name for what it is. However, note that I'm not considering parameter names as covered by backward compatibility yet. I haven't reviewed the full codebase regarding names. So using PHP 8 named parameters is still something downstream projects will do at their own risk.

@stof stof merged commit dee0700 into scssphp:master Mar 18, 2021
@stof stof deleted the refactor_compile branch March 18, 2021 18:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[RFC] Refine the compilation API

1 participant