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

[Feature Request] Add ECMAScript module version to the releases #7927

Closed
mishamosher opened this issue Jul 22, 2019 · 14 comments
Closed

[Feature Request] Add ECMAScript module version to the releases #7927

mishamosher opened this issue Jul 22, 2019 · 14 comments
Assignees
Labels
framework Issues and Feature Requests that have needs framework-wide. T: feature A new feature
Milestone

Comments

@mishamosher
Copy link

mishamosher commented Jul 22, 2019

Problem to solve

Right now all the modern major browsers have support for ECMAScript Modules (ESM for short).

It would be awesome if Vuetify released an ESM like vue's vue.esm.browser.js.

I'd success packing the NPM release of Vuetify as an ESM with the help of Pika Web, and it works just fine for my needs. Obviously, I would prefer an official ESM release.

Proposed solution

I am not a fan of transpilers (TypeScript, SASS, etc., babel). Plain ECMAScript 2016+ and CSS has been enough for my needs this far.

The previous is the reason why I'm unable to easily thinker of a proposed solution for an ESM release of Vuetify, other than using Pika Web.

@ghost ghost added the S: triage label Jul 22, 2019
@mlebrasseur
Copy link

I'm using ECMAScript Modules everyday. If you guys release a Vuetify ESM, alot of people with use it including me (I'm waiting for this since the release of Vuejs ESM). 👀

@jacekkarczmarczyk jacekkarczmarczyk added the framework Issues and Feature Requests that have needs framework-wide. label Aug 1, 2019
@jdelrue
Copy link

jdelrue commented Oct 18, 2019

Please release this

@mishamosher did you succeed using vuetify2? How?

@mishamosher
Copy link
Author

@jdelrue I've only tried Pika Web with Vuetify2.

You'll need NodeJS.

Run this in a terminal:

mkdir VuetifyESM && cd VuetifyESM
echo {} > package.json
npm i vue vuetify
npm i @pika/web --save-dev
npx pika-web

You'll find the Vuetify ESM script inside the web_modules directory (vuetify.js).

@sfaut
Copy link

sfaut commented Feb 2, 2020

It would be great to have a Vuetify ES Module Browser Build like Vue do :

import Vue from "https://unpkg.com/vue@2.6.11/dist/vue.esm.browser";
import Vuex from "https://unpkg.com/vuex@3.1.2/dist/vuex.esm.browser";
import VueRouter from "https://unpkg.com/vue-router@3.1.5/dist/vue-router.esm.browser";
import Vuetify from "https://i-have-a-dream/vuetify@42/dist/vuetify.esm.browser";

https://vuejsdevelopers.com/2019/02/04/vue-es-module-browser-build/

@florealcab
Copy link
Contributor

All our code is with ES Modules, so it will so good to have an official build of vuetify for that! Waiting for that, I use the solution of @mishamosher that seems to work

@ggedde
Copy link

ggedde commented May 28, 2020

I would love to see this in V3 so I can use it with Vite!

@mishamosher
Copy link
Author

mishamosher commented Jun 15, 2020

A lot has changed since the initial release of Pika Web. Its CDN is now able to offer ESM versions for a lot more of JavaScript libraries, Vuetify included.

As an example, https://cdn.pika.dev/vuetify@2.3.0 offers an ESM for Vuetify version 2.3.0.

Its not perfect though, as there are some oddities (skypackjs/skypack-cdn#18).

Also, there was a discussion about an ESM version for Buefy here: buefy/buefy#1662. Maybe a similar approach is possible in Vuetify?

@DRoet
Copy link
Contributor

DRoet commented Jun 15, 2020

Currently webpack doesn't allow us to export as ESM, so we either have to wait untill webpack 5 comes out and supports it, or move to rollup to bundle this library

@Zony-Zhao
Copy link

@DRoet webpack or vue-cli is not the only choice! I'm using vite, which only works with ESM. If possible, make the vue3 release with ESM and the webpack way together.

@DRoet
Copy link
Contributor

DRoet commented Oct 21, 2020

Vite is basically just rollup under the hood when bundling for production, an ESM build might come with the V3 release of Vuetify

@KaelWD
Copy link
Member

KaelWD commented Oct 21, 2020

We'll probably use webpack 5 now that it's out.

@DRoet
Copy link
Contributor

DRoet commented Oct 21, 2020

webpack 5 still does not support libraryTarget: 'module' but hopefully soonTM, plenty of time left until the V3 release 😄

@Djaler
Copy link
Contributor

Djaler commented Jun 17, 2022

@KaelWD is there any chance to backport esm build for Vuetify 2?
I tried to replace jest with vitest in my vue 2 + vuetify 2 project, but looks like vitest requires esm build and type: module or .mjs extension of files

@kingyue737
Copy link
Contributor

Vue2.7 now has esm builds, but Vuetify 2 import cjs version, which results into multiple vue error in vitest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
framework Issues and Feature Requests that have needs framework-wide. T: feature A new feature
Projects
None yet
Development

No branches or pull requests