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

Refactored code in lib #1882

Merged
merged 12 commits into from
May 14, 2024
Merged

Refactored code in lib #1882

merged 12 commits into from
May 14, 2024

Conversation

ijlee2
Copy link
Contributor

@ijlee2 ijlee2 commented May 14, 2024

Why?

To migrate ember-intl to v2 format, I need to understand the files in lib folder better and make addon/index.js as ordinary as possible.

I noticed that a couple of lines (e.g. isLocalizationFramework, isAbsolutePath()) don't apply anymore and should have been long removed. In addition to improving code readability, the pull request will reduce the package size by ~2kB.

@ijlee2 ijlee2 added the enhance: code Issue asks for new feature or refactor label May 14, 2024
@ijlee2 ijlee2 marked this pull request as ready for review May 14, 2024 09:54
@ijlee2 ijlee2 merged commit 8fd1d43 into main May 14, 2024
32 checks passed
@ijlee2 ijlee2 deleted the refactor-lib branch May 14, 2024 09:54
do {
if (isEngine(current)) {
return current;
const isEngine = addon.pkg?.keywords.includes('ember-engine');
Copy link
Contributor Author

Choose a reason for hiding this comment

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

TODO

Needs an additional ?..

const isEngine = addon.pkg?.keywords?.includes('ember-engine');

@ijlee2 ijlee2 mentioned this pull request May 14, 2024
ijlee2 added a commit that referenced this pull request May 14, 2024
* bugfix: Restricted type for the test helper setLocale()

* bugfix: Applied an extra optional chanining to avoid runtime error

* chore: Added changeset

---------

Co-authored-by: ijlee2 <ijlee2@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhance: code Issue asks for new feature or refactor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant