improve import syntax
It's too late to change the import syntax. The problem is your editor, not the syntax. Over time more editors will support import syntax, either directly or with plugins. For now, you just have to wait.
It's too late to change the import syntax. The problem is your editor, not the syntax. Over time more editors will support import syntax, either directly or with plugins. For now, you just have to wait. On Sun, Jul 31, 2016 at 3:38 AM, Ali Ghanavatian <ghanavatian.ali at gmail.com> wrote: > Hello there, > I am writing to express weak point currently affects the import syntax. As > you know current syntax is not editor (specially auto-complete) friendly as > editor would not have any clue about what is about to be imported and from > where. > > import { ComponentName } from 'path/to/module-file'; > > > My suggestion is to add support for this syntax: > > from 'path/to/module-file' import { ComponentName }; > > > Which makes auto-completion and development easier. > > I think it deserves a proposal, but it's my first idea. I really > appreciate any sort of guidance and suggestion about this issue and how to > put it into the standard. > > -- > Sincerely > A. Ghanavatian <http://www.google.com/profiles/ghanavatian.ali> > > _______________________________________________ > es-discuss mailing list > es-discuss at mozilla.org > https://mail.mozilla.org/listinfo/es-discuss > > -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20160731/09d570a3/attachment.html>
The syntax could stay the same while adding the other way as well. Yes it adds a complication but I don't know that auto complete friendliness was considered when adding the original syntax.
You can't really say the editor is the problem because there are cases in which an editor can't realistically guess where the imported item will be coming from for an auto complete but with the suggested changes it could as Ali suggests.
I would say making the syntax more auto complete friendly should be a topic to explore. Makes it easier for developers (which should be the goal of almost all standard changes).
The syntax could stay the same while adding the other way as well. Yes it adds a complication but I don't know that auto complete friendliness was considered when adding the original syntax. You can't really say the editor is the problem because there are cases in which an editor can't realistically guess where the imported item will be coming from for an auto complete but with the suggested changes it could as Ali suggests. I would say making the syntax more auto complete friendly should be a topic to explore. Makes it easier for developers (which should be the goal of almost all standard changes). On Jul 31, 2016 11:50 AM, "Frankie Bagnardi" <f.bagnardi at gmail.com> wrote: > It's too late to change the import syntax. The problem is your editor, not > the syntax. Over time more editors will support import syntax, either > directly or with plugins. For now, you just have to wait. > > On Sun, Jul 31, 2016 at 3:38 AM, Ali Ghanavatian < > ghanavatian.ali at gmail.com> wrote: > >> Hello there, >> I am writing to express weak point currently affects the import syntax. >> As you know current syntax is not editor (specially auto-complete) friendly >> as editor would not have any clue about what is about to be imported and >> from where. >> >> import { ComponentName } from 'path/to/module-file'; >> >> >> My suggestion is to add support for this syntax: >> >> from 'path/to/module-file' import { ComponentName }; >> >> >> Which makes auto-completion and development easier. >> >> I think it deserves a proposal, but it's my first idea. I really >> appreciate any sort of guidance and suggestion about this issue and how to >> put it into the standard. >> >> -- >> Sincerely >> A. Ghanavatian <http://www.google.com/profiles/ghanavatian.ali> >> >> _______________________________________________ >> es-discuss mailing list >> es-discuss at mozilla.org >> https://mail.mozilla.org/listinfo/es-discuss >> >> > > _______________________________________________ > es-discuss mailing list > es-discuss at mozilla.org > https://mail.mozilla.org/listinfo/es-discuss > > -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20160731/9d2dfbfc/attachment.html>
Oh I see your point. Still extremely unlikely the syntax will change.
Oh I see your point. Still extremely unlikely the syntax will change. On Sun, Jul 31, 2016 at 11:56 AM, Kris Siegel <krissiegel at gmail.com> wrote: > The syntax could stay the same while adding the other way as well. Yes it > adds a complication but I don't know that auto complete friendliness was > considered when adding the original syntax. > > You can't really say the editor is the problem because there are cases in > which an editor can't realistically guess where the imported item will be > coming from for an auto complete but with the suggested changes it could as > Ali suggests. > > I would say making the syntax more auto complete friendly should be a > topic to explore. Makes it easier for developers (which should be the goal > of almost all standard changes). > > On Jul 31, 2016 11:50 AM, "Frankie Bagnardi" <f.bagnardi at gmail.com> wrote: > >> It's too late to change the import syntax. The problem is your editor, >> not the syntax. Over time more editors will support import syntax, either >> directly or with plugins. For now, you just have to wait. >> >> On Sun, Jul 31, 2016 at 3:38 AM, Ali Ghanavatian < >> ghanavatian.ali at gmail.com> wrote: >> >>> Hello there, >>> I am writing to express weak point currently affects the import syntax. >>> As you know current syntax is not editor (specially auto-complete) friendly >>> as editor would not have any clue about what is about to be imported and >>> from where. >>> >>> import { ComponentName } from 'path/to/module-file'; >>> >>> >>> My suggestion is to add support for this syntax: >>> >>> from 'path/to/module-file' import { ComponentName }; >>> >>> >>> Which makes auto-completion and development easier. >>> >>> I think it deserves a proposal, but it's my first idea. I really >>> appreciate any sort of guidance and suggestion about this issue and how to >>> put it into the standard. >>> >>> -- >>> Sincerely >>> A. Ghanavatian <http://www.google.com/profiles/ghanavatian.ali> >>> >>> _______________________________________________ >>> es-discuss mailing list >>> es-discuss at mozilla.org >>> https://mail.mozilla.org/listinfo/es-discuss >>> >>> >> >> _______________________________________________ >> es-discuss mailing list >> es-discuss at mozilla.org >> https://mail.mozilla.org/listinfo/es-discuss >> >> -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20160731/de224fdb/attachment-0001.html>
You may be interested in www.npmjs.com/package/import-js.
You may be interested in https://www.npmjs.com/package/import-js. On Sun, Jul 31, 2016 at 12:05 PM, Frankie Bagnardi <f.bagnardi at gmail.com> wrote: > Oh I see your point. Still extremely unlikely the syntax will change. > > On Sun, Jul 31, 2016 at 11:56 AM, Kris Siegel <krissiegel at gmail.com> > wrote: > >> The syntax could stay the same while adding the other way as well. Yes it >> adds a complication but I don't know that auto complete friendliness was >> considered when adding the original syntax. >> >> You can't really say the editor is the problem because there are cases in >> which an editor can't realistically guess where the imported item will be >> coming from for an auto complete but with the suggested changes it could as >> Ali suggests. >> >> I would say making the syntax more auto complete friendly should be a >> topic to explore. Makes it easier for developers (which should be the goal >> of almost all standard changes). >> >> On Jul 31, 2016 11:50 AM, "Frankie Bagnardi" <f.bagnardi at gmail.com> >> wrote: >> >>> It's too late to change the import syntax. The problem is your editor, >>> not the syntax. Over time more editors will support import syntax, either >>> directly or with plugins. For now, you just have to wait. >>> >>> On Sun, Jul 31, 2016 at 3:38 AM, Ali Ghanavatian < >>> ghanavatian.ali at gmail.com> wrote: >>> >>>> Hello there, >>>> I am writing to express weak point currently affects the import syntax. >>>> As you know current syntax is not editor (specially auto-complete) friendly >>>> as editor would not have any clue about what is about to be imported and >>>> from where. >>>> >>>> import { ComponentName } from 'path/to/module-file'; >>>> >>>> >>>> My suggestion is to add support for this syntax: >>>> >>>> from 'path/to/module-file' import { ComponentName }; >>>> >>>> >>>> Which makes auto-completion and development easier. >>>> >>>> I think it deserves a proposal, but it's my first idea. I really >>>> appreciate any sort of guidance and suggestion about this issue and how to >>>> put it into the standard. >>>> >>>> -- >>>> Sincerely >>>> A. Ghanavatian <http://www.google.com/profiles/ghanavatian.ali> >>>> >>>> _______________________________________________ >>>> es-discuss mailing list >>>> es-discuss at mozilla.org >>>> https://mail.mozilla.org/listinfo/es-discuss >>>> >>>> >>> >>> _______________________________________________ >>> es-discuss mailing list >>> es-discuss at mozilla.org >>> https://mail.mozilla.org/listinfo/es-discuss >>> >>> > > _______________________________________________ > es-discuss mailing list > es-discuss at mozilla.org > https://mail.mozilla.org/listinfo/es-discuss > > -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20160731/bf349c4e/attachment.html>
My editor (emacs/tide) can auto-complete named imports as long as the module name is there on the line. I just type
import {} from './foo';
and then go back to insert things in the {}
and get auto-completion.
If your editor can't do that, file a feature request.
Bob
My editor (emacs/tide) can auto-complete named imports as long as the module name is there on the line. I just type ``` import {} from './foo'; ``` and then go back to insert things in the `{}` and get auto-completion. If your editor can't do that, file a feature request. Bob On Mon, Aug 1, 2016 at 12:19 AM, Frankie Bagnardi <f.bagnardi at gmail.com> wrote: > It's too late to change the import syntax. The problem is your editor, not > the syntax. Over time more editors will support import syntax, either > directly or with plugins. For now, you just have to wait. > > On Sun, Jul 31, 2016 at 3:38 AM, Ali Ghanavatian < > ghanavatian.ali at gmail.com> wrote: > >> Hello there, >> I am writing to express weak point currently affects the import syntax. >> As you know current syntax is not editor (specially auto-complete) friendly >> as editor would not have any clue about what is about to be imported and >> from where. >> >> import { ComponentName } from 'path/to/module-file'; >> >> >> My suggestion is to add support for this syntax: >> >> from 'path/to/module-file' import { ComponentName }; >> >> >> Which makes auto-completion and development easier. >> >> I think it deserves a proposal, but it's my first idea. I really >> appreciate any sort of guidance and suggestion about this issue and how to >> put it into the standard. >> >> -- >> Sincerely >> A. Ghanavatian <http://www.google.com/profiles/ghanavatian.ali> >> >> _______________________________________________ >> es-discuss mailing list >> es-discuss at mozilla.org >> https://mail.mozilla.org/listinfo/es-discuss >> >> > > _______________________________________________ > es-discuss mailing list > es-discuss at mozilla.org > https://mail.mozilla.org/listinfo/es-discuss > > -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20160801/3d344d9f/attachment.html>
Exactly Bob, that's the point. You would not have a list of components until you mention which file are you about to import, compare it with the alternative syntax: you mention the file and you get the list of component without any need to go back.
With the npm package, it is awesome but it could go wrong if there be files containing components with same name.
On Jul 31, 2016 23:55, "Bob Myers" <rtm at gol.com> wrote:
My editor (emacs/tide) can auto-complete named imports as long as the module name is there on the line. I just type
import {} from './foo';
and then go back to insert things in the {}
and get auto-completion.
If your editor can't do that, file a feature request.
Bob
Exactly Bob, that's the point. You would not have a list of components until you mention which file are you about to import, compare it with the alternative syntax: you mention the file and you get the list of component without any need to go back. With the npm package, it is awesome but it could go wrong if there be files containing components with same name. On Jul 31, 2016 23:55, "Bob Myers" <rtm at gol.com> wrote: My editor (emacs/tide) can auto-complete named imports as long as the module name is there on the line. I just type ``` import {} from './foo'; ``` and then go back to insert things in the `{}` and get auto-completion. If your editor can't do that, file a feature request. Bob On Mon, Aug 1, 2016 at 12:19 AM, Frankie Bagnardi <f.bagnardi at gmail.com> wrote: > It's too late to change the import syntax. The problem is your editor, not > the syntax. Over time more editors will support import syntax, either > directly or with plugins. For now, you just have to wait. > > On Sun, Jul 31, 2016 at 3:38 AM, Ali Ghanavatian < > ghanavatian.ali at gmail.com> wrote: > >> Hello there, >> I am writing to express weak point currently affects the import syntax. >> As you know current syntax is not editor (specially auto-complete) friendly >> as editor would not have any clue about what is about to be imported and >> from where. >> >> import { ComponentName } from 'path/to/module-file'; >> >> >> My suggestion is to add support for this syntax: >> >> from 'path/to/module-file' import { ComponentName }; >> >> >> Which makes auto-completion and development easier. >> >> I think it deserves a proposal, but it's my first idea. I really >> appreciate any sort of guidance and suggestion about this issue and how to >> put it into the standard. >> >> -- >> Sincerely >> A. Ghanavatian <http://www.google.com/profiles/ghanavatian.ali> >> >> _______________________________________________ >> es-discuss mailing list >> es-discuss at mozilla.org >> https://mail.mozilla.org/listinfo/es-discuss >> >> > > _______________________________________________ > es-discuss mailing list > es-discuss at mozilla.org > https://mail.mozilla.org/listinfo/es-discuss > > -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20160801/09c043bc/attachment-0001.html>
Hello there, I am writing to express weak point currently affects the import syntax. As you know current syntax is not editor (specially auto-complete) friendly as editor would not have any clue about what is about to be imported and from where.
import { ComponentName } from 'path/to/module-file';
My suggestion is to add support for this syntax:
from 'path/to/module-file' import { ComponentName };
Which makes auto-completion and development easier.
I think it deserves a proposal, but it's my first idea. I really appreciate any sort of guidance and suggestion about this issue and how to put it into the standard.