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

create-vue-application fails when used with a standalone plugin #10984

Open
chrabyrd opened this issue May 28, 2024 · 1 comment · May be fixed by #11002
Open

create-vue-application fails when used with a standalone plugin #10984

chrabyrd opened this issue May 28, 2024 · 1 comment · May be fixed by #11002

Comments

@chrabyrd
Copy link
Contributor

chrabyrd commented May 28, 2024

As of #10976 , create-vue-application fails because it's using arches.urls to fetch its i18n data, but javascript.htm -- which is used to stock the data in the arches component, is not used.

STEPS TO REPRODUCE:

  1. Edit this line in js/utils/create-vue-application.js:
    from:

    return fetch(arches.urls.api_get_frontend_i18n_data).then(function(resp) {
    

    to:

    return fetch('/api/get_frontend_i18n_data').then(function(resp) {
    
  2. Create a standalone plugin. Go through the process of creating a plugin but ensure the config property has

    "is_standalone": true
    

    as a k/v pair, and ensure component is pointing to a Vue component, eg:

    src/ExampleComponent.vue
    
  3. Visit the plugin. It will not be listed in the sidebar, so you will need to manually navigate to the plugin. eg localhost:8000/plugins/my-plugin

  4. Notice the component loads successfully.

  5. Now revert this line in js/utils/create-vue-application.js:
    from:

    return fetch('/api/get_frontend_i18n_data').then(function(resp) {
    

    to:

    return fetch(arches.urls.api_get_frontend_i18n_data).then(function(resp) {
    
  6. Notice the component fails to load.

PROPOSED SOLUTION

  • Move the arches_urls block outside of javascript.htm
  • include that template in javascript.htm and plugin-standalone.htm

This will allow developers to access arches from standalone plugins while avoiding duplicating the urls themselves

@chrabyrd chrabyrd assigned njkim and unassigned njkim May 30, 2024
@chrabyrd chrabyrd linked a pull request Jun 5, 2024 that will close this issue
11 tasks
@chrabyrd
Copy link
Contributor Author

chrabyrd commented Jun 5, 2024

potentially resolved via removing the feature entirely in #11001 -- however the proposed solution in this ticket will be implemented

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

Successfully merging a pull request may close this issue.

2 participants