{"id":16765227,"url":"https://github.com/devlato/proposal-from-import","last_synced_at":"2025-03-16T11:26:08.205Z","repository":{"id":68309296,"uuid":"129927134","full_name":"devlato/proposal-from-import","owner":"devlato","description":"Proposal for Python-like import syntax extension","archived":false,"fork":false,"pushed_at":"2018-04-20T09:13:16.000Z","size":5,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-22T23:26:55.693Z","etag":null,"topics":["ecmascript","ecmascript-proposal","ecmascript-syntax","es6","es7","esnext","javascript","proposal","proposals"],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/devlato.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-04-17T15:37:15.000Z","updated_at":"2021-07-17T14:05:13.000Z","dependencies_parsed_at":null,"dependency_job_id":"4f38424f-47f3-4e12-9779-88f77d669f71","html_url":"https://github.com/devlato/proposal-from-import","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devlato%2Fproposal-from-import","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devlato%2Fproposal-from-import/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devlato%2Fproposal-from-import/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devlato%2Fproposal-from-import/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/devlato","download_url":"https://codeload.github.com/devlato/proposal-from-import/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243859931,"owners_count":20359616,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ecmascript","ecmascript-proposal","ecmascript-syntax","es6","es7","esnext","javascript","proposal","proposals"],"created_at":"2024-10-13T05:28:48.928Z","updated_at":"2025-03-16T11:26:08.165Z","avatar_url":"https://github.com/devlato.png","language":null,"readme":"# proposal-from-import\n\nProposal for Python-like import syntax extension\n\n## Example\n\n```javascript\nfrom 'module' import defaultExport;\nfrom 'module' import { export1, export2 [, ...] };\nfrom 'module' import defaultExport, { export1, export2 [, ...] };\nfrom 'module' import defaultExport, { export1 as alias1, export2 as alias2 [, ...] };\nfrom 'module' import defaultExport, { export1, export2 as alias2 [, ...] };\nfrom 'module' import defaultExport, * as moduleName;\n```\n\n## Motivation\n\nThe [specification](https://www.ecma-international.org/ecma-262/6.0/#sec-imports) says that currently proposed syntax means static code import. \nThe actual module code is being imported before any code runs. \nThis approach gives ample possibilities for performing static checking. That's why advanced autocompletion features are possible.\nBut with current syntax it's not convinient to use the autocompletion features at all. \nUntil user typed a module name, a text editor cannot deduct what to complete.\nSo developer has to type at least `import from 'module'` and start typing braces after `import` word then to get autocompletion running. It doesn't feel so much convenient. \nThe Python-like syntax `from 'module' import ...` feels more organic way to import using autocompletion. So here comes this proposal to add support for this syntax too. The examples provided below show the main difference.\n\nIn this first example a developer has to type everything else before actually typing exported field names to get autocompletiong running.\n```javascript\nimport { Component } from 'react';\n```\n\nIn the second example a developer could just type an import statement in an organic left-to-right way. An editor will be able to identify the module name even before typing an opening brace, so autocompletion will run when expected.\n```javascript\nfrom 'react' import { Component };\n```\n\n## So... you want this instead of import ... from?\nNo. The proposal offers this syntax as an alternative to `import ... from` syntax, but not as a replacement. The semantics of this syntactical extension is totally the same as of usual `import ... from`.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevlato%2Fproposal-from-import","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevlato%2Fproposal-from-import","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevlato%2Fproposal-from-import/lists"}