Here are the list of breaking changes when upgrading between instapack major (or minor) versions.
-
port2
option is no longer being used and is obsoleted. -
JS build: Exclude
/node_modules/
path from TypeScript, Vue, HTML and CSS loaders.-
Explanation: Secure, Contain and Protect projects against bundling UNCOMPILED (non-JS) libraries source code!
-
Example 1: Imagine someone wrote a
.vue
library in CoffeeScript + Less CSS, shipped it to npm, and expects consumers to compile the thing themselves. instapack will fail to compile that library despite supporting.vue
file. -
Example 2: Imagine someone wrote a
.ts
library, shipped it to npm, and expects only TypeScript users to import it as-is. He'd be right, except COMPILE ERROR! That library only can be compiled with a specific version of TypeScript2
and failed to be compiled with the latest TypeScript3
used by instapack for some reason. -
Example 3: Imagine someone shipped an unbundled JS library which automatically applies CSS when run. However, that library source code imports plain CSS files AND depends on YOUR specific webpack configuration to do the job... (Not independently unlike CSS-in-JS)
-
-
Sass language compiler service has been swapped to the primary Dart implementation!
- Aligned CSS
@import
syntax to the official specification: certain import queries (for example, paths ending with.css
) will be treated as ordinary CSS import.
- Aligned CSS
-
Removed
clean
command andconcat
build tools.- Legacy
angularjs
project template is now shipped with a simple concat tool (concat.cmd
), which can be adopted by projects requiring similar approach for side-loading IIFE JS.
- Legacy
-
Disable source map flag
--xdebug
or-x
has been replaced with--nodebug
or-b
-
Automatic resolution for
.html
modules is now disabled, for improved source code clarity. (You will need to explicitly write the extension when importing the file!)
- Importing
.vue.html
module is deprecated in favor of.vue
Single-File Components (which supports Hot Reload Development Mode) and will be removed in future versions!
-
TypeScript 3.0.1 notable breaking changes:
-
resolveJsonModule
regression: only works in when targeting AMDmodule
(fixed in TypeScript 3.1 / instapack 7.0.0)
-
Flag for disabling source map was changed from
-u
(uncharted
) to-x
(xdebug
). -
Sass can no longer
@import
_partial.scss files fromnode_modules
implicitly. (Behavior re-implemented in instapack 6.5.0)
- Node API now requires project folder path (root) as constructor parameter.
Modules imported from node_modules
will now be split automatically to [jsOut].dll.js
, for example: ipack.dll.js
-
This file must be included using
<script>
tag BEFORE the main app fileipack.js
-
Build speed should be improved, hopefully. (Trying to keep entry chunk size small...)
HTML template compilation mode in package.json
(string
vs vue
) has been removed in favor of special extension .vue.html
to:
-
Allow a project to have both stringified HTML and pre-compiled Vue.js HTML.
-
Simplify instapack, to make it more beginner-friendly by reducing the number of obscure options and templates...
In light of the final version of AngularJS 1.7 LTS, it is recommended for newer projects to use Vue.js / React / Inferno instead.
-
Therefore,
angular-material
template has been removed andangular-bootstrap
template has been renamed toangularjs
-
jQuery has been re-added into
angularjs
template to improve compatibility with legacy browsers, especially with Bootstrap 3.
Unfortunately, the enterprise world is not ready for JavaScript running natively in ES2015 and beyond...
The no-longer-maintained UglifyES has been dropped in exchange for the hopefully-more-stable UglifyJS 3. This change imposes stricter build requirements:
-
Only
es5
buildtarget
(set intsconfig.json
) is currently supported. Setting ES2015+ as build target WILL cause build error! -
Attempting to import a non-TypeScript ES2015+ module will fail the build! This downgrade guards the project against ninja browser incompatibilities.
-
Our supported Node.js runtime is now the latest version 8 LTS.
-
Node.js 8.3.0 and above ships with Ignition + Turbofan execution pipeline which boost overall compiler performance and shrink memory footprints!
-
Internally, we've moved from Browserify to the more modern webpack module bundler.
-
-
We have a new recommended
tsconfig.json
. Type:ipack new tsconfig
in your project root folder (where thepackage.json
andtsconfig.json
is located) to upgrade!-
It uses a standardized
ES2015
module code generation instead ofCommonJS
-
It allows Synthetic Default Imports syntax for importing non-ES modules just like a default-exported ES modules!
-
-
We've changed the CSS input file entry point from
site.scss
toindex.scss
. Please rename the said file! -
We've changed the default JS and CSS output file names to
ipack.js
(frombundle.js
) andipack.css
(fromsite.css
).-
Make sure to update your
<script src="...">
and<link href="..." />
references in the HTML files! -
If that action is prohibitive, simply use the new
jsOut
andcssOut
options to emit output file names identical to instapack 4:
-
{
"instapack": {
"jsOut": "bundle.js",
"cssOut": "site.css",
}
}