"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "packages/angular_devkit/build_angular/src/webpack/plugins/hmr/hmr-accept.ts" between
angular-cli-11.0.1.tar.gz and angular-cli-11.0.2.tar.gz

About: Angular CLI is a command line interface for Angular.

hmr-accept.ts  (angular-cli-11.0.1):hmr-accept.ts  (angular-cli-11.0.2)
skipping to change at line 55 skipping to change at line 55
const appRoot = getAppRoot(); const appRoot = getAppRoot();
if (!appRoot) { if (!appRoot) {
return; return;
} }
const appRef = getApplicationRef(appRoot); const appRef = getApplicationRef(appRoot);
if (!appRef) { if (!appRef) {
return; return;
} }
const oldInputs = document.querySelectorAll('input, textarea'); // Inputs that are hidden should be ignored
const oldInputs = document.querySelectorAll('input:not([type="hidden"]), tex
tarea');
const oldOptions = document.querySelectorAll('option'); const oldOptions = document.querySelectorAll('option');
// Create new application // Create new application
appRef.components appRef.components
.forEach(cp => { .forEach(cp => {
const element = cp.location.nativeElement; const element = cp.location.nativeElement;
const parentNode = element.parentNode; const parentNode = element.parentNode;
parentNode.insertBefore( parentNode.insertBefore(
document.createElement(element.tagName), document.createElement(element.tagName),
element, element,
skipping to change at line 163 skipping to change at line 164
bubbles: true, bubbles: true,
cancelable: true, cancelable: true,
})); }));
element.blur(); element.blur();
element.dispatchEvent(new KeyboardEvent('keyup', { key: 'Enter' })); element.dispatchEvent(new KeyboardEvent('keyup', { key: 'Enter' }));
} }
function restoreFormValues(oldInputs: any[], oldOptions: any[]): void { function restoreFormValues(oldInputs: any[], oldOptions: any[]): void {
// Restore input // Restore input that are not hidden
const newInputs = document.querySelectorAll('input, textarea'); const newInputs = document.querySelectorAll('input:not([type="hidden"]), texta
rea');
if (newInputs.length && newInputs.length === oldInputs.length) { if (newInputs.length && newInputs.length === oldInputs.length) {
console.log('[NG HMR] Restoring input/textarea values.'); console.log('[NG HMR] Restoring input/textarea values.');
for (let index = 0; index < newInputs.length; index++) { for (let index = 0; index < newInputs.length; index++) {
const newElement = newInputs[index]; const newElement = newInputs[index];
const oldElement = oldInputs[index]; const oldElement = oldInputs[index];
switch (oldElement.type) { switch (oldElement.type) {
case 'button': case 'button':
case 'image': case 'image':
case 'submit': case 'submit':
 End of changes. 2 change blocks. 
3 lines changed or deleted 6 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)