to be lightweight templates for React, we shouldn't bundle lodash into the build
rileylnapier opened this issue · 5 comments
im a little bit upset about having 7kb bloating my build because of this library.
these seem to be what you need based on poking around the library: map, assign, defaults, keys, pick, identity, transform
i don't think it would be that difficult to move to native functions and/or writing some of the used lodash dependencies from scratch. im ok with using lodash to build the js file from the template, but im not happy with having to include lodash in my prod bundle.
im using babel-lodash plugin to minimize the lodash but 7kb that could be reduced
does not equate "lightweight"
btw i do love the library and it helps us migrate a legacy angular 1.x templates to react. but i feel this lodash dependency is sticking out like sore thumb in our build process and eventually i will probably migrate to JSX to improve performance and optimize bundle size
unfortunately, the PR that would help solve this is still pending for approval. My solution was to use external helper functions and do not rely explicitly on lodash
(see also #184).
A possible workaround for this would be using the lodash-import-path
flag to switch to your own implementation of lodash
where you can have native functions with a minimal footprint. I have not tried it but it should work.
As for myself, I used a fork with my PR for a while, but since I needed more features I ended up writing a templating engine of my own.
In my opinion, html-templates are much more readable than JSX, but JSX carries several other advantages that it's difficult to make a choice. I currently use both.
why still pending? does wix not accept PR or are they busy?
They do accept PRs but activity on this repo has dropped cosiderably in the past years. My guess is that they are no longer using it as a primary tool.
yeah. so probably should migrate away from it to plain jsx