-
Notifications
You must be signed in to change notification settings - Fork 178
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
split('/n') does not work on Windows #61
Comments
@yurigenin ah, yes, that's correct — good catch! happy to accept a PR to fix this (maybe with a test if its something we can capture in a test), and we can get this into 1.3.2 as well as 2.0 |
@jnwng I'll take care of this this week! |
Hi. This has broken cross platform support for us. Since graphql files can be written on one platform should not mean they can't be read from another. The specifications state
Therefore, I believe, a Windows platform ought to be able to load a file written in Linux etc. Can we split by |
This should have been available as part of v2.2.1:
70e77d9
Is that not working?
…On Mon, Jun 5, 2017 at 4:22 AM wajb ***@***.***> wrote:
Hi. This has broken cross platform support for us. Since graphql files can
be written on one platform should not mean they can't be read from another.
The specifications
<https://facebook.github.io/graphql/#sec-Line-Terminators> state
line terminators...have no significance to the semantic meaning of a
GraphQL query document.
Therefore, I believe, a Windows platform ought to be able to load a file
written in Linux etc.
Can we split by /(\r?\n)+/ in the loader.js?
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#61 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABERRpWzkOJf08iAP-DpHuDwCDtukJ3Yks5sA7rBgaJpZM4Mc37x>
.
|
Unfortunately not, the query documents were written to have |
I see. Any chance you'd be willing to submit a PR? It should be fairly
similar to the previous solution (and perhaps a test or two).
…On Mon, Jun 5, 2017 at 8:48 AM Justin Doherty ***@***.***> wrote:
Unfortunately not, the query documents were written to have \n as the
line terminator then when we try and run it on a Windows machine the
os.EOL returns \r\n so it doesn't end up splitting on anything.
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#61 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABERRo8yO8Xv_Zn8J6btvycPQ23EPCqDks5sA_kpgaJpZM4Mc37x>
.
|
I see you fixed it already but I've submitted a PR with test coverage. I have also submitted a contributor agreement by email. Thanks. |
The loader fails to process fragments correctly on Windows because split('\n') does not work there. Modifying it to use split('\n\r') works, however. So, you need to determine the correct newline/carriagereturn characters in a platform independent way.
The text was updated successfully, but these errors were encountered: