-
Notifications
You must be signed in to change notification settings - Fork 311
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
Fix broken --precompiledLib switch #3817
Fix broken --precompiledLib switch #3817
Conversation
while I'm here, maybe it makes sense to separate part of Fable.AST module that meant to be json-serializable from everything else? How to? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@DunetsNM Please keep in mind that any Fable AST change is a breaking change for plugins so it requires a major version update.
@ncave Should I change the version in Fable.AST.fsproj right in this PR ? Judging by history version increases committed separately / along with releases If it has to be in this PR , I suppose we keep major version at 4 (as it seems to be anchored to Fable 4 ?) i.e. 4.4.0 => 4.5.0 ? Again, here I assume that based on previous history (quick search reveals examples of technically breaking changes that were not versioned by a strict SemVer e.g. see diff between "Release 3.7.1" and "Release 3.7.2" commits , it has AST breaking changes in diff) |
@ncave I restored the char/number workaround in its original, tests should pass now. I tried to fix it via TypeCast which broke the build and found myself in a rabbit hole trying to understand how it works. So sticking with good old "if it works don't touch it" |
@DunetsNM See DunetsNM#1 |
@ncave I fixed style warnings, don't have anything else to push here. Let me know if you want me to tidy up anything. |
LGTM, the only outstanding issue is the (potential) breaking change for Fable plugins, as mentioned above. ++ @MangelMaxime, if you know of any list of Fable plugins (looking up in GitHub only brings very old ones that probably have to be updated anyway to work with Fable 4). |
These plugins were updated to Fable 4 (I use a fork of those) however they shouldn't break as they don't inspect https://github.com/Zaid-Ajaj/Feliz/tree/master/Feliz.CompilerPlugins |
The only Fable plugin I am aware of is Feliz.CompilerPlugins. If the tests are passing then I think it means that this plugin does not need an update because we have it tested as part of tests/React/Fable.Tests.React.fsproj For the version in the past, I upgraded only the major version so in this case it would become 4.5.0. |
@MangelMaxime @ncave gentlemen when can I expect a new Fable nuget to be published (with this fix)? Don't want to be pushy, just wondering if I have time to wait for it or rather should make a private nuget from my fork in the meantime |
I was looking into the PR and I have questions.
For this reason, I suspect there are still situation where the Reading the exception error it seems like the problem is that the problem is because type Attribute =
abstract Entity: EntityRef
abstract ConstructorArgs: obj list By looking into the Fable.AST this is not the only interface we have does that mean we don't have the problem with the others interfaces because the generated JSON doesn't include all the AST but only a subset of the AST which consist only of records, DUs and primitives types ? Should we try to use a record instead of an interface for Looking online, it also seems possible to create a custom converter to teach I am asking all this questions, in case we have a way to fix the issues in a consistent way and also without loosing information in the AST. I unsure if this is important or not, if you should it does not harm or it is too complex to do please feel free to tell me. |
I believe this is the case. Serialized json data has type of Addition of |
Speaking about losing the information in AST - my impression is that full information about the In similar manner |
I now remember indeed working on this issue (I mean git history doesn't lie 🤣). And indeed, I used the existing I agree that I don't think people rely on the I will probably just add a comment on the Thanks a lot for the time you spend on this issue. |
@DunetsNM This is now available in Fable 4.18.0 |
This fixes two problems that broke
--precompiledLib
switch after upgrading from Fable 3 to Fable 4, both caused by change in data format that affects deserialization of precompiled inline_exprs_0 json files.MemberRefInfo.Attributes
is a sequence of abstract Attribute type, which can't be deserialized even when collection is empty. Build crashes on attempt to link precompiledLib with:ValueKind.NumberConstant
stores the value asobj
which deserializes from precompiledLib as ...JsonElement
, compilation proceeds but at the end fails complaining thatJsonElement
is not a good type for a numeric value (rightfully so).This pull request fixes both issues (at least now project builds with
--precompiledLib
switch)