Skip to content
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

Update flow #3238

Merged
merged 6 commits into from
Nov 27, 2017
Merged

Update flow #3238

merged 6 commits into from
Nov 27, 2017

Conversation

duailibe
Copy link
Member

In order to support JSX fragments (#3237) we need to update flow to version 0.59. Since there were some relevant changes I decided to do another sync of the tests.

@duailibe
Copy link
Member Author

duailibe commented Nov 10, 2017

cc @lydell who has done this before

@@ -1 +1 @@
run_spec(__dirname, null, ["babylon"]);
run_spec(__dirname, { parser: "babylon" });
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's related to #1481 but now this code only parses in babylon and not flow anymore. Maybe the babylon fix should be reverted? cc @existentialism


`;

exports[`backslash_2029.js 1`] = `
1;/*a*///b
/*c*/2
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1; /*a*/ //b
/*c*/2
1; /*a*/ //b
/*c*/ 2;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Related to #883

not sure what to do here

@lydell
Copy link
Member

lydell commented Nov 10, 2017

Regarding syncing the Flow tests: See #2336. Do any tests contain new syntax or something that we'd like to copy? Otherwise it might not be worth syncing. Perhaps we should even remove the sync script.

@duailibe
Copy link
Member Author

duailibe commented Nov 10, 2017

I don't think they have any new syntax, they've only removed stuff.

I'll just update the existing broken tests then.

@duailibe duailibe changed the title Update flow and sync tests Update flow Nov 10, 2017
@duailibe
Copy link
Member Author

I think something's changed on the flow-parser, now the dist tests are failing with:

Dynamic requires are not currently supported by rollup-plugin-commonjs

@duailibe
Copy link
Member Author

I managed to add a hack to work around flow-parser’s dynamic require. Hopefully tests will pass now!

"require(s8)": 'require("fs")',
include: "node_modules/flow-parser/flow_parser.js"
})
: {},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc @mroch, not sure it was intentional but would be great to remove dynamic requires

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is js_of_ocaml optimizing things... and comes from its internal library. hrm.

also, s8 is the random name it happened to assign to that hoisted string so this is definitely unstable across releases. will have to think about this...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I'm aware this is a random name given in the ocaml -> JS build. But that shouldn't be a problem until we update flow again, and we don't do that often.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But it's funny that the require("constants") remained like that and require("fs") got hoisted.

@@ -2,15 +2,15 @@

const a = new Headers("'Content-Type': 'image/jpeg'"); // not correct
const b = new Headers(['Content-Type', 'image/jpeg']); // not correct
const c = new Headers({'Content-Type', 'image/jpeg'}); // correct
const c = new Headers({'Content-Type': 'image/jpeg'}); // correct
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How was it even working!?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIRC, it was valid short notation, and then not being typechecked properly

Copy link
Member

@suchipi suchipi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Having to workaround the dynamic require isn't ideal, but since it won't break until we update flow again, I think we should merge this

@duailibe duailibe merged commit f9f0566 into prettier:master Nov 27, 2017
@duailibe duailibe deleted the update-flow branch November 27, 2017 02:14
@suchipi suchipi added this to the 1.9 milestone Nov 28, 2017
@duailibe duailibe mentioned this pull request Nov 29, 2017
4 tasks
@lock lock bot added the locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting. label Jan 19, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Jan 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants