The first 2.0.0 beta release is available from two download sites:- https://github.com/css4j/css4j-dist/releases/download/css4j-2.0.0-beta1/css4j-2.0.0-beta1.zip
- https://sourceforge.net/projects/carte/files/css4j/milestone/css4j-2.0.0-beta1.zip/download
I was doubting about calling it alpha1 or beta1, in any case the intention is the same: to release pre-2.0 code so people can start writing code for it. API changes in 2.0 are still possible but are likely to be small, as opposed to the differences between 1.0 and 2.0 which are huge.
So the 2.0 API is not fully backwards-compatible with 1.0, especially if you use the CSSValue or the NSAC 1 APIs. Backwards incompatibility is always a bad thing, but while NSAC 1 was a good interim solution providing more-or-less compatibility with old SAC parsers (to the point that to parse CSS2.1 they were dynamically interchangeable with NSAC by just changing a system property), it was otherwise difficult to use with today's CSS. Similar concerns apply to the deprecated CSSValue API.
A change was needed, and I believe that the result is much more pleasant to use. (note: I plan to submit a Pull Request to downstream XWiki project as soon as final 2.0.0 is out, with the necessary changes).
This excerpt from the Release Notes adds more information:
It is the first beta of the 2.0 (master) branch, looking forwards a final 2.0.0
release in December 2019. Features NSAC 2.0 and a new Object Model Value API; it
is not backwards-compatible with 1.0, but the new 2.0 APIs are more appropriate
to deal with modern CSS. Any new development should use the 2.0 API (and hence
the interest in releasing it as soon as possible).
NSAC 2.0 no longer inherits from stuff in the org.w3c.css.sac package (provided
by the -not needed anymore- sac.jar file) but is an independent API, with its
methods and features being sort of an hybrid between the old SAC and newer code.
Some interfaces have changed significantly, and the usage of the InputSource
class was reduced and is discouraged (a Reader is being used instead).
Of course this means that other SAC parsers are not supported, which may seem a
loss of flexibility. However, the other parsers are stuck with CSS2 (or partial
support for CSS3) and weren't really usable for real-world sheets. Without the
need to support other SAC parsers, code can be cleaner and is less error-prone
(other parser projects would be welcome to implement NSAC 2 if they wanted to).
The new Value API still uses the interface names CSSValue and CSSPrimitiveValue
but adds others like CSSTypedValue. In the end, its usage is somewhat different
to the old (and deprecated) W3C CSSValue API, requiring almost no type casts to
obtain information to make decisions about value handling (type casts are only
required when retrieving the actual encapsulated value). The categorization of
values is different, and the dimension units are shared with NSAC 2.0 from a
common source interface. But some methods have names similar to the old API to
ease the transition (for example I keep getCssValueType() to retrieve the value
category, instead of a more proper getCategory()).
Another important change is that the source-level compatibility is now for Java
version 8 instead of 7. Comments about the new APIs are welcome.
Many 2.0 patches do not apply to 1.0 which makes it difficult to maintain. As a
consequence, the end of life for 1.0.x would happen relatively early in 2020
unless somebody volunteers for maintaining it (which would probably be a waste
of time).
If you are writing new code and need help with 2.0, please use this forum.