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 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
2 checks passed
2 checks passed
Travis CI - Pull Request Build Passed
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@c-w c-w deleted the CatalystCode:enhancement/move-to-javascript-imports branch Apr 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.