decaporg / decaporg/decap-cms

Get rid of Immutable.js

Open
#3,853 9 comments 8 reactions 0 assignees View on GitHub
area: 3rd party dependencies area: api type: chore
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.