Using the fetch shim does not work in BTR's jsdom renderer when not building legacy
- Dominant language
- TypeScript
- Stars
- 4
- Forks
- 16
- PR merge metrics
- No merged PRs in 30d
Description
**Bug**
Dojo's fetch shim does not work with modern (the default setting) builds when using the jsdom renderer in BTR. Current in the modern setting fetch is statically set to "true" but this is not the case in a jsdom environment. As we do not want to do anything different build wise just for BTR we should consider allowing `fetch` to behave like the other browser api shim's such as intersection observer. This is to actually allow the sniff at runtime and load and register the shim if the environment requires. The fetch shim is a separate bundle already so this would not increase the amount of js loaded/parsed for an application unless the user environment did not have fetch (which is none of the modern browsers).
Contributor guide
Research direction
No files, tests, or entry points are named. Start by tracing BTR's jsdom renderer and the modern-build handling of the fetch shim, then compare it with the existing browser API shims. Done means the fetch shim can sniff the runtime and load or register when jsdom lacks fetch without changing the build output for normal modern browsers.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript, webpack
- Domain
- build-system, testing
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100