-
Notifications
You must be signed in to change notification settings - Fork 170
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
Do Scala.js properly #579
Do Scala.js properly #579
Conversation
Hello @thinkharderdev @vigoo , I'm trying to port zio-schema to Scala.js. |
@sideeffffect I merged the latest updates to this, and now I see some cross-platform related failures I don't know much about:
could you take a look? |
Hi, I got it to the state where things compile and tests run. But they fail, there are many errors in the style
Could you please have a look at this? Unfortunately I don't understand zio-schema very well, so I don't have much clue what could be going wrong 😅 Some of them also look like this
Which kinda suggests that it is trying to compare functions (e.g. |
In case of |
So that schema equality test did not make any sense - I would say it was accidentally working on JVM (and if you check it, it already had "scala 2 only" annotations, and some cases commented out). That's the reason I wrote proper In There are some more failing tests in the JSON and Protobuf modules. |
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.
@vigoo do you think you could give me some examples (or maybe even all those that we know of?) of strings which parse differently from how they should? I could report these to scala-java-time to get it (eventually) fixed upstream 🙏
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.
The following ones can be parsed on JVM and fails on JS. They all seem to fail on the AM/PM postfix:
Error parsing time 00:00:00 AM with format HH:mm:ss a: java.time.format.DateTimeParseException: Text '00:00:00 AM' could not be parsed, unparsed text found at index 9
Error parsing time 00:00:00 AM with format HH:mm:ss a: java.time.format.DateTimeParseException: Text '00:00:00 AM' could not be parsed, unparsed text found at index 9
Error parsing time 01:01:00 AM with format HH:mm:ss a: java.time.format.DateTimeParseException: Text '01:01:00 AM' could not be parsed, unparsed text found at index 9
Error parsing time 01:01:00 AM with format HH:mm:ss a: java.time.format.DateTimeParseException: Text '01:01:00 AM' could not be parsed, unparsed text found at index 9
Error parsing time 10:00:00 AM with format HH:mm:ss a: java.time.format.DateTimeParseException: Text '10:00:00 AM' could not be parsed, unparsed text found at index 9
Error parsing time 12:00:00 PM with format HH:mm:ss a: java.time.format.DateTimeParseException: Text '12:00:00 PM' could not be parsed, unparsed text found at index 9
Error parsing time 12:09:09 PM with format HH:mm:ss a: java.time.format.DateTimeParseException: Text '12:09:09 PM' could not be parsed, unparsed text found at index 9
Error parsing time 12:59:59 PM with format HH:mm:ss a: java.time.format.DateTimeParseException: Text '12:59:59 PM' could not be parsed, unparsed text found at index 9
Error parsing time 13:09:09 PM with format HH:mm:ss a: java.time.format.DateTimeParseException: Text '13:09:09 PM' could not be parsed, unparsed text found at index 9
Error parsing time 20:20:20 PM with format HH:mm:ss a: java.time.format.DateTimeParseException: Text '20:20:20 PM' could not be parsed, unparsed text found at index 9
Error parsing time 22:22:22 PM with format HH:mm:ss a: java.time.format.DateTimeParseException: Text '22:22:22 PM' could not be parsed, unparsed text found at index 9
Error parsing time 23:59:00 PM with format HH:mm:ss a: java.time.format.DateTimeParseException: Text '23:59:00 PM' could not be parsed, unparsed text found at index 9
Error parsing time 23:59:59 PM with format HH:mm:ss a: java.time.format.DateTimeParseException: Text '23:59:59 PM' could not be parsed, unparsed text found at index 9
Error parsing time 24:00:00 AM with format HH:mm:ss a: java.time.format.DateTimeParseException: Text '24:00:00 AM' could not be parsed, unparsed text found at index 9
Error parsing time 0:0:0 AM with format H:m:s a: java.time.format.DateTimeParseException: Text '0:0:0 AM' could not be parsed, unparsed text found at index 6
Error parsing time 1:1:1 AM with format H:m:s a: java.time.format.DateTimeParseException: Text '1:1:1 AM' could not be parsed, unparsed text found at index 6
Error parsing time 00:00:00 AM with format H:m:s a: java.time.format.DateTimeParseException: Text '00:00:00 AM' could not be parsed, unparsed text found at index 9
Error parsing time 00:00:00 AM with format H:m:s a: java.time.format.DateTimeParseException: Text '00:00:00 AM' could not be parsed, unparsed text found at index 9
Error parsing time 01:01:00 AM with format H:m:s a: java.time.format.DateTimeParseException: Text '01:01:00 AM' could not be parsed, unparsed text found at index 9
Error parsing time 01:01:00 AM with format H:m:s a: java.time.format.DateTimeParseException: Text '01:01:00 AM' could not be parsed, unparsed text found at index 9
Error parsing time 10:00:00 AM with format H:m:s a: java.time.format.DateTimeParseException: Text '10:00:00 AM' could not be parsed, unparsed text found at index 9
Error parsing time 12:00:00 PM with format H:m:s a: java.time.format.DateTimeParseException: Text '12:00:00 PM' could not be parsed, unparsed text found at index 9
Error parsing time 12:09:09 PM with format H:m:s a: java.time.format.DateTimeParseException: Text '12:09:09 PM' could not be parsed, unparsed text found at index 9
Error parsing time 12:59:59 PM with format H:m:s a: java.time.format.DateTimeParseException: Text '12:59:59 PM' could not be parsed, unparsed text found at index 9
Error parsing time 13:09:09 PM with format H:m:s a: java.time.format.DateTimeParseException: Text '13:09:09 PM' could not be parsed, unparsed text found at index 9
Error parsing time 20:20:20 PM with format H:m:s a: java.time.format.DateTimeParseException: Text '20:20:20 PM' could not be parsed, unparsed text found at index 9
Error parsing time 22:22:22 PM with format H:m:s a: java.time.format.DateTimeParseException: Text '22:22:22 PM' could not be parsed, unparsed text found at index 9
Error parsing time 23:59:00 PM with format H:m:s a: java.time.format.DateTimeParseException: Text '23:59:00 PM' could not be parsed, unparsed text found at index 9
Error parsing time 23:59:59 PM with format H:m:s a: java.time.format.DateTimeParseException: Text '23:59:59 PM' could not be parsed, unparsed text found at index 9
Error parsing time 0:00:00 AM with format H:m:s a: java.time.format.DateTimeParseException: Text '0:00:00 AM' could not be parsed, unparsed text found at index 8
Error parsing time 1:11:00 AM with format H:m:s a: java.time.format.DateTimeParseException: Text '1:11:00 AM' could not be parsed, unparsed text found at index 8
Error parsing time 24:00:00 AM with format H:m:s a: java.time.format.DateTimeParseException: Text '24:00:00 AM' could not be parsed, unparsed text found at index 9
Error parsing time 00:00:00 AM with format hh:mm:ss a: java.time.format.DateTimeParseException: Text '00:00:00 AM' could not be parsed, unparsed text found at index 9
Error parsing time 00:00:00 AM with format hh:mm:ss a: java.time.format.DateTimeParseException: Text '00:00:00 AM' could not be parsed, unparsed text found at index 9
Error parsing time 01:01:00 AM with format hh:mm:ss a: java.time.format.DateTimeParseException: Text '01:01:00 AM' could not be parsed, unparsed text found at index 9
Error parsing time 01:01:00 AM with format hh:mm:ss a: java.time.format.DateTimeParseException: Text '01:01:00 AM' could not be parsed, unparsed text found at index 9
Error parsing time 10:00:00 AM with format hh:mm:ss a: java.time.format.DateTimeParseException: Text '10:00:00 AM' could not be parsed, unparsed text found at index 9
Error parsing time 12:00:00 PM with format hh:mm:ss a: java.time.format.DateTimeParseException: Text '12:00:00 PM' could not be parsed, unparsed text found at index 9
Error parsing time 12:09:09 PM with format hh:mm:ss a: java.time.format.DateTimeParseException: Text '12:09:09 PM' could not be parsed, unparsed text found at index 9
Error parsing time 12:59:59 PM with format hh:mm:ss a: java.time.format.DateTimeParseException: Text '12:59:59 PM' could not be parsed, unparsed text found at index 9
Error parsing time 0:0:0 AM with format h:m:s a: java.time.format.DateTimeParseException: Text '0:0:0 AM' could not be parsed, unparsed text found at index 6
Error parsing time 1:1:1 AM with format h:m:s a: java.time.format.DateTimeParseException: Text '1:1:1 AM' could not be parsed, unparsed text found at index 6
Error parsing time 00:00:00 AM with format h:m:s a: java.time.format.DateTimeParseException: Text '00:00:00 AM' could not be parsed, unparsed text found at index 9
Error parsing time 00:00:00 AM with format h:m:s a: java.time.format.DateTimeParseException: Text '00:00:00 AM' could not be parsed, unparsed text found at index 9
Error parsing time 01:01:00 AM with format h:m:s a: java.time.format.DateTimeParseException: Text '01:01:00 AM' could not be parsed, unparsed text found at index 9
Error parsing time 01:01:00 AM with format h:m:s a: java.time.format.DateTimeParseException: Text '01:01:00 AM' could not be parsed, unparsed text found at index 9
Error parsing time 10:00:00 AM with format h:m:s a: java.time.format.DateTimeParseException: Text '10:00:00 AM' could not be parsed, unparsed text found at index 9
Error parsing time 12:00:00 PM with format h:m:s a: java.time.format.DateTimeParseException: Text '12:00:00 PM' could not be parsed, unparsed text found at index 9
Error parsing time 12:09:09 PM with format h:m:s a: java.time.format.DateTimeParseException: Text '12:09:09 PM' could not be parsed, unparsed text found at index 9
Error parsing time 12:59:59 PM with format h:m:s a: java.time.format.DateTimeParseException: Text '12:59:59 PM' could not be parsed, unparsed text found at index 9
Error parsing time 0:00:00 AM with format h:m:s a: java.time.format.DateTimeParseException: Text '0:00:00 AM' could not be parsed, unparsed text found at index 8
Error parsing time 1:11:00 AM with format h:m:s a: java.time.format.DateTimeParseException: Text '1:11:00 AM' could not be parsed, unparsed text found at index 8
Error parsing time 00:00:00 000000000 AM with format HH:mm:ss SSSSSSSSS a: java.time.format.DateTimeParseException: Text '00:00:00 000000000 AM' could not be parsed, unparsed text found at index 19
Error parsing time 01:01:00 000000001 AM with format HH:mm:ss SSSSSSSSS a: java.time.format.DateTimeParseException: Text '01:01:00 000000001 AM' could not be parsed, unparsed text found at index 19
Error parsing time 13:09:09 100000000 PM with format HH:mm:ss SSSSSSSSS a: java.time.format.DateTimeParseException: Text '13:09:09 100000000 PM' could not be parsed, unparsed text found at index 19
Error parsing time 20:20:20 123456789 PM with format HH:mm:ss SSSSSSSSS a: java.time.format.DateTimeParseException: Text '20:20:20 123456789 PM' could not be parsed, unparsed text found at index 19
Error parsing time 23:59:00 222222222 PM with format HH:mm:ss SSSSSSSSS a: java.time.format.DateTimeParseException: Text '23:59:00 222222222 PM' could not be parsed, unparsed text found at index 19
Error parsing time 24:00:00 000000000 AM with format HH:mm:ss SSSSSSSSS a: java.time.format.DateTimeParseException: Text '24:00:00 000000000 AM' could not be parsed, unparsed text found at index 19
The following "minute strings" should fail (as they are not a number between 0-59) but the JS version parses them successfully:
Time 60 with format mm should be invalid
Time 90 with format mm should be invalid
Time -1 with format m should be invalid
Time 60 with format m should be invalid
Time 90 with format m should be invalid
Time 0505 with format m should be invalid
Time 123 with format m should be invalid
Time 111 with format m should be invalid
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.
Cool, so let's just ignore these testcases until cquiroz/scala-java-time#486 is resolved 👍
But there are also failed tests like this
which would suggest there is indeed something broken about the codec when run under Scala.js. Somebody familiar with the coded will need to fix this (or generalize this so that it work both for JVM and JS). |
closing in favour of #638 |
https://youforgotapercentagesignoracolon.com/
continues part of #520