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

Remove deprecated Symbol literal #124

Merged
merged 6 commits into from
Apr 11, 2020

Conversation

mkurz
Copy link
Contributor

@mkurz mkurz commented Nov 20, 2019

Only effects the Play 2.7 folders: core-play27, play27-bootstrap3, play27-bootstrap4 (because of Scala 2.13 support)

I did not do this manually. The first four commits were done via regex, effecting the *.scala.html files only:

find core-play27/ play27-bootstrap3/ play27-bootstrap4/ -name *.scala.html | xargs sed -i "s/'\([^> ]\+\) ->/Symbol(\"\1\") ->/g"
find core-play27/ play27-bootstrap3/ play27-bootstrap4/ -name *.scala.html | xargs sed -i "s/get('\([^) ]\+\))/get(Symbol(\"\1\"))/g"
find core-play27/ play27-bootstrap3/ play27-bootstrap4/ -name *.scala.html | xargs sed -i "s/'\([^) ]\+\))/Symbol(\"\1\"))/g"
find core-play27/ play27-bootstrap3/ play27-bootstrap4/ -name *.scala.html | xargs sed -i "s/'\([^, ]\+\),/Symbol(\"\1\"),/g"

The fifth commit was done via sbt-scalafix and Scalafix Rewrites - to fix all the *.scala files. I temporarly added it to project/plugins.sbt / build.sbt, see this commit (in my own branch). I had to clone https://github.com/scala/scala-rewrites before and publishLocal it. Then I could run it via:

cd core-play27/
sbt clean "scalafix dependency:[email protected]:scala-rewrites:0.1.0-SNAPSHOT"
sbt clean "test:scalafix dependency:[email protected]:scala-rewrites:0.1.0-SNAPSHOT"
cd ../play27-bootstrap3/module/
sbt clean "scalafix dependency:[email protected]:scala-rewrites:0.1.0-SNAPSHOT"
sbt clean "test:scalafix dependency:[email protected]:scala-rewrites:0.1.0-SNAPSHOT"
cd ../sample/
sbt clean "scalafix dependency:[email protected]:scala-rewrites:0.1.0-SNAPSHOT"
sbt clean "test:scalafix dependency:[email protected]:scala-rewrites:0.1.0-SNAPSHOT"
cd ../../play27-bootstrap4/module/
sbt clean "scalafix dependency:[email protected]:scala-rewrites:0.1.0-SNAPSHOT"
sbt clean "test:scalafix dependency:[email protected]:scala-rewrites:0.1.0-SNAPSHOT"
cd ../sample/
sbt clean "scalafix dependency:[email protected]:scala-rewrites:0.1.0-SNAPSHOT"
sbt clean "test:scalafix dependency:[email protected]:scala-rewrites:0.1.0-SNAPSHOT"
cd ../../

See

find core-play27/ play27-bootstrap3/ play27-bootstrap4/ -name *.scala.html | xargs sed -i "s/'\([^> ]\+\) ->/Symbol(\"\1\") ->/g"
find core-play27/ play27-bootstrap3/ play27-bootstrap4/ -name *.scala.html | xargs sed -i "s/get('\([^) ]\+\))/get(Symbol(\"\1\"))/g"
find core-play27/ play27-bootstrap3/ play27-bootstrap4/ -name *.scala.html | xargs sed -i "s/'\([^) ]\+\))/Symbol(\"\1\"))/g"
find core-play27/ play27-bootstrap3/ play27-bootstrap4/ -name *.scala.html | xargs sed -i "s/'\([^, ]\+\),/Symbol(\"\1\"),/g"
@mkurz
Copy link
Contributor Author

mkurz commented Nov 20, 2019

@adrianhurt I know you mentioned you want to replace symbol with a simple string. However that would break all templates that take symbol parameters... I am working towards being able to deprecate twirl template arguments: playframework/twirl#273
This would make transition smoother. I hope I can finish it until Play 2.9.

mkurz added 2 commits December 7, 2019 21:59
cd core-play27/
sbt clean "scalafix dependency:[email protected]:scala-rewrites:0.1.0-SNAPSHOT"
sbt clean "test:scalafix dependency:[email protected]:scala-rewrites:0.1.0-SNAPSHOT"
cd ../play27-bootstrap3/module/
sbt clean "scalafix dependency:[email protected]:scala-rewrites:0.1.0-SNAPSHOT"
sbt clean "test:scalafix dependency:[email protected]:scala-rewrites:0.1.0-SNAPSHOT"
cd ../sample/
sbt clean "scalafix dependency:[email protected]:scala-rewrites:0.1.0-SNAPSHOT"
sbt clean "test:scalafix dependency:[email protected]:scala-rewrites:0.1.0-SNAPSHOT"
cd ../../play27-bootstrap4/module/
sbt clean "scalafix dependency:[email protected]:scala-rewrites:0.1.0-SNAPSHOT"
sbt clean "test:scalafix dependency:[email protected]:scala-rewrites:0.1.0-SNAPSHOT"
cd ../sample/
sbt clean "scalafix dependency:[email protected]:scala-rewrites:0.1.0-SNAPSHOT"
sbt clean "test:scalafix dependency:[email protected]:scala-rewrites:0.1.0-SNAPSHOT"
cd ../../
@mkurz mkurz force-pushed the fix-symbol-literals branch from f83f16f to b99a160 Compare December 7, 2019 21:04
@mkurz mkurz mentioned this pull request Dec 20, 2019
@mkurz
Copy link
Contributor Author

mkurz commented Feb 12, 2020

Ping @adrianhurt

@adrianhurt adrianhurt merged commit 444f1c8 into adrianhurt:develop Apr 11, 2020
@mkurz mkurz deleted the fix-symbol-literals branch April 11, 2020 21:26
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

Successfully merging this pull request may close these issues.

2 participants