Skip to content

Rename `flash.js` to `alert.js`

Eduardo Sanz García requested to merge eduardosanz/rename-flash-to-alert into master

What does this MR do and why?

A few frontend engineers have supported the idea of renaming flash.js to alert.js. The word flash is no longer relevant and it should probably be used only in the Rails context. Hence, we reserve the name flash for alert message created by the Rails framework, and alert if they are created by JavaScript.

I suggest this MR be reviewed in the following order:

  1. In the first commit, we rename flash.js to alert.js.
  2. In the second commit, we modify a few imports that makes the configuration changes in step #3 easier.
  3. In the third commit, we set up two aliases (in the webpack and jest configurations) so the file can found by the new and old names.
  4. After this MR is approved, I will create follow-up MRs to change the import paths to the new name (alert.js) in batches of 20 files. On the last MR, I will removed the aliases in the configuration files.

I have talked with a few frontend engineers about the best location for the file. After evaluating a few suggestion, ~/lib, ~/vue_shared, we feel the root directory (~/), although a bit too crowded, is the best place in terms of simplicity and uniformity.

Screenshots or screen recordings

N/A

How to set up and validate locally

N/A

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Eduardo Sanz García

Merge request reports

Loading