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

Update dependency @ember/string to v4 #9011

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions mirage/factories/category.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { dasherize } from '@ember/string';

import { Factory } from 'miragejs';

import { dasherize } from '../utils/strings';

export default Factory.extend({
category: i => `Category ${i}`,

Expand Down
4 changes: 2 additions & 2 deletions mirage/factories/user.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { dasherize } from '@ember/string';

import { Factory } from 'miragejs';

import { dasherize } from '../utils/strings';

export default Factory.extend({
name: i => `User ${i + 1}`,

Expand Down
9 changes: 9 additions & 0 deletions mirage/utils/strings.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// Imported from the `@ember/string` package to avoid build issues...
Copy link

@NullVoxPopuli NullVoxPopuli Jul 24, 2024

Choose a reason for hiding this comment

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

I mean, if this is all you need, then it's probably more valuable to try to remove the dep

Copy link
Member

Choose a reason for hiding this comment

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

that's all we need in the app itself, but it looks like e.g. ember-tooltips needs more

Choose a reason for hiding this comment

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

looks like ember-tooltips could also do with a v2 conversion πŸ€”


export function decamelize(str) {
return str.replace(/([\da-z])([A-Z])/g, '$1_$2').toLowerCase();
}

export function dasherize(str) {
return decamelize(str).replace(/[ _]/g, '-');
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"@babel/plugin-proposal-decorators": "7.24.7",
"@ember/optional-features": "2.1.0",
"@ember/render-modifiers": "2.1.0",
"@ember/string": "3.1.1",
"@ember/string": "4.0.0",
"@ember/test-helpers": "3.3.1",
"@ember/test-waiters": "3.1.0",
"@embroider/compat": "3.6.0",
Expand Down
Loading
Loading