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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vite plugin for aurelia 1.x? #1901

Open
obedm503 opened this issue Feb 6, 2024 · 4 comments
Open

Vite plugin for aurelia 1.x? #1901

obedm503 opened this issue Feb 6, 2024 · 4 comments
Labels
Topic: v1 Issues related to v1 backwards compatibility Vite plugin

Comments

@obedm503
Copy link

obedm503 commented Feb 6, 2024

馃檵 Feature Request

Are there any plans to get the vite plugin working for aurelia 1 apps? We're currently using a webpack config that only gets more messy as time goes by. Moving to vite would give us significant more development speed and a simpler configuration overall.

@bigopon
Copy link
Member

bigopon commented Feb 7, 2024

The webpack plugin for v1 does a few things:

  • scan dependencies (PLATFORM.moduleName, , etc...)
  • map build time module location to a runtime time understandable map (Origin, view convention etc...)
  • preserve and obsfucate the right exports
  • work in harmony with otger plugins

There maybe more that I dont remember but its a lot of work, difficult work to replicate as another bundler plugin.
The work of creating a map of modules at build time that runtime can work with is not easy, or straight forwards., since Vite, or Rollup concatenates/hoist all modules in the same chunk together.

That said, its possible to support Vite or any bundler if we are to use static dependency declaration of v1, instead of module name, we use the resources directly. This feature isnt doc'd because its not in its complete form: v1 router support isnt implemented yet.
Ideally we need to have the following supported in router:

viewModel: () => MyComponent

Instead of its current string based for module name form.

So my answer would be it depends: whether we can have time and resources to implement this feature in the v1 router or not.

@bigopon bigopon added Topic: v1 Issues related to v1 backwards compatibility Vite plugin labels Feb 7, 2024
@ghiscoding
Copy link
Contributor

If this is for Aurelia 1, shouldn't this be in aurelia/framework? This doesn't seem to belong in here since it's not Au2 related

@obedm503
Copy link
Author

It's here because it should be part of the migration path to v2

@bigopon
Copy link
Member

bigopon commented May 12, 2024

Currently there's not really a way to write v1 app in a rollup based setup (at least officially), so I think we can safely assume apps will be migrating from webpack to webpack, or dumber to dumber, or jspm to jspm. I would not suggest migrating webpack/dumber/jspm to vite in 1 go, at least I wouldn't do it myself, a lot of funny conversations could happen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Topic: v1 Issues related to v1 backwards compatibility Vite plugin
Projects
None yet
Development

No branches or pull requests

3 participants