NicolasPetton / Indium

A JavaScript development environment for Emacs
https://indium.readthedocs.io
GNU General Public License v3.0
1.13k stars 61 forks source link

Import statement outside a module #230

Closed dupuchba closed 4 years ago

dupuchba commented 4 years ago

Hello all,

First of all I'd like to thank Nicolas & contributors for this mode, I avoid really hard to write javascript but this mode make it a lot less painful.

I have a question about the workflow. Typically when I write clojure/elisp I have a REPL centric approach which is magic. I'd like to replicate to the max this approach but I don't see how :

Thanks all for your time

NicolasPetton commented 4 years ago

Baptiste DUPUCH notifications@github.com writes:

Hello all,

Hi!

Could you show us the code you're trying to evaluate?

Thanks, Nico

dupuchba commented 4 years ago

for e.g.

import Vue from 'vue';
import Router from 'vue-router';
import Home from './views/Home.vue';

Vue.use(Router);

const router = new Router({
  mode: 'history',
  routes: [
    {
      path: '/',
      name: 'home',
      component: Home,
    },
  ],
});
NicolasPetton commented 4 years ago

I see. Can you try evaluating the import in Chrome's console, and tell us if that works? If it works in Chrome, then it should work in Indium, otherwise it should be considered a bug.

dupuchba commented 4 years ago

It does not work in chrome dev tool. It is a Vuejs typical project. I am wondering if it is even possible :'(

dupuchba commented 4 years ago

Before closing this issue, have you ever make it work ? importing module from console/indium ? If so, is there a blank project that I can look at ?

NicolasPetton commented 4 years ago

TBH I never tried that.

dupuchba commented 4 years ago

Thanks a lot for your time and excellent mode ! I found a "trick" that match my need when working with Vuejs / Webpack project.

If you find a way to access Vue global object you can then call all the API and have a REPL workflow for checking/mutating state while testing your function ! In the Vuejs, when plugin is installed, you have the global object bind to $vm0