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

Thoughts about moving to a new version of syntax w/ Reason #1358

Closed
jaredly opened this issue Aug 14, 2017 · 2 comments
Closed

Thoughts about moving to a new version of syntax w/ Reason #1358

jaredly opened this issue Aug 14, 2017 · 2 comments

Comments

@jaredly
Copy link
Contributor

jaredly commented Aug 14, 2017

One of the blockers to landing @let-def's syntax PR is that we need a way to gracefully upgrade people, right? (context: it would be awesome to be on the new syntax by late october when the ReactiveConf workshops + talk happen)

Here are some thoughts about what we can do

  1. ship multiple versions of the reason parser with bucklescript, and allow you to select which one you want via a reason-flags attribute. We'd gradually phase out the old versions, but that would help give people time to move over gradually
  2. we only ship the current + previous versions of the parser as part of bucklescript, and add a command --upgrade-syntax that does an upgrade a la reup.sh. It might be interesting to, if we encounter a syntax error when parsing w/ the current version, to auto-fallback to the previous version in case it can parse it successfully
  3. We just expect people to use reup.sh when they're upgrading to a new version of reason

I can see us doing 1 + 2, or 2 alone, or 3.

1+2 pros/cons

pros:

  • lowest barrier to upgrading bucklescript - don't have to do anything if you don't want to
  • working on an old tutorial w/ a newer version of bs-platform is OK as long as the reason-syntax version is specified in bsconfig.json

cons:

  • fatter install (not sure how much heavier it would be, maybe totally reasonable)
  • would take some work to implement into bucklescript

2 pros/cons

pros:

  • lighter weight than shipping a bunch of versions of reason-parser

cons:

  • can't easily upgrade from "2 versions behind" to "current version"
  • also would take some work to implement in bucklescript

3 pros/cons

pros:

  • no work

cons:

  • ppl might want to upgrade to get new bucklescript features/bugfixes but not want to put in the effort to do the syntax upgrade yet. If we make refmt a ton better, then maybe this becomes less of an issue because upgrading would be pretty painless.

cc @chenglou @jordwalke

@chenglou
Copy link
Member

No, that's not the blocker.

reup won't be good enough, as your third-party dep might not have been upgraded yet.

We can ship a new version with BS, just like we did with the ppx transform. cc @bobzhang. @let-def and I are working to make reason output lightweight enough that shipping two refmt isn't too expensive to BS.

The conversion script, I already have it =)

I will go through reasonml-community and do a one-time upgrade. It'll take like 10 mins. I also have prominent blog posts in mind whose authors I'll contact. cc you and @jsdf

@chenglou
Copy link
Member

Well that sure went smoothly!

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

No branches or pull requests

2 participants