Skip to content
This repository has been archived by the owner on May 24, 2019. It is now read-only.

Use pirates for interoperability with other require hooks #62

Merged
merged 1 commit into from
Feb 19, 2019

Conversation

anandthakker
Copy link

Per standard-things/esm#119, this PR uses pirates to register the require hook instead of patching it in directly.

Advantage: better interoperability with other require hooks
Disadvantage: adds a (small) dependency

anandthakker pushed a commit to mapbox/mapbox-gl-js that referenced this pull request Feb 27, 2018
anandthakker pushed a commit to mapbox/mapbox-gl-js that referenced this pull request Feb 27, 2018
anandthakker pushed a commit to mapbox/mapbox-gl-js that referenced this pull request Feb 28, 2018
anandthakker pushed a commit to mapbox/mapbox-gl-js that referenced this pull request Mar 1, 2018
anandthakker pushed a commit to mapbox/mapbox-gl-js that referenced this pull request Mar 6, 2018
anandthakker pushed a commit to mapbox/mapbox-gl-js that referenced this pull request Mar 7, 2018
anandthakker pushed a commit to mapbox/mapbox-gl-js that referenced this pull request Mar 7, 2018
anandthakker pushed a commit to mapbox/mapbox-gl-js that referenced this pull request Mar 9, 2018
anandthakker pushed a commit to mapbox/mapbox-gl-js that referenced this pull request Mar 11, 2018
anandthakker pushed a commit to mapbox/mapbox-gl-js that referenced this pull request Mar 12, 2018
anandthakker added a commit to mapbox/mapbox-gl-js that referenced this pull request Mar 12, 2018
* [codemod] convert src/ from commonjs to es6 modules

Using 5to6-codemod/transforms/{cjs,exports,named-export-generation}.js

* [codemod] convert bench/ to use import instead of require()

5to6-codemod/transforms/cjs.js

* [codemod] Convert util.* to use named imports

https://gist.github.com/anandthakker/b636ad8cb7782c47998c4de9c0c5419d

* Setup rollup

* Manual es6 module fixes

* Fix(ish) codegen

* Apply fixed codegen

* Add flow-remove-types require hook using pirates

Upstream: facebookarchive/flow-remove-types#62

* Update docs site to use es module import

* Upgrade batfish

* Update benchmarks build

* Update style-spec build

* [codemod] Convert test/unit to use import instead of require

5to6 cjs transform

* Workaround for standard-things/esm#301

* Add scripts to run node/tap with require hooks

* [codemod] test/unit no-strict

* Avoid @std/esm 'temporal dead zone' warning

* Fixup unit tests

* Add comments explaining bundling strategy

* Update integration test suite implementation

* Update yarn.lock

Specifically for zaach/jsonlint#103 (comment)

* Polish build

- Remove browserify
- Update build tests

* [lint] Use sourceType: script for test/integration/

* [lint] Add eslint-plugin-import, fix lint in src/

* [lint] Fix lint in test/

* [lint] Fix lint in bench/

* [lint] Fix lint for docs/

* Fix rollup config warning

* Move rollup plugins to devDependencies

* Use @mapbox-scoped rollup while awaiting upstream merge

* Move comment in benchmarks.js

* Restore comments stripped by codemods

* Fix Style#queryRenderedFeature unit tests
@anandthakker
Copy link
Author

Ah, looks like pirates uses some es2015 features that aren't supported in node 0.10/0.12 🤷‍♂️

@jdalton
Copy link

jdalton commented Mar 14, 2018

Node 0.10 and 0.12 are no longer supported by Node and haven't been since 2016.

@motiz88
Copy link
Contributor

motiz88 commented Feb 15, 2019

We should definitely have this. Seems like it would be pretty safe to drop Node 0.10 and 0.12 support as part of the v2 release I'm planning. Thanks @anandthakker! Apologies for how long it's taken us to look at this PR.

@motiz88 motiz88 merged commit 65f108e into facebookarchive:v2 Feb 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants