ractivejs / ractive

Next-generation DOM manipulation
http://ractive.js.org
MIT License
5.94k stars 397 forks source link

Moving all messaging into a module. Have them point to docs. #2733

Open fskreuz opened 7 years ago

fskreuz commented 7 years ago

Description:

This has been running in my head for a while now. The idea is to have error messages link to dedicated error pages in the docs and have the messaging moved to a dedicated module. The former I think RequireJS and Angular 1 do it while the latter is just for ease of editing. Some advantages include:

Ideas are very much welcome 😄

JonDum commented 7 years ago

Absolutely yes. Should save a good chunk of kb by removing those large debug strings.

JonDum commented 7 years ago

Also, can we standardize on DEBUG / PRODUCTION globals so Webpack/Uglify can automatically strip these out for us but we can use the unmin'd source?

if(DEBUG) {
    ...
}

becomes

if(false) {
   ...
}

Which Uglify/Closure will strip out completely because it's a no-op.

dagnelies commented 7 years ago

I'd vote against. :-1:

My reasons are the following:


To summarize it, this proposal adds an indirection that adds lots of complexity, favors out-of-sync code/messages, and lots of additional pages to maintain without offering benefits, besides the fact that people can erroneously update messages.