prismicio / prismic-dom

Set of helpers to manage Prismic data
https://prismic.io/docs/technologies/prismic-dom-technical-reference
44 stars 16 forks source link

90.1 KB minified? #35

Closed wiledal closed 4 years ago

wiledal commented 5 years ago

This script clocks in at a massive 90.1 KB minified.

For context:

How is it possible for this to be so positively colossal?

We need to be able to get RichText in a different format like markdown, or plain HTML straight from the Prismic API, or reduce the size of this dependency tenfold for it to be usable client-side.

hypervillain commented 5 years ago

Hey @wiledal that's definitely a huge issue. I'll try and make a PR today

HMilbradt commented 4 years ago

We're running into this as well, and it's really hurting our page speed performance on Google. We are using Prismic in a Nuxt app, and its size matches the size of the Vue runtime required.

Are there any plans for fixing or mitigating this?

controversial commented 4 years ago

The large dependency in prismic-dom seems to be prismic-richtext; the verison of prismic-richtext required by this repository is 85kb minified. According to bundlephobia, there was an update to prismic-richtext over a year ago that cut its size by a factor of nearly 8 (from 85kb to 11). However, prismic-dom hasn't been updated to require the new version of prismic-richtext. Can anything be done about this, @arnaudlewis ?

controversial commented 4 years ago

I opened a pull request that updates prismic-richtext (it doesn't seem like the major release of prismic-richtext introduced any breaking changes as far as I can tell)

simonmaass commented 4 years ago

@arnaudlewis is this abandoned? why is nothing happening?

controversial commented 4 years ago

fwiw I'm currently using my fork of this package in my project's package.json, while waiting on the PR I submitted

  "dependencies": {
    "prismic-dom": "git+https://git@github.com/controversial/prismic-dom.git"
  }

https://github.com/controversial/luk.ke/blob/0fbce9e2baa5e28e74c005681c4c43c167bbde24/package.json#L26

simonmaass commented 4 years ago

@hypervillain can you release this in new version?

simonmaass commented 4 years ago

@hypervillain ping!

simonmaass commented 4 years ago

@arnaudlewis ping

controversial commented 4 years ago

Looks like @arnaudlewis made a new release a couple hours ago - thanks ❤️

controversial commented 4 years ago

Might have spoken too soon - it looks like there was a 2.1.2 release made that had a smaller bundle size but it jumped back up with a 2.1.3 release that's not pushed to this git repository yet. Do you know what's going on with that @arnaudlewis @hypervillain ?

Screen Shot 2020-04-14 at 2 11 13 PM
arnaudlewis commented 4 years ago

Hey guys, sorry for the inconvenience, we had some browser issues forcing us to rollback our build but now the version 2.2.3 is stable and is below 20kB ;) Thank you for your patience.