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

Enhancement/Move from script tags to Javascript imports #145

Merged

Conversation

c-w
Copy link
Member

@c-w c-w commented Apr 9, 2019

Previously some of the Vue code relied on script tags being present in the host application, to include dependencies such as lodash or marked. This is not ideal for encapsulation since it means the Vue components are not self-contained, makes testing harder, etc.

As such, this change replaces the script tag includes with ES6 imports.

Additionally, the lodash dependency (which was used only for debouncing) is replaced in this change with the vue-debounce library which offers a debouncing directive. This simplifies the code and avoids potential gotchas with the this context in the debounced function.

Previously some of the Vue code relied on script tags being present in
the host application, to include dependencies such as lodash or marked.
This is not ideal for encapsulation since it means the Vue components
are not self-contained, makes testing harder, etc.

As such, this change replaces the script tag includes with ES6 imports.

Additionally, the lodash dependency (which was used only for debouncing)
is replaced in this change with the vue-debounce library which offers a
debouncing directive. This simplifies the code and avoids potential
gotchas with the this context in the debounced function.
@c-w c-w changed the title Move from script tags to Javascript imports Enhancement/Move from script tags to Javascript imports Apr 9, 2019
@Hironsan Hironsan merged commit c4b6294 into doccano:master Apr 12, 2019
@c-w c-w deleted the enhancement/move-to-javascript-imports branch April 12, 2019 14:10
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.

None yet

2 participants