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

Codemods that are not part of the core upgrade process. #748

Closed
5 tasks done
svogt0511 opened this issue Aug 9, 2023 · 1 comment
Closed
5 tasks done

Codemods that are not part of the core upgrade process. #748

svogt0511 opened this issue Aug 9, 2023 · 1 comment
Assignees

Comments

@svogt0511
Copy link
Contributor

svogt0511 commented Aug 9, 2023

The 3.24 ember upgrade included changes to the syntax of the .hbs templates involving ids, classes, and other properties on html elements. This caused breakage in both testing and runtime behavior of Fabrica. The modified properties (ids, classes, and other properties) are assumed to be there and relied upon for the correct runtime behavior, especially in forms and power-select.

Every ember upgrade involves running codemods. Codemods are scripts provided by ember module writers. These scripts make mechanical changes to custom code in a project so the developer does not have to do so, saving time. The command is:

ember-cli-update --run-codemods

Normally the codemods scripts work, but this time, many did not, so the hbs files had to be modified manually.

Some of the codemods are described in ember-bootstrap-codemods. Others are described in Upgrade Fabrica to Ember v3.24. Also, warnings may show up as warnings in the developer console if Ember detects a codemod that is needed.

Some of the codemods that needed to be manually implemented are:

  • BsButton component: remove @ from title, class, id, and disabled. Orange buttons on doi create/update forms changed appearance (black instead of orange). They need to be orange.
  • Power select component: <form.element @controlType="power-select">.
    • @disabled, @Placeholder, @searchEnabled, @allowClear - move from <form.element> to the subordinate <el.control> and keep @.
    • Issues surrounding syntax and placement of @id, @Class. Remove @. These properties can stay in the form.element or moved to subordinate <el.control> depending on where they are needed in the rendered html.
    • Issue mentioned above with @onkeydown in the bootstrap-power-select module not invoking 'createOnEnter'. That
      was fixed by adding a patch command that is run after the build (see package.json, 'postinstall' and patches directory).
    • Add @searchEnabled to <el.control> to enable the search, otherwise it won't work.
  • form.element/el.control
    • placeholder, disabled, required, rows, readonly, autofocus, disabled move to el.control. Remove @.
    • id and class - at form.element level, remove @.
    • Add 'id-field' or 'class-field' to el.control. (These are used in testing to identify input fields.)
      See ember-bootstrap-codemods for details.
  • Radiobutton component accepts @disabled
  • Syntax for using variables in templates changed from <var_name> to {{var_name}}.
@svogt0511 svogt0511 self-assigned this Aug 9, 2023
@svogt0511 svogt0511 changed the title Codemods that are not part of the core upgrade process (see "MANUAL CODEMODS...", below) Codemods that are not part of the core upgrade process. Aug 9, 2023
@svogt0511
Copy link
Contributor Author

svogt0511 commented Aug 11, 2023

Closing this issue for now. I think we have gotten all of these.

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

No branches or pull requests

1 participant