Breaking changes:
-
Update project and deps to PureScript v0.15.0 (#171 by @JordanMartinez)
-
Update all request functions to take a driver arg (#171 by @JordanMartinez)
Affjax works on the Node.js and browser environments by relying on a
require
statement within a function. Depending on the environment detected,
eitherXHR
orXmlHttpRequest
is used. Since ES modules do not allow
one to callimport
within a function in a synchronous way,
we cannot continue to use this approach.Rather, all request-related functions (e.g.
request
,get
, etc.) now take
as their first argument anAffjaxDriver
value. Different environments
will pass in their implementation for that driver and re-export
the functionality defined inaffjax
.To fix your code, depend on the corresponding library below and update the imported
module fromAffjax
toAffjax.Node
/Affjax.Web
:- If on Node.js, use
purescript-affjax-node
. - If on the brower, use
purescript-affjax-web
.
- If on Node.js, use
Other improvements:
- Added
purs-tidy
formatter (#167 by @thomashoneyman)