Skip to content

Build: Require extensions for ES6 imports, prevent import cycles #4544

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

Merged
merged 2 commits into from
Nov 25, 2019

Conversation

mgol
Copy link
Member

@mgol mgol commented Nov 20, 2019

Summary

jQuery source is now authored in ECMAScript modules. Native browser support for
them requires full file names including extensions. Rollup works even if import
paths don't specify extensions, though, so one import slipped through without
such an extension, breaking native browser import of src/jquery.js.

A new ESLint rule using eslint-plugin-import prevents us from regressing on that
front.

Ref gh-4541
Ref 0753201

EDIT: Also, make sure we don't have import cycles in src/

eslint-plugin-import's no-cycle rule is used for cycle detection.

Checklist

jQuery source is now authored in ECMAScript modules. Native browser support for
them requires full file names including extensions. Rollup works even if import
paths don't specify extensions, though, so one import slipped through without
such an extension, breaking native browser import of src/jquery.js.

A new ESLint rule using eslint-plugin-import prevents us from regressing on that
front.

Ref jquerygh-4541
Ref 0753201
@mgol mgol added this to the 4.0.0 milestone Nov 20, 2019
@mgol mgol self-assigned this Nov 20, 2019
eslint-plugin-import's no-cycle rule is used for cycle detection.
@mgol mgol removed the Needs review label Nov 25, 2019
@mgol mgol changed the title Build: Require extensions for ES6 imports in src/ Build: Require extensions for ES6 imports, prevent import cycles Nov 25, 2019
@mgol mgol merged commit 44ac8c8 into jquery:master Nov 25, 2019
@mgol mgol deleted the rollup-require-extensions branch November 25, 2019 19:16
@lock lock bot locked as resolved and limited conversation to collaborators Jun 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

Successfully merging this pull request may close these issues.

1 participant