Logo

dev-resources.site

for different kinds of informations.

What to use instead of `@ember/string`

Published at
10/20/2023
Categories
ember
javascript
strings
Author
nullvoxpopuli
Categories
3 categories in total
ember
open
javascript
open
strings
open
Author
13 person written this
nullvoxpopuli
open
What to use instead of `@ember/string`

@ember/string is trying to be phased out -- I've found that change-case is a better alternative to @ember/string, because it supports more transformations, is true native ESM, and can be anywhere, even outside of ember, or in plain html files!

Here is how you migrate:

camelize

If you use camelize in @ember/string, use this instead:

import { camelCase } from 'change-case';
Enter fullscreen mode Exit fullscreen mode

capitalize

If you use capitalize in @ember/string, use this instead:

import { capitalCase } from 'change-case';
Enter fullscreen mode Exit fullscreen mode

classify

If you use classify in @ember/string, use this instead:

import { pascalCase } from 'change-case';
Enter fullscreen mode Exit fullscreen mode

dasherize

If you use dasherize in @ember/string, use this instead:

import { kebabCase } from 'change-case';
Enter fullscreen mode Exit fullscreen mode

decamelize

If you use decamelize in @ember/string, use this instead:

import { snakeCase } from 'change-case';
Enter fullscreen mode Exit fullscreen mode

underscore

If you use underscore in @ember/string, use this instead:

import { snakeCase } from 'change-case';
Enter fullscreen mode Exit fullscreen mode

## w

If you use w in @ember/string, use this instead:

let result = `long string with words`.split(/\s+/);
//  ^ ['long', 'string', 'with', 'words']
Enter fullscreen mode Exit fullscreen mode
ember Article's
30 articles in total
Favicon
Ember.js in 60 Seconds
Favicon
Intro to Ember.js Components
Favicon
The Top 7 Reasons You Should NOT Use Ember.js on Your Next Project
Favicon
why don't we have a slack channel?
Favicon
Installing EmberJS v2 addons from GitHub forks using PNPM
Favicon
Add custom layer to embe-leaflet
Favicon
Why Ember Wins My Heart Over React ❀️ And Maybe Yours Too!
Favicon
Migrate from ember-cli-deploy-sentry to sentry-cli
Favicon
ERR_PNPM_BAD_PM_VERSION This project is configured to use vX of pnpm. Your current pnpm is vY
Favicon
Fixing Package Dependencies
Favicon
React inside Ember - The Second Chapter
Favicon
πŸš€ Rendering Dynamic Components in Ember.js with Embroider
Favicon
How to use the new Ember theme for QUnit
Favicon
Effects in Ember
Favicon
unsupported ambiguity between helper and component
Favicon
12 common Ember errors to know: A definitive guide on handling EmberJS errors
Favicon
Demystifying Ember.js Development: How to Hire the Right Developer for YourΒ Project
Favicon
Is Angular.js or Ember.js the better choice for JavaScript frameworks?
Favicon
Integrations Series: Authentication And Connection
Favicon
Support for in/inter page linking / scrolling in EmberJS
Favicon
Ember-cli config
Favicon
GraphQL in Your Ember App with Glimmer Apollo
Favicon
Setting up Tailwind, the easy way
Favicon
Context leaking in EmberJS tests
Favicon
What to use instead of `@ember/string`
Favicon
Ember Language Server in Emacs
Favicon
Why Ember.js is designed for Enterprise Software Development
Favicon
Demystifying Ember Serialization: A Comprehensive Guide
Favicon
ember-cli is stuck on certain version
Favicon
React micro-frontend in ember app - Part 2

Featured ones: