- Don't crash when running in browser environments.
- Define properties for
global.location
andglobal.document
rather than setting them. This avoidsTypeError
s on Electron.
- Null safety release.
- Fixes detection on Electron with
nodeIntegration
disabled
Hotfix again for Electron support, quite embarassing at this point. Verified using the awesome Electron Fiddle tool.
- Change behavior of Node.js detection that now takes into account:
- Web workers in browser
- Electron
- Fixed previous build
1.4.7
when minified file is used.
Thanks! @lexaknyazev
- Move
url
module import to Node.js-only block. - Fix for when we try to load
url
on Node.js but are also using Webpack.
- Make
location.href
compatible with Node versions earlier than 10.12.0 again.
-
Improve
location.href
so that Dart'sUri.current
works for more paths.- Make
location.href
a getter so Dart'sUri.current
changes along with the process's working directory.
- Make
-
Fixes for Angular 6+ applications using compiled Dart package w/ preamble:
- Checks for global if it's not polyfilled, then try for window.
- Don't assume that since we have CommonJS we have process, __dirname, __filename.
- Explicitly support Dart 2 stable releases.
- Add Node detector for Browserify/Webpack-type environments. (thanks to @lexaknyazev for reporting!)
- Add examples for pub (thanks @bcko!)
- Keep
Uri.base
up to date when the current working directory changes. - Add .dart_tool to gitignore.
- Make sure to replace all backslashes for cwd on Windows, not just the first.
- Add __dirname and __filename to exposed globals. Adds ability of exposing more
globals in the preamble by calling
getPreamble(additionalGlobals: ["__dirname", ...])
.
- Add minified versions of the preamble accessible as
lib/preamble.min.js
and by callinggetPreamble(minified: true)
.
- Prevent encapsulation,
global.self = global
(old) vs.var self = Object.create(global)
(new).
-
Set
global.location
so thatUri.base()
works properly on Windows in most cases. -
Define
global.exports
so that it's visible to the compiled JS.