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

add support for dynamic imports #275

Closed
1 of 5 tasks
thescientist13 opened this issue Jan 17, 2020 · 0 comments · Fixed by #286
Closed
1 of 5 tasks

add support for dynamic imports #275

thescientist13 opened this issue Jan 17, 2020 · 0 comments · Fixed by #286
Assignees
Labels
chore unit testing, maintenance, etc enhancement Improve something existing (e.g. no docs, new APIs, etc) v0.5.0 Data w/ GraphQL website Tasks related to the projects website / documentation

Comments

@thescientist13
Copy link
Member

thescientist13 commented Jan 17, 2020

Type of Change

  • New Feature Request
  • Documentation / Website
  • Improvement / Suggestion
  • Bug
  • Other (please clarify below)

Summary

Currently the shelf uses require to load JSON files.

setupShelf() {
  // based on path, display selected list
  const url = window.location.pathname;
  let list = [];

  if (url.indexOf('/about') >= 0) {
    list = require('../components/shelf/about.json');
  } else if (url.indexOf('/docs') >= 0) {
    list = require('../components/shelf/documentation-list.json');
  } else if (url.indexOf('/getting-started') >= 0) {
    list = require('../components/shelf/getting-started-list.json');
  } else if (url.indexOf('/plugins') >= 0) {
    list = require('../components/shelf/plugins.json');
  }

  this.shelfList = list;
}

Details

This is only permitted because webpack allows it, but browser code should only be using browser APIs, like import / export.

The project should be made to support import() syntax and remove any usage of NodeJS specific code, like require in the shelf.

@thescientist13 thescientist13 added chore unit testing, maintenance, etc website Tasks related to the projects website / documentation labels Jan 17, 2020
@thescientist13 thescientist13 changed the title remove require calls from the shelf add support for dynamic imports Feb 12, 2020
@thescientist13 thescientist13 added the enhancement Improve something existing (e.g. no docs, new APIs, etc) label Feb 12, 2020
@thescientist13 thescientist13 added the v0.5.0 Data w/ GraphQL label Mar 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore unit testing, maintenance, etc enhancement Improve something existing (e.g. no docs, new APIs, etc) v0.5.0 Data w/ GraphQL website Tasks related to the projects website / documentation
Projects
None yet
2 participants