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

ci(typescript): transformer #8020

Merged
merged 6 commits into from
Jun 25, 2022
Merged

ci(typescript): transformer #8020

merged 6 commits into from
Jun 25, 2022

Conversation

ShaMan123
Copy link
Contributor

@ShaMan123 ShaMan123 commented Jun 23, 2022

closes #7839
#7596

Introduces a transformer that is able to transform most of the files under src into es6 and a few more perks.

  • scripts/transform_files.js - the transformer logic
  • scripts/index.js - expose cmd for cli (npm run dev transform -- --help)
  • npm run dev transform -- --help to run the transformer (it will fail for transformed files - revert them beforehand if needed)

Take a look at 04be3f5 for outputs.
And I saw something very exciting in VSCODE:

group.class.ts.-.fabric.js.-.Visual.Studio.Code.2022-06-12.00-25-29.mp4

Then human work can be much easier:

  • static properties
  • imports/export/build/
  • sub/super/abstract class
  • cleanup (e.g. remove chainables)
  • types
  • private/protected - can be done with the transformer
  • things missed out by the transformer (see dump.txt)

Transforming PRs is now possible!
I have tested the following:

  • mock merging a PR into master (merged deprecate-extend into test-pr-transform)
  • ran npm run dev transform -- -ts -o --diff
  • committed changes 0b6da98
  • merged branch into mocked transformed master 656bc9d (merged test-pr-transform into ts-proto)
  • resolved conflicts

The conflicts were simple and weren't affected by the conversion.

Copy link
Contributor Author

@ShaMan123 ShaMan123 left a comment

Choose a reason for hiding this comment

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

Ready to merge.
The src file changes are minor stuff that interfere with the transformer

@ShaMan123 ShaMan123 requested a review from asturur June 23, 2022 06:45
@fabricjs fabricjs deleted a comment from github-actions bot Jun 23, 2022
@fabricjs fabricjs deleted a comment from github-actions bot Jun 23, 2022
@ShaMan123 ShaMan123 changed the title chore(typescript): transformer script chore(typescript): transformer Jun 23, 2022
@ShaMan123 ShaMan123 changed the title chore(typescript): transformer ci(typescript): transformer Jun 23, 2022
@asturur asturur merged commit 351b9e8 into master Jun 25, 2022
@ShaMan123 ShaMan123 deleted the ts-transformer branch September 11, 2022 23:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants