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

WIP: Dynamically import #3

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft

WIP: Dynamically import #3

wants to merge 3 commits into from

Conversation

longshuicy
Copy link
Member

So far what i've manage to do is having a "index" that map which "previewType" corresponding to which "component";
Note for experimenting purpose, I just use local previewer component. But it should be easily switch to a peviewer component published on NPM.

Then at run time, a File can load corresponding previewer based on the previewType information on the file.

But im still having trouble to automatically generate that "index" file. Any thoughts @lmarini @ka7eh

import React from "react";

let previewerList = {
	"audio": React.lazy(() => import("./components/previewers/Audio.jsx")),
	"video": React.lazy(() => import("./components/previewers/Video.jsx")),
	"thumbnail": React.lazy(()=> import("./components/previewers/Thumbnail.jsx"))
}

export default previewerList

Is there a way i can automatically generate this previewerList?

@longshuicy longshuicy requested review from lmarini and ka7eh and removed request for lmarini and ka7eh September 23, 2021 21:47
@longshuicy longshuicy changed the base branch from master to develop October 8, 2021 19:17
longshuicy added a commit that referenced this pull request Oct 29, 2021
* audio as placeholder

* rewrite audio and video

* enable thumbnail previewer

* pagination works but needs polish

* next page works; not previous page

* bug
longshuicy added a commit that referenced this pull request Oct 29, 2021
* Rewrite previewers (#3)

* audio as placeholder

* rewrite audio and video

* enable thumbnail previewer

* pagination works but needs polish

* next page works; not previous page

* bug

* experimenting with rjsf to create upload component

* disable json loader since it's not working with rjsf

* should start with upload files

* connect upload widget to create dataset

* after create jump to that dataset page

* add options menu

* connect to add files

* file upload doesn't work... dont know whats wrong

* upload file works

* rewrite breadcrumb

* yay it's working

* split uploader to specific component

* close modal after creation

* add buttons

* add more buttons

* add delete dataset

* delete dataset

* delete file works

* fix bug

* add download dataset

* add download all inside dataset page

* download file works
@longshuicy longshuicy changed the base branch from develop to main November 10, 2021 22:48
@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@lmarini lmarini marked this pull request as draft March 9, 2022 22:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants