The purpose of this document is to help migrate projects using Stylable to
We have taken the opportunity of node dropping LTS support for
v12 and we have decided to include a number of additional breaking changes to the
v5 release. These changes are primarily to the programmatic API of Stylable and not to user facing features, syntax or integrations.
You can find the plan for this major version here.
All diagnostics in
@stylable/core had diagnostics code added, and were reviewed for consistency. Many diagnostics have had their severity increased to
We plan on starting to map out the diagnostics in this site to help users understand what they are seeing, and why it happened.
Reducing public facing APIs
In the past, Stylable exposed all of its functionalities as public facing APIs. Over time, this has proven difficult to maintain and develop further, and so we have decided to limit what Stylable exposes, and to segment its APIs under a few different namespaces.
In addition, most APIs have been refactored to match our new programmatic API model.
The following APIs have been changed:
- The Stylable constructor now accepts options as an object (similar to
The following APIs have been removed:
Stylable.create()method has been removed
StylableTransformeris no longer considered public API, there relevant functionality has been moved to
- custom pseudo state parameter type
taghas been removed - can be replaced by
-st-states: stateName(string)(see issue)
If we have removed an API that you have found useful, and provided no alternative, please let us know by opening an issue over at GitHub.
Default arguments changed
stc command now has no default output defined, previously this was set to emit
- If you were using the
stccommand without the
--cjsflag, you will need to update your code to use the new default output
- If were explictly setting the output to not emit
--cjs=false), you can now remove this parameter from your command
Build index file and other outputs simultaneously
stc command now supports building an indexFile and other outputs (
.st.css, etc.) at once.
- If you were previously running separate commands to build the index file and other outputs, you can now run a single command to build them all at once