Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Yeah. It upgrades your Reason syntax from version 2 to 3

NotificationsYou must be signed in to change notification settings

reasonml/upgradeSyntaxFrom2To3

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 

Repository files navigation

What is Reason 2/3?

See theannouncementand thechangelog guide.

How do I upgrade my project?

Before you start

Converting your code to to the new syntax is done by running theupgradeSyntaxFrom2To3 converter on your project's Reason code.Make sure that your project is syntactically valid in Reason 2.Invalid code will fail to convert.

Convert your code

Do this at the root of your project:

npm install -g upgrade-reason-syntaxnpm install --save-dev bs-platform@2.2.2upgradeSyntaxFrom2To3 mySource/*

Make sure you did install bs-platform 2.2.2. Sometimes your lockfile might have locked it to1.x.x. 2.2.2 is also thelast version to support Reason syntax 2.

The script accepts a list of files/globs to convert. Pass as many as you want. It'll intelligently skip over any file that's not Reason.

After you're done converting your projects:

  • Remove the backup files atmySource/*.backup
  • Add"refmt": 3 to your bsconfig.json to make BuckleScript use the new syntax.
  • Feel free to uninstall this library!

If you're on native, this is also your workflow. (So you'll need node.js).

How does it work?

It's a simple node.js script that takes the oldrefmt and the newrefmt3 from your project's BuckleScript 2.0.0's source atnode_modules/bs-platform, and then:

  • Iterates over all your relevant files, making a backup copy
  • Turns your Reason files into an AST (abstract syntax tree) usingrefmt
  • Turns the ASTs into the new syntax usingrefmt3 and writes them back

That's it! Enjoy =)

About

Yeah. It upgrades your Reason syntax from version 2 to 3

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors2

  •  
  •  

[8]ページ先頭

©2009-2025 Movatter.jp