GithubHelp home page GithubHelp logo

Comments (5)

davidmyersdev avatar davidmyersdev commented on May 18, 2024

Hey there, @meismann-as! I'm really glad to hear you are enjoying it. 😄

It sounds like there might be an issue with your bundler configuration. Most of the modules and dependencies of ink-mde are already split into individual smaller chunks that only get included in your project when used. As for the language dependencies, those are included for highlighting various languages inside of Markdown code blocks. If you have a link to your project or another example, I'd be happy to take a look at it to see if there's something I can do.

from ink-mde.

 avatar commented on May 18, 2024

Hi, thank you for replying so quickly and offering help! Hm, big chunks seem to be an issue of my yarn configuration, that makes sense. I will go and check back there (our client's private repo, so I am sorry not to be able to provide insight). However, we will not support language highlighting in Markdown code blocks; in fact, we expect the user not to write any code there at all apart from Markdown. From your reply I take it that limiting the language highlighting support to a subset of languages to reduce dependencies is not a feature so far, is that right? If so, could it be a future feature?

from ink-mde.

davidmyersdev avatar davidmyersdev commented on May 18, 2024

Not a problem at all! I think it makes sense for code blocks to be configurable. As for individual languages, I think I'd need to see what kind of bundler configuration would make that necessary since those are already individual chunks.

from ink-mde.

 avatar commented on May 18, 2024

I was wrong in my assumption that the language highlighting deps would get bundled into the index.js and imported by default. Instead, e.g. the Ruby chunk gets loaded only when I try to write Ruby in the editor. Very neat!
The chunk over 500kB, that yarn build warned my about, is index.js. This is because after including Ink-MDE in the bundle, index.js grows from previously 252kB to 789kB. I think we will have to make do with that. Thank you for your efforts!

from ink-mde.

davidmyersdev avatar davidmyersdev commented on May 18, 2024

This is because after including Ink-MDE in the bundle, index.js grows from previously 252kB to 789kB.

@meismann-as that definitely makes sense. I am still working to reduce the overall bundle size of the main import, but a big part of that is CodeMirror itself. If you don't want your main entry to be that large, you could either dynamically initialize ink-mde (e.g. const { ink } = await import('ink-mde'), or you could create a separate chunk manually.

from ink-mde.

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.