Skip to content
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

chore: delay _importDynamic initialization #1753

Merged
merged 3 commits into from
Oct 14, 2024

Conversation

jacobator
Copy link
Member

@jacobator jacobator commented Oct 7, 2024

What/Why/How?

We use some of @redocly/openapi-core util functions in Reunite.
_importDynamic is an eval function that is initialized in the root of config-resolvers module which violates content security policies in Reunite.
This PR delays _importDynamic init to a later time - avoiding it's initialization in Reunite completely.

Reference

https://github.com/Redocly/redocly/issues/11257

Testing

Screenshots (optional)

Check yourself

  • Code changed? - Tested with redoc/reference-docs/workflows (internal)
  • All new/updated code is covered with tests
  • New package installed? - Tested in different environments (browser/node)

Security

  • Security impact of change has been considered
  • Code follows company security practices and guidelines

Copy link

changeset-bot bot commented Oct 7, 2024

⚠️ No Changeset found

Latest commit: 0e5a1bd

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Contributor

github-actions bot commented Oct 7, 2024

Command Mean [ms] Min [ms] Max [ms] Relative
redocly lint packages/core/src/benchmark/benches/rebilly.yaml 976.7 ± 13.6 953.1 997.7 1.00 ± 0.02
redocly-next lint packages/core/src/benchmark/benches/rebilly.yaml 973.8 ± 15.3 951.5 998.3 1.00

Copy link
Contributor

github-actions bot commented Oct 7, 2024

Coverage report

St.
Category Percentage Covered / Total
🟡 Statements 78.56% 4993/6356
🟡 Branches 67.21% 2062/3068
🟡 Functions 72.98% 824/1129
🟡 Lines 78.85% 4711/5975

Test suite run success

809 tests passing in 121 suites.

Report generated by 🧪jest coverage report action from 0e5a1bd

@jacobator jacobator marked this pull request as ready for review October 14, 2024 09:19
@jacobator jacobator requested a review from a team as a code owner October 14, 2024 09:19
@jacobator jacobator force-pushed the chore/move-dynamic-import-from-global-scope branch from de1be12 to 0e5a1bd Compare October 14, 2024 09:20
@jacobator jacobator merged commit e16a927 into main Oct 14, 2024
42 checks passed
@jacobator jacobator deleted the chore/move-dynamic-import-from-global-scope branch October 14, 2024 10:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants