Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Core: Vite integration #495

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Core: Vite integration #495

wants to merge 2 commits into from

Conversation

50rayn
Copy link
Contributor

@50rayn 50rayn commented Nov 29, 2024

In this PR done a couple of things:

  • upgrade existing Vite modules to 6
  • in @unovis/ts package was replaced rollup with Vite

During integration, I met some misunderstandings, like:

Why in .npmrc do we have legacy-peer-deps=true?

Because of this flag, I could not install the latest version of vite-plugin-dts.

In @unovis/ts in tsconfig, do we have a lot of paths configured? Why?

It makes more ambiguous the imports in the files. You may not understand it's imported from a file, module, and alias. I'd add just one, "@/*": ["src/*"]. It's more common for most users.

I wanted to be sure that I could open some PRs for each of the mentions, but first of all, I need to be sure if it makes sense.

@rokotyan
Copy link
Contributor

rokotyan commented Dec 2, 2024

@50rayn Another great contribution, thanks!

The build looks good, but this dependencies should not be bundled:
image

Why in .npmrc do we have legacy-peer-deps=true?

To be honest, I don't remember. You can try removing it and see what happens.

In @unovis/ts in tsconfig, do we have a lot of paths configured? Why?

I agree with you. At the beginning of the project it was convenient this way but now it's not. We can change it to a single "@/*" alias.

@50rayn
Copy link
Contributor Author

50rayn commented Dec 2, 2024

Regarding both questions, I can do separate PRs. There, I'll check all the necessary changes.

About those dependencies, it is fixed by ignoring the node_modules from bundleing.

@50rayn 50rayn force-pushed the chore/unovis-ts-vite branch 2 times, most recently from c247790 to deaaffd Compare December 3, 2024 07:14
@rokotyan
Copy link
Contributor

rokotyan commented Dec 3, 2024

@50rayn Thanks! We're planning to release Unovis 1.5 soon. Will get back to this right after

@50rayn 50rayn force-pushed the chore/unovis-ts-vite branch from deaaffd to 4044248 Compare December 13, 2024 22:35
@50rayn 50rayn force-pushed the chore/unovis-ts-vite branch from 4044248 to 385d8ae Compare December 17, 2024 09:47
@lee00678
Copy link
Collaborator

Hi @50rayn, Thanks for the contribution!

There seems to be an issue with dynamic import moving from rollup to vite. I released a beta version [1.5.1-ql.2](https://www.npmjs.com/package/@unovis/ts/v/1.5.1-ql.2) from this branch and tested it in an angular project. Some of the following path (https://github.com/f5/unovis/blob/main/packages/ts/src/components/leaflet-flow-map/renderer.ts#L1-L9) didn't get resolved correctly.

@rokotyan
Copy link
Contributor

rokotyan commented Jan 30, 2025

Confirmed. There's a problem with imports that end with the .js extension, for example:
import { Color } from 'three/src/math/Color.js'. Once compiled they have the full local file system path:

import { Color as r } from "/Users/nikitarokotyan/unovis/node_modules/three/src/math/Color.js";

Update: Even if you remove the .js extension from the imports, the problem persist. So it's more related to how the commonjs modules are treated, but to the import syntax itself.

@50rayn
Copy link
Contributor Author

50rayn commented Feb 19, 2025

Thanks, @rokotyan and @lee00678, for the feedback.
I'll take a look.

@rokotyan
Copy link
Contributor

@50rayn I've tried to reconfigure the common js plugin a couple of times but without success. So now I'm out of ideas.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants