-
Notifications
You must be signed in to change notification settings - Fork 216
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
Fix for dynamic imports in Vite apps so tiles render #5502
Conversation
Something special about this dynamic import that makes it different from our various other dynamic imports, or are they also ticking time bombs?
|
Have we checked why Vite behaves this way and if it's expected? |
This pkg in particular, itwin/object-storage-azure, is a cjs pkg; and this seems to be an issue in vite only when dynamically importing cjs, see issue
AFAIK, no one is using Vite to bundle their backends, so we should be ok with these
This should be ok, as we deliver esm ver of core-frontend
loaders.gl/draco delivers esm, so this should be safe. @johnnyd710 is testing this to verify
These are comments, and the ExtensionAPI should be able to handle cjs modules (which i imagine would still be rare)
Should be ok, used for the side-effect |
Know of any plans to deliver esm? @paulius-valiunas @austeja-bentley |
loaders.gl/draco delivers esm, so this should be safe. @johnnyd710 is testing this to verify Confirmed, I can use |
This will be tricky, this pkg delivers both backend and frontend apis. I would like to rethink this pkg during the 4.x generation |
We have not thought about delivering ESM modules yet. If there is a need for this, let's have a call sometime to discuss the details and time frames. |
Yes, I believe this is very much needed... CJS is obsolete, we even wanted to move iTwin.js Core to ESM in 4.0 but didn't have enough time to fix our tests. And because ESM is async, it would be easier if all our dependencies already supported ESM (including object-storage). |
[I realize this PR has already merged, so i'm hoping this question will be found]. How did this problem affect iTS? As far as I understand, the current design is that desktop apps will only display tiles they generate, not ones loaded from cloud storage. What is the long term plan for that? I ask because i think we need a different plan for cloud storage for tiles than using an account key. @pmconne @wgoehrig |
There are long outstanding issues with Vite, see, where dynamic imports behave differently between development and production builds.
See our users reporting issues: #5185