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

Use alexis-renard fork with to_html fix #4

Merged
merged 1 commit into from
Jun 12, 2021
Merged

Conversation

mhw
Copy link
Contributor

@mhw mhw commented Jun 11, 2021

From mustache.js version 4.0.0, .to_html has been removed.

jquery.mustache.js has not yet been updated to not use .to_html. There's a PR but it hasn't been merged.

But as things stand, doing something like $('body').mustache('simple-hello', viewData) will fail with the combination of mustache.js and jquery.mustache.js that ships in mustache-js-rails version 4.1.0. I think this will also be true of version 4.0.0 and 4.0.1, though I've not tested them myself. The error reported in DevTools is something like Uncaught TypeError: getMustache(...).to_html is not a function

Reverting to 3.1.0.1 fixes things for me, but here's a PR that includes the fix. If the fix gets merged in to jquery.mustache.js you could switch back, but it's looking close to unmaintained at this point.

This PR updates the submodule dependency and also manually updates the vendored copy of jquery.mustache.js: jquery.mustache.js/src/jquery.mustache.js has the .to_html change but jquery.mustache.js/jquery.mustache.js has not been regenerated and so we can't use rake to update the vendored assets.

Temporary change until
jonnyreeves/jquery-Mustache#43 is merged.

This updates the submodule dependency and also manually updates the
vendored copy of `jquery.mustache.js`:
`jquery.mustache.js/src/jquery.mustache.js` has the `.to_html`
change but `jquery.mustache.js/jquery.mustache.js` has not been
regenerated and so we can't use `rake` to update the vendored
assets.
@knapo
Copy link
Owner

knapo commented Jun 12, 2021

Thanks @mhw! Appreciate the PR!

@knapo knapo merged commit ef2194f into knapo:master Jun 12, 2021
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

Successfully merging this pull request may close these issues.

2 participants