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

Distribution / lib files missing since 1.14.0 #6747

Open
maerteijn opened this issue Dec 3, 2024 · 4 comments
Open

Distribution / lib files missing since 1.14.0 #6747

maerteijn opened this issue Dec 3, 2024 · 4 comments

Comments

@maerteijn
Copy link

Describe the bug
Since the release of 1.14.0, the web/dist/libs/editor and web/dist/libs/datamanager directories in the releases are empty.

1.14.0:
image

1.13.1:
image

This is also to be seen in the file size of the archives which can be downloaded:

1.14.0:
image

1.13.1:
image

Is there a reason why all the lib assets are not shipped anymore with the release?

@heidi-humansignal
Copy link
Collaborator

Hi there!

Thanks for reporting this! After discussing this with our engineering team, they were interested in your usecase. These files were removed as part of a change to the infrastructure of the package, which ultimately reduced the package size by about 20MB, as we moved it into a monorepo approach. Can you describe what you were utilizing those files for?

Thanks,

Tyler Conlee
Head of Support
HumanSignal

Comment by Tyler Conlee
Workflow Run

@maerteijn
Copy link
Author

maerteijn commented Dec 11, 2024

Hi @heidi-humansignal,

Thank you for your message!

We use the stand alone editor in one of our projects, and we directly include these built assets from the lib/editor directory:

<html>
...
<script src="main.js"></script>
<link rel="stylesheet" href="main.css">
...
</html>

Then we can directly use the editor by using the following (as in the documentation) without any frontend building:

var labelStudio = new LabelStudio("editor", options);

I'd happy to know how this should be done now (and this might be useful to add in the documentation?)

@maerteijn
Copy link
Author

So after diving into the source code / project I managed to build a stand-alone version of the editor myself with the following command:

~/Dev/label-studio/web((1.14.0.post0))$ MODE=standalone npx nx run editor:build:production

I then needed to copy the following files:

- dist/libs/editor/715.js
- dist/libs/editor/743.js
- dist/libs/editor/main.js
- dist/libs/editor/main.css

And include the js as a module:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <link rel="stylesheet" href="./main.css">
</head>

<body>
    <div id="lsf"></div>
    <script type="module">
        const labelStudio = new LabelStudio("lsf", {...});
    </script>
    <script src="./main.js" type="module"></script>
</body>
</html>

So without the library files inside the package, is this the "new supposed way" to do it? I've seen the lsf:serve command in package.json is doing something similar for booting up a LSF standalone editor:

FRONTEND_HOSTNAME=http://localhost:3000 MODE=standalone nx run editor:serve:development

If this makes sense, could we add a lsf:build command to package.json so this is at least a sort of "known" command?

@heidi-humansignal
Copy link
Collaborator

Hi there!

I'll pass that feedback along to the team internally! Should our product team decide to move forward with your suggestion, we'll keep you informed of any updates. Please be aware that submitting a request does not ensure its implementation or a quick turnaround time. We appreciate your understanding and support.

Thanks,

Tyler Conlee
Head of Support
HumanSignal

Comment by Tyler Conlee
Workflow Run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants