Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make languages pluggable #222

Open
perliedman opened this issue Feb 23, 2018 · 2 comments
Open

Make languages pluggable #222

perliedman opened this issue Feb 23, 2018 · 2 comments

Comments

@perliedman
Copy link

In perliedman/leaflet-routing-machine#446, it was reported that the size of Leaflet Routing Machine ends up very large, and examining this it turns out that the languages from osrm-text-instructions are a major part of that (at least over 80%).

Since a lot of applications will never use more than one language, I can see that this is not ideal.

A lot of other libraries use an opt-in mechanism for languages you need to support, rather than always bundling all of them, which could be one idea to approach this.

Is this something you have thought about? I tried to look for some info on how to exclude languages but didn't find anything, sorry if I missed something obvious.

@freenerd
Copy link
Member

👋 @perliedman

We looked at this before in #107 (comment).

Some options to fix on your end:

  • Use a bundler that can exclude files
  • Manually delete language files pre-bundling from node_modules

Loading language files on-demand in the client might be another solution. This breaks osrm-text-instructions being self-contained though, since the language files need to be served out-of-bounds though.

@perliedman
Copy link
Author

Hi 😃

Ok, good to know. I'll think about this for a while.

My main concern is that most users of Leaflet Routing Machine (that I hear from) use the pre-built plugin, where it's already too late to exclude the files. Also, I'd prefer to not have to instruct people on how to use their bundlers 😛, but I see your point about the module being self-contained.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants