Git Product home page Git Product logo

Comments (4)

m10l avatar m10l commented on September 27, 2024 1

Hi @sohara, thanks for adding an issue. This is the right place for it. We're aware of this pain point and we're working on a better solution so that it is less expensive to use a single component from the library.

We'll keep you updated when there's something to announce.

from forma-36.

mshaaban0 avatar mshaaban0 commented on September 27, 2024 1

Hi @dmitri-suvorov-sumup Thank you for the detailed comment.

We did investigate the problem with Parcel. See Parcel #4046

The issue should be resolved in Parcel 2 which is in beta release at the moment. I believe we will migrate as soon as Parcel 2 have their first stable version release.

from forma-36.

dmitri-suvorov-sumup avatar dmitri-suvorov-sumup commented on September 27, 2024

I'm having the same issue when building an entry extension. The size of forma-36-react-components has increased to 300.53 KB.

➜  partner-page git:(master) ✗ yarn build
yarn run v1.22.4
$ contentful-extension-scripts build
✨  Built in 83.62s.

build/src.76b811d4.js                                                                     ⚠️  1.34 MB    81.17s
├── node_modules/@contentful/forma-36-react-components/dist/esm/index.js                   300.53 KB    11.20s
├── node_modules/slate/lib/slate.es.js                                                     145.78 KB    11.59s
├── node_modules/react-dom/cjs/react-dom.production.min.js                                  103.5 KB     7.96s
├── node_modules/@contentful/field-editor-rich-text/dist/field-editor-rich-text.esm.js      81.35 KB    12.33s
├── node_modules/@contentful/mimetype/node_modules/lodash/lodash.js                         69.27 KB     7.04s
├── node_modules/moment/moment.js                                                           57.67 KB     9.21s
├── node_modules/immutable/dist/immutable.js                                                55.31 KB    10.21s
├── node_modules/slate-react/lib/slate-react.es.js                                          41.75 KB     8.10s
├── node_modules/@contentful/field-editor-reference/dist/field-editor-reference.esm.js      32.42 KB     6.47s
├── node_modules/react-sortable-hoc/dist/react-sortable-hoc.esm.js                          25.99 KB     6.80s
└── + 610 more assets                                                                 

build/src.6db4c87c.css                                                                      66.36 KB    26.39s
├── node_modules/@contentful/forma-36-react-components/dist/styles.css                       62.6 KB    19.28s
├── node_modules/@contentful/forma-36-tokens/dist/css/index.css                              1.02 KB    19.30s
├── src/index.css                                                                              691 B    19.27s
├── node_modules/@contentful/forma-36-tokens/dist/css/z-index.css                              226 B     1.67s
├── node_modules/@contentful/forma-36-tokens/dist/css/typography/font-stack.css                224 B     2.21s
├── node_modules/@contentful/forma-36-tokens/dist/css/spacing.css                              179 B     4.26s
├── node_modules/@contentful/forma-36-tokens/dist/css/colors/colors-elements.css               158 B     1.81s
├── node_modules/@contentful/forma-36-tokens/dist/css/colors/colors-orange.css                 150 B     1.88s
├── node_modules/@contentful/forma-36-tokens/dist/css/colors/colors-purple.css                 150 B     1.88s
├── node_modules/@contentful/forma-36-tokens/dist/css/colors/colors-yellow.css                 150 B     2.11s
└── + 21 more assets                                                                  

build/index.html                                                                               209 B     2.35s

Extension size: 1 MB from 512 KB allowed.

Your extensions exceeds max size. It cannot be hosted by Contentful.

✨  Done in 99.88s.

Any updates on this?

from forma-36.

suevalov avatar suevalov commented on September 27, 2024

Hi @dmitri-suvorov-sumup!

We've just released Forma v4 and, when using it with create-contentful-app CLI, gives a quite good tree-shaking out of the box.

If your tool doesn't support tree-shaking, you can import components from smaller packages with v4. For example:

import { Button } from '@contentful/f36-components';
// or 
import { Button } from '@contentful/f36-button';

Here's bundle output:

image

from forma-36.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.