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

JavaScript of Component is Executed even when the Component is not used. #112

Closed
saurabhdaware opened this issue Jan 17, 2021 · 2 comments
Closed
Labels
bug Something isn't working v1.0.0 Will be implemented in version 1 of Abell
Milestone

Comments

@saurabhdaware
Copy link
Member

Describe the bug
If we have index.abell and about.abell.
index.abell uses Nav.abell so the JavaScript from Nav.abell is bundled into main.abell.js.
about.abell does not use Nav.abell but uses other component which also adds to main.abell.js bundle.

Now since about.abell has main.abell.js in output, it executes the javascript and fails since the elements don't exist.

To Reproduce

Expected behavior
Nav JavaScript to be only executed for page that has Nav component added.

Screenshots

Specs:

  • Abell Version: latest
  • Node Version: all
  • Operating System: all
@saurabhdaware saurabhdaware added the bug Something isn't working label Jan 17, 2021
@saurabhdaware
Copy link
Member Author

The solution to this is to have separate main.abell.js files for every page. So can be something like main-index.abell.js main-about.abell.js.

This can break the existing projects so we will be able to fix this only in the next major version. i.e. v1.0.0

@saurabhdaware saurabhdaware added the v1.0.0 Will be implemented in version 1 of Abell label Mar 21, 2021
@saurabhdaware saurabhdaware added this to the v1.0.0 milestone Mar 21, 2021
@saurabhdaware
Copy link
Member Author

Closing this. v1 will not support having javascript inside components.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working v1.0.0 Will be implemented in version 1 of Abell
Projects
None yet
Development

No branches or pull requests

1 participant