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

Consider a new router architecture #5

Open
anderspitman opened this issue Sep 18, 2024 · 2 comments
Open

Consider a new router architecture #5

anderspitman opened this issue Sep 18, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@anderspitman
Copy link
Member

The current router works well and is pretty simple, but it might be work refactoring it to be cleaner. I think we could create a <iobio-app> component that would work like this:

<iobio-app>
  <iobio-help-page class="route" id="help-page"></iobio-help-page>
  <iobio-home-page class="route" id="home-page"></iobio-home-page>
  <iobio-file-requirements-page class="route" id="file-requirements-page"></iobio-file-requirements-page>
  <iobio-license-page class="route" id="license-page"></iobio-license-page>
  <iobio-compatible-browsers-page class="route" id="compatible-browsers-page"></iobio-compatible-browsers-page>
</iobio-app>

That would be pretty much the entire index.html for bam.iobio. Most of the existing index.html code would move into main_page.js.

would live in app.js and be a web component that takes care of all the routing. It would probably work pretty similarly to the component, but with a nav bar instead of tabs. You might even be able to share code with the component. The individual pages would not know anything about how the router works.

Again, since it's already working, this is not high priority. @YangQi007 thoughts?

@YangQi007
Copy link
Contributor

YangQi007 commented Sep 19, 2024

@anderspitman I like the app structure you proposed. It's worth thinking about it.

Could you give me more details? For example, are you saying that moving the main section in index.html to main_page.js, and make it a web component <iobio-main-page>? Then we put all the routing logic into the app.js(another web component)?

@anderspitman
Copy link
Member Author

Yeah that's pretty much what I had in mind. I don't think we should do it now, but if we need to make changes to this code in the future, that might be a good opportunity to refactor it to be more like this.

@anderspitman anderspitman added the enhancement New feature or request label Sep 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants