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

Move to ES6 modules #20

Open
petrbroz opened this issue Jan 22, 2024 · 4 comments
Open

Move to ES6 modules #20

petrbroz opened this issue Jan 22, 2024 · 4 comments
Labels
enhancement New feature or request

Comments

@petrbroz
Copy link
Member

Migrating the Node.js code to ES6 modules might not only make the code more up-to-date but also streamline the step-by-step tutorials. For example, if we want to add functionality into a Node.js file incrementally, instead of

const service = module.exports = {};

service.someFunction = async () => {
  // ...
};

service.anotherFunction = async () => {
  // ...
};

we can just do

export async function someFunction() {
  // ...
}

export async function anotherFunction() {
  // ...
}
@petrbroz petrbroz added the enhancement New feature or request label Jan 22, 2024
@AlexanderMelde
Copy link

AlexanderMelde commented Sep 16, 2024

It would also drastically improve the developer experience when using this in bundled apps, e.g. using Angular framework, Vite etc. Huge JS files like the viewer3D.js files are not something we really like to include in our apps as it breaks the usual pattern of managing dependencies in a package.json.

@petrbroz
Copy link
Member Author

Unfortunately, the Terms & Conditions at the top of viewer3D.js state that

The Autodesk Viewer SDK JavaScript must be delivered from an Autodesk-hosted URL.

So bundling the JavaScript SDK is not something we support.

@AlexanderMelde
Copy link

Yeah, we just saw that as well. Are there any plans that this is going to change in the future?

The rest of our app is offline compatible. Do you know of a more detailed statement regarding this?
What about caching the js file on the client (e.g. only downloading it during the first installation)?

@petrbroz
Copy link
Member Author

There are no plans to change this restriction as far as I know. Please see https://aps.autodesk.com/blog/disconnected-workflows for more details on how you can cache viewer assets in an official/supported way.

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