Skip to content
This repository has been archived by the owner on Jul 7, 2022. It is now read-only.

Tremho sbg parser fixes #97

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

tremho
Copy link

@tremho tremho commented Nov 10, 2021

This represents the changes needed to prevent the Nativescript build from failing during the StaticBindingGenerator process. That process apparently uses a Javascript parser that isn't compatible with certain modern syntaxes. There is some ambiguity about the causes of this problem, because the SBG apparently can parse (or maybe ignore) this file successfully in some cases (not sure why), but the gist of this fix is that it works by changing the syntax to simplistic forms that pass in any event.

Also fixed is the value sent to NSURLRequest for the timeout. The iOS API takes seconds instead of milliseconds. This normalizes milliseconds as the nativescript API spec for both Android and iOS.

Note a couple other files were modified and then reverted in subsequent commits. In then end, there should only be changes to websockets-base.android.js and the timeout change to websockets-base.ios.js

…t appears this file is necessary to prevent errors from being generated in the StaticBindingGenerator of an android build.
…ed herring proven to be incorrect with later tests.
… nevertheless proves to be problematic for the Javascript parser used by Nativescript in its StaticBindingGenerator process.

These changes alter the syntax to equivalent, albeit more verbose forms that the SBG parser appears to accept.

Footnote: Interestingly, there appears to be some 'unknown' factor involved as well because the SBG parser will sometimes not choke on the original code (reasons are unclear).  However, tests have shown never-fail on this revised syntax.
@NathanaelA
Copy link
Owner

I just saw your PR (wish github let me know about it a couple months ago, sorry about that). Can you tell me what version of NativeScript is failing the SBG parsing?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants