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

feat: add nativeNodeModules property to output #433

Merged
merged 6 commits into from
Apr 20, 2021

Conversation

eduardoboucas
Copy link
Member

- Summary

This PR adds a nativeNodeModules property to the return value of zipFunction and zipFunctions with any native modules detected as part of the logic added in #418. This object has the following shape:

{
  "nativeNodeModules": {
    "module name": {
      "/full/path/to/the/module": "version (e.g. 1.0.0)"
    }
  }
}

With this property, we'll be able to show warnings in the CLI whenever the user is about to locally build and deploy a function with native modules.

Note that this currently only works when building with esbuild. Given that we're making it the new default in less than a month, I'm not sure the effort of adding this detection to the legacy bundler is worth the trouble, but I'm happy to discuss this.

- Test plan

Adjusted existing tests.

- Description for the changelog

- A picture of a cute animal (not mandatory but encouraged)

giant_panda_mei_xiang_enjoys_her_afternoon_nap_at_the_national_zoo_in_washington_on_aug_23_2007 _reuters

@eduardoboucas eduardoboucas added the type: feature code contributing to the implementation of a feature and/or user facing functionality label Apr 20, 2021
@github-actions
Copy link
Contributor

github-actions bot commented Apr 20, 2021

⏱ Benchmark results

Comparing with d31d739

  • largeDepsEsbuild: 11.4s ⬇️ (0.92% decrease)
  • largeDepsZisi: 1m 5.6s ⬇️ (7.27% decrease)

Copy link
Contributor

@ehmicky ehmicky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Note: CI tests are failing on Node 8

@eduardoboucas
Copy link
Member Author

👍

Note: CI tests are failing on Node 8

Working on that. ⏳

@eduardoboucas eduardoboucas merged commit cfec60f into main Apr 20, 2021
@eduardoboucas eduardoboucas deleted the feat/native-module-replacement branch April 20, 2021 18:13
Skn0tt pushed a commit to netlify/build that referenced this pull request May 21, 2024
…ship-it#433)

* feat: add function name to output of zipFunction and zipFunctions

* feat: add detected native node modules to return value

* chore: disable tests for Node 8

* chore: add debug statement

* chore: remove debug statement
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: feature code contributing to the implementation of a feature and/or user facing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants