Get rid of Immutable.js
- Dominant language
- JavaScript
- Stars
- 19.4k
- Forks
- 3.1k
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 9
Description
**Is your feature request related to a problem? Please describe.**
1. Immutable.js is not maintained
2. Immutable.js is quite big
3. Immutable.js makes using netlify-cms less easy, especially when creating page previews, when you have to do things like
```js
function BlogPostPagePreview({
entry,
widgetFor,
fieldsMetaData,
}: {
entry: any
widgetFor: any
fieldsMetaData: any
}) {
const title = entry.getIn(['data', 'title']) as string
const author = entry.getIn(['data', 'author']) as string
const tags = entry.getIn(['data', 'tags']).map((tag: string) => {
const slug = `/${slugify(tag.toLowerCase())}`
return { tag, slug }
})
const cover = entry.getIn(['data', 'cover']) as string
const body = widgetFor('body') as React.ReactElement
const avatar = fieldsMetaData.getIn([
'author',
'authors',
author,
'avatar',
]) as string
return (
)
}
```
**Describe the solution you'd like**
Standard solution to deal with immutable data structures nowadays is Immer.js
https://github.com/immerjs/immer
**Additional context**
I know it will be a lot of work, because Immuatble.js is used across the whole codebase. And I really don't know how to introduce it gradually. But I'd really like to help.
Contributor guide
Assessment
This issue has not been assessed yet.