Skip to content

Conversation

@ErykKul
Copy link

@ErykKul ErykKul commented Dec 5, 2025

What this PR does / why we need it:

This PR adds DVWebloader V2 - a modern file uploader that reuses the file upload components from the dataverse-frontend SPA instead of maintaining a separate codebase.

Why V2?

  • Code reuse: V1 duplicates upload logic that already exists in dataverse-frontend
  • Feature parity: Automatically benefits from improvements to the SPA's file uploader
  • Maintainability: Single source of truth for upload functionality
  • Modern stack: React, TypeScript, and the dataverse-client-javascript library

What's included:

  • src/dvwebloaderV2.html - HTML entry point with configuration
  • src/lib/dvwebloader-v2.js - Pre-built standalone bundle (~1.5MB)
  • src/lib/locales/ - Translation files (shared.json only)

Dependencies (Related PRs):

This V2 bundle is built from the following upstream changes (pre-built bundle included, so no merge required):

  1. dataverse-frontend - #898: Feature/standalone file uploader

    • Adds the standalone uploader build system (npm run build-uploader)
    • Exports FileUploaderPanelCore as a reusable component
    • Adds StandaloneFileUploaderPanel thin wrapper for standalone mode
  2. dataverse-client-javascript - #403: feat: add configurable file upload options

    • Exports FilesConfig class for runtime configuration
    • Allows disabling S3 tagging for storage backends that don't support it
    • Configurable retry count and upload timeout

Note: The pre-built bundle in src/lib/ includes all dependencies, so this PR works independently without waiting for the upstream PRs to be merged.

How to use:

<!-- Configuration (set before bundle loads) -->
<script>
    window.dvWebloaderConfig = {
        useS3Tagging: true,      // Set false for S3 backends without tagging support
        maxRetries: 3,
        uploadTimeoutMs: 0,      // 0 = no timeout
        disableMD5Checksum: false
    };
</script>
<script type="module" src="lib/dvwebloader-v2.js"></script>

Open with URL parameters:

dvwebloaderV2.html?siteUrl=https://your-dataverse.edu&datasetPid=doi:10.5072/FK2/XXXXX&key=YOUR_API_KEY

V1 vs V2:

Feature V1 V2
Codebase Standalone JavaScript Reuses dataverse-frontend components
Upload logic Custom implementation Uses dataverse-client-javascript
UI Custom HTML/CSS Dataverse Design System
Maintenance Separate updates needed Inherits SPA improvements
Bundle size ~50KB ~1.5MB (includes React + UI library)

Notes:

  • V1 files remain in src/ for backward compatibility
  • V2 files are in src/lib/ (bundle) and src/dvwebloaderV2.html
  • To rebuild V2 bundle: use npm run build-uploader in dataverse-frontend

@ErykKul ErykKul marked this pull request as draft December 5, 2025 18: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.

1 participant