mirror of
https://github.com/hoppscotch/hoppscotch.git
synced 2026-04-26 01:06:00 +03:00
[PR #5433] [MERGED] fix(js-sandbox): resolve errors with pw.env namespace in legacy sandbox #5201
Labels
No labels
CodeDay
a11y
browser limited
bug
bug fix
cli
core
critical
design
desktop
discussion
docker
documentation
duplicate
enterprise
feature
feature
fosshack
future
good first issue
hacktoberfest
help wanted
i18n
invalid
major
minor
need information
need testing
not applicable to hoppscotch
not reproducible
pull-request
question
refactor
resolved
sandbox
self-host
spam
stale
testmu
wip
wont fix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/hoppscotch#5201
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/hoppscotch/hoppscotch/pull/5433
Author: @jamesgeorge007
Created: 10/3/2025
Status: ✅ Merged
Merged: 10/6/2025
Merged by: @jamesgeorge007
Base:
patch← Head:fix/legacy-js-sandbox-env-methods📝 Commits (2)
f7a9bacfix(js-sandbox): resolve errors with pw.env namespace in legacy sandbox4bc8867fix: add missingpw.envmethods in post-request types📊 Changes
2 files changed (+22 additions, -15 deletions)
View changed files
📝
packages/hoppscotch-common/src/types/post-request.d.ts(+3 -1)📝
packages/hoppscotch-js-sandbox/src/utils/shared.ts(+19 -14)📄 Description
The legacy scripting sandbox was returning environment methods as a flat object under
methods, requiring consumers to manually wrap them in anenvproperty. This inconsistency arose because the experimental sandbox uses bootstrap code (powered by faraday-cage) that defines thepw.envstructure, while the legacy sandbox doesn't.Also updates the post-request type definitions, accounting for missing
pw.envmethods. These are consumed by the Monaco-based scripting editors in the experimental scripting sandbox for IntelliSense.Closes FE-1026, FE-1027.
What's changed
getSharedEnvMethods()return type for legacy sandbox to wrap methods inenvproperty.methods: { env: { get, getResolve, set, unset, resolve } }.Notes to reviewers
Verify the relevant script execution flows in the legacy scripting sandbox, and that the issue being addressed is resolved.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.