GregYankovoy / vue-cli-plugin-bootstrap-vue

vue-cli 3 plugin to add bootstrap-vue
MIT License
34 stars 2 forks source link

updates to service and generator #1

Closed tmorehouse closed 5 years ago

tmorehouse commented 5 years ago

I was just getting ready to create a vue cli plugin at the Bootstrap-Vue repository, when I found this one (which is already published on NPM as vue-cli-plugin-bootstrap-vue and couldn't publish ours)

I've added in a few tweaks that were in the one we were developing.

Also includes the new updated BootstrapVue logo (as the current logo used wasn't BootstrapVue's logo)

GregYankovoy commented 5 years ago

Everything looks good except the @latest tag. Latest version of @vue/cli does not seem to accept it as a valid version, and as a result does not append it to the package.json dependencies section.

Test steps:

  1. Pulled your branch
  2. Created new vue-cli project via "vue create testproj"
  3. Added vue-cli-plugin-bootstrap-vue via npm install --save-dev yourBranch
  4. vue invoke vue-cli-plugin-bootstrap-vue
  5. Console outputs the below WARN invalid version range for dependency "bootstrap-vue": @latest injected by generator "vue-cli-plugin-bootstrap-vue"
tmorehouse commented 5 years ago

Interesting on the @latest (which works in regular package.json files).

It is a shame to tie it to the ^2.0.0-rc.xx versions, as usually yarn upgrade (or similar) will not update to the non rc.xx release when it becomes available (hopefully within the next few weeks or so we should be at 2.0.0 stable).

GregYankovoy commented 5 years ago

Agreed that it's a bit of a shame. I wonder if the motivation has to do w/ how the vue-cli works, encouraging people to upgrade via the vue-cli toolset (or if they just haven't adapted to the @latest tag yet).

Should we hold off on any changes until the project reaches a stable version? Perhaps we want to explore a complete overhaul. I noticed vuetify supports automatic a la carte via their "vuetify-loader".

tmorehouse commented 5 years ago

I based some of my code off of Vuetify, Element, and a few others (I must admit I am new to Vue CLI 3), and have also some presets (i.e using SCSS vs CSS, which would need a custom SCSS file and sass-loader), and options for aliasing the Vue import (so that PortalVue/BoostrapVue/and others) import the same Vue module (to prevent $listeners is readonly errors) allowing selection between runtime/runtime+compiler and the new 2.6.x esm builds.

We don't have a direct equvalent to their a-la-carte mode, but we do have options for importing only the config setting module (without needing to load the entire BootstrapVue library). users would need to import components where they need them). Or we could have an option to do selective component group plugin imports, like we have with the Nuxt.js module.

tmorehouse commented 5 years ago

2.0.0-rc.20 will be out this week, and the next RC release will have the new tooltip/popover components (using PortalVue), and once the bugs are out of those two, we should have 2.0.0 stable.

GregYankovoy commented 5 years ago

Sounds fairly soon then. Would you rather I keep the main branch up to date with the RC's until everything is ready? Or do you want to push through some of your vue.config.js & logo changes in the interim?

I'm okay either way so just let me know and we can work to get them tied into master.

tmorehouse commented 5 years ago

We're updating the logo in RC.20, so it would be nice to match that, and the added component src prop resolving is a bonus that will be good for many users.

You can change back to ^2.0.0-rc.19 for the version instead of @latest

tmorehouse commented 5 years ago

Once I get a bit more time, I'll pass some vue-cli code ideas by you to see what you think or what can be improved.

tmorehouse commented 5 years ago

Just noticed that vue-cli auto include selective babel polyfils https://cli.vuejs.org/guide/browser-compatibility.html#polyfills

I'm wondering if the injection of the @babel/polyfil import is needed or not in the plugin? if not then it can be removed, but should still have an option to include Mutation Observer shim (needed for IE 11 support, and a few other older browsers)

GregYankovoy commented 5 years ago

If I recall correctly, this config of the babel polyfill was necessary for vuetify & bootstrap-vue. I believe the issue is that in some situations the necessary polyfills don't get included for IE11 (resulting in a white screen).