profile
viewpoint

jdforsythe/angular-aba-routing-validation 3

ABA Routing Number input validation directive for AngularJS 1

jdforsythe/andtools 1

Script to make command-line Android development much easier

jdforsythe/angular-live-helper-chat 1

AngularJS directive for Live Helper Chat widget, enabling you to add data from within your AngularJS application to your LHC chat requests and emails.

jdforsythe/CAAT 1

Canvas Advanced Animation Toolkit

jdforsythe/elocryptlumen 1

A port of the great ElocryptFive package for use with Lumen, without having to enable facades

jdforsythe/angular-charts 0

angular directives for creating common charts using d3

jdforsythe/angular-cli 0

CLI tool for Angular

jdforsythe/angular-credit-cards 0

Angular directives for parsing and validating credit card inputs

jdforsythe/angular-filesaver 0

FileSaver.js wrapped by an Angular service

jdforsythe/angular-growing-input 0

Directive that allows textarea to change its height while user enters values.

issue commentmicrosoft/vscode

Stopped hitting breakpoints in TypeScript code

Yep, tried this and it worked. Thanks @connor4312

jdforsythe

comment created time in 6 days

created repositoryjdforsythe/fleet-client

Next - Fleet Management Client Application

created time in 18 days

pull request commentionic-team/ionic-framework

docs(select): fix Objects as Values docs

@brandyscarney Thanks, I didn't make it back around to fix this.

jdforsythe

comment created time in 24 days

issue commentmicrosoft/vscode

Stopped hitting breakpoints in TypeScript code

It does not match anything from the duplicate detection. Also, just to be clear about the expected behavior, it has always showed the breakpoints and allowed stepping through/over/into the code in the original typescript code. We have been using this exact configuration for well over a year across dozens of applications.

jdforsythe

comment created time in a month

issue openedmicrosoft/vscode

Stopped hitting breakpoints in TypeScript code

As of version 1.49.1 (perhaps 1.49.0 - I skipped that update) the debugger seems to no longer follow the source map and show the breakpoints in the TypeScript code (using ts-node) but rather shows the breakpoints in compiled JavaScript code.

In a sample file (index.ts)

function testFn() {
  console.log('Something');
  console.log('Something else');
}

testFn();

If I put a breakpoint on the first console.log and run the debugger, it used to show a breakpoint on that same line in the same file and allow me to step through the code. Now it brings up a compiled JS file and puts the breakpoint there:

index.ts:

function testFn() {
    console.log('Something');
    console.log('Something else');
}
testFn();
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiL1VzZXJzL2plcmVteWZvcnN5dGhlL2Rldi90ZW1wL3Rlc3QtdHMvc3JjL2luZGV4LnRzIiwic291cmNlcyI6WyIvVXNlcnMvamVyZW15Zm9yc3l0aGUvZGV2L3RlbXAvdGVzdC10cy9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsU0FBUyxNQUFNO0lBQ2IsT0FBTyxDQUFDLEdBQUcsQ0FBQyxXQUFXLENBQUMsQ0FBQztJQUN6QixPQUFPLENBQUMsR0FBRyxDQUFDLGdCQUFnQixDQUFDLENBQUM7QUFDaEMsQ0FBQztBQUVELE1BQU0sRUFBRSxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiZnVuY3Rpb24gdGVzdEZuKCkge1xuICBjb25zb2xlLmxvZygnU29tZXRoaW5nJyk7XG4gIGNvbnNvbGUubG9nKCdTb21ldGhpbmcgZWxzZScpO1xufVxuXG50ZXN0Rm4oKTtcbiJdfQ==

Breakpoint setting/removal in the original TS file does not work. Existing breakpoints sometimes disappear and other times just say "unbounded". Clicking to set/remove breakpoints exhibits odd behavior:

breakpoints-01

Many (most?) times the breakpoints don't end up on the proper lines in the compiled code, and many times the code never stops executing.

breakpoints-02

In a particular app I was working on over the last week or so (when I noticed the issue), it won't hit any breakpoints. I did notice that if I set these breakpoints, for instance:

Screen Shot 2020-09-28 at 3 49 43 PM

then I press play on the debugger, the line numbers get changed to:

Screen Shot 2020-09-28 at 3 49 50 PM

If I try to add a breakpoint while it's running, I either get duplicate entries in the breakpoint list (and it still doesn't break on that line) or I get a line number + character combination, e.g. 46:13

<!-- ⚠️⚠️ Do Not Delete This! bug_report_template ⚠️⚠️ --> <!-- Please read our Rules of Conduct: https://opensource.microsoft.com/codeofconduct/ --> <!-- Please search existing issues to avoid creating duplicates. --> <!-- Also please test using the latest insiders build to make sure your issue has not already been fixed: https://code.visualstudio.com/insiders/ -->

<!-- Use Help > Report Issue to prefill these. -->

  • VSCode Version: 1.49.2
  • OS Version: macOS Catalina 10.5.5

Steps to Reproduce:

  1. Expand the simple repro tsdebugger.tar.gz
  2. yarn install
  3. See the example GIFs above

<!-- Launch with code --disable-extensions to check. --> Does this issue occur when all extensions are disabled?: Yes

created time in a month

issue commentmicrosoft/vscode

Two source control panes (One works fine, but the other shows nothing)

@sbatten This did return the functionality to the Source Control tab. Thank you.

Biswas-N

comment created time in a month

issue commentmicrosoft/vscode

Two source control panes (One works fine, but the other shows nothing)

I had the same issue (started with 1.49.1, I believe, as it's only been happening since last week), and upon upgrading to the newest update (1.49.2), the second Source Control tab also disappeared. The problem is, the one that disappeared was the only one that worked.

When there were two tabs, I noticed that when I right-clicked in the tab bar, there were two entries for Source Control - one with the keyboard shortcut listed (that's the one that had nothing inside it) and a duplicate (the one that actually listed the files).

Now after the update, the sole remaining Source Control tab has no files inside of it. I can right-click in the empty pane and turn on the "Source Control Repositories" option, which shows a single entry for the repository, but does not list any changed files. Now that I've turned on "Source Control Repositories", it is grayed out and I can no longer turn it off.

I did notice a new Source Control pane in the Explorer tab, which does work exactly as the old Source Control tab did, however I prefer using it in it's own tab.

Biswas-N

comment created time in a month

startedprakhar1989/docker-curriculum

started time in a month

startedcaptbaritone/webamp

started time in a month

startedMarak/faker.js

started time in a month

startedleeoniya/uPlot

started time in a month

create barnchjdforsythe/ionic-framework

branch : 20631-multi-select

created branch time in a month

PR opened ionic-team/ionic-framework

docs(select): fix Objects as Values docs

Fix the Objects as Values documentation to add the necessary value property to the template, simplify the compare function, and add an interface for type checking.

Add an Objects as Values with Multiple Selection documentation section to show the difference with the compare function which needs to determine if an object is in the array of selected objects

This fixes an issue noted in the forums at https://forum.ionicframework.com/t/ionic-5-ion-select-objects-as-values-not-working/191807/2

<!-- Please refer to our contributing documentation for any questions on submitting a pull request, or let us know here if you need any help: https://ionicframework.com/docs/building/contributing -->

Pull request checklist

Please check if your PR fulfills the following requirements:

  • [ ] Tests for the changes have been added (for bug fixes / features)
  • [ ] Docs have been reviewed and added / updated if needed (for bug fixes / features)
  • [ ] Build (npm run build) was run locally and any changes were pushed
  • [ ] Lint (npm run lint) has passed locally and any fixes were made for failures

Pull request type

<!-- Please do not submit updates to dependencies unless it fixes an issue. -->

<!-- Please try to limit your pull request to one type, submit multiple pull requests if needed. -->

Please check the type of change your PR introduces:

  • [ ] Bugfix
  • [ ] Feature
  • [ ] Code style update (formatting, renaming)
  • [ ] Refactoring (no functional changes, no api changes)
  • [ ] Build related changes
  • [x] Documentation content changes
  • [ ] Other (please describe):

What is the current behavior?

<!-- Please describe the current behavior that you are modifying, or link to a relevant issue. -->

Issue Number: https://forum.ionicframework.com/t/ionic-5-ion-select-objects-as-values-not-working/191807/2

What is the new behavior?

<!-- Please describe the behavior or changes that are being added by this PR. -->

  • Fixes the select "Objects as Values" documentation
  • Adds a select "Objects as Values with Multiple Selection" documentation

Does this introduce a breaking change?

  • [ ] Yes
  • [x] No

<!-- If this introduces a breaking change, please describe the impact and migration path for existing applications below. -->

Other information

<!-- Any other information that is important to this PR such as screenshots of how the component looks before and after the change. -->

This shows the proper addition of a value property to the template, fixing the issue brought up in https://forum.ionicframework.com/t/ionic-5-ion-select-objects-as-values-not-working/191807/2 where the sample comparison function fails (checks all items)

The addition of an example for multiple selection of objects fixes the issue that the sample compare function (for single select) doesn't select any options when re-opening the select because the second parameter (o2 in the sample) is an array.

+74 -4

0 comment

1 changed file

pr created time in a month

create barnchjdforsythe/ionic-framework

branch : select-docs

created branch time in a month

issue commentionic-team/ionic-framework

bug: ion-select multiple defaults values are not checked - package vue

This appears to be the same bug as:

  • https://github.com/ionic-team/ionic-framework/issues/16094
  • https://forum.ionicframework.com/t/ionic-5-ion-select-objects-as-values-not-working/191807/3
franckysolo

comment created time in a month

issue commentionic-team/ionic-framework

bug: ion-select multiple defaults values are not checked - package vue

I looked into the code more, and it would appear they're calling isOptionSelected() with the first two parameters reversed in the select.tsx function:

const isOptionSelected = (currentValue: any[] | any, compareValue: any, compareWith?: string | SelectCompareFn | null)

but every time it's called, the "current" value (the one which could be an array) is passed as the second parameter, e.g.:

isOptionSelected(value, selectValue, this.compareWith)

From what I can tell, value would never be an array, but selectValue is when multiple items are selected, so I think the value and selectValue need reversed on the three calls to isOptionSelected() in that component

@liamdebeasi does that seem right?

This doesn't change the fact that it still won't work for objects. You would still need to handle the second parameter of your compare function being an array if you're using objects as the values, because the isOptionSelected() function delegates to your compare function if it exists before the array check.

franckysolo

comment created time in a month

create barnchjdforsythe/ionic-framework

branch : 20631-multi-select-show-values

created branch time in a month

fork jdforsythe/ionic-framework

A powerful cross-platform UI toolkit for building native-quality iOS, Android, and Progressive Web Apps with HTML, CSS, and JavaScript.

https://ionicframework.com

fork in a month

issue commentionic-team/ionic-framework

bug: ion-select multiple defaults values are not checked - package vue

Something like this would probably work:

    createAlertInputs(data, inputType, selectValue) {
        const alertInputs = data.map(option => {
            const value = getOptionValue(option);
            // Remove hydrated before copying over classes
            const copyClasses = Array.from(option.classList).filter(cls => cls !== 'hydrated').join(' ');
            const optClass = `${OPTION_CLASS} ${copyClasses}`;

            const checked = inputType === 'radio' ?
              isOptionSelected(value, selectValue, this.compareWith) :
              selectValue.any((val) => isOptionSelected(value, val, this.compareWith));

            return {
                type: inputType,
                cssClass: optClass,
                label: option.textContent || '',
                value,
                checked,
                disabled: option.disabled
            };
        });
        return alertInputs;
    }

If that's a good enough fix, I can submit a PR

franckysolo

comment created time in a month

issue commentionic-team/ionic-framework

bug: ion-select multiple defaults values are not checked - package vue

This is also an issue with Ionic and Angular

https://ionic-angular-v5-a34n8z.stackblitz.io

The selected person is not checked when you re-open the alert. If you remove multiple and use a single select, it works properly.

From stepping through with the debugger, I discovered that the array of selected items is passed to the compareWith function - and of course an array is never equal to the object/string value of the item.

You can see in the compare function that it's comparing the object from the select with the array of selected values (this is when the select is opened back up after a selection)

Screen Shot 2020-09-17 at 2 25 20 PM

This traces back to the createAlertInputs() function which passes selectValue to isOptionsSelected(). There's nothing checking the fact that on a multiple select this is an array.

Screen Shot 2020-09-17 at 2 26 17 PM

Screen Shot 2020-09-17 at 2 26 32 PM

franckysolo

comment created time in a month

startedpeterbrittain/asciimatics

started time in 2 months

push eventjdforsythe/nx

Jeremy Forsythe

commit sha 2977b308854a92a9fe7a6fae54f9324a6fb5a422

cleanup(misc): formatter changes

view details

push time in 2 months

issue commentnrwl/nx

Deleting the only app in a workspace makes CLI unusable

@FrozenPandaz I pushed PR #3528

Since updateWorkspace() was already being called, I just added the check and warning message there.

I also added tests.

jdforsythe

comment created time in 2 months

PR opened nrwl/nx

fix(core): remove defaultProject in workspace when removing project

<!-- Please make sure you have read the submission guidelines before posting an PR --> <!-- https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr -->

<!-- Please make sure that your commit message follows our format --> <!-- Example: fix(nx): must begin with lowercase -->

Current Behavior

Deleting the project listed as defaultProject in the workspace file leaves the CLI in an unusable state

Expected Behavior

If the default project is removed, this removes the defaultProject setting and displays a warning to the user

Related Issue(s)

<!-- Please link the issue being fixed so it gets closed when this is merged. -->

Fixes #3511

+140 -40

0 comment

2 changed files

pr created time in 2 months

create barnchjdforsythe/nx

branch : 3511-delete-app-default-project

created branch time in 2 months

fork jdforsythe/nx

Extensible Dev Tools for Monorepos

https://nx.dev

fork in 2 months

issue commentnrwl/nx

Deleting the only app in a workspace makes CLI unusable

According to what I read of Angular CLI, the default project is just the last one you created. Removing it is fine.

I looked at the updateJsonInTree() but if the file doesn't exist, it will create one. If a user removes an app and has no angular.json file, one shouldn't be created. That's why I created a new function.

jdforsythe

comment created time in 2 months

issue commentnrwl/nx

Deleting the only app in a workspace makes CLI unusable

I think something like this would work, but it involves editing angular.json from the @nrwl/workspace project and that doesn't seem right. Any ideas on a better way?

diff --git a/packages/workspace/src/schematics/remove/lib/update-angular-json.ts b/packages/workspace/src/schematics/remove/lib/update-angular-json.ts
new file mode 100644
index 00000000..32622141
--- /dev/null
+++ b/packages/workspace/src/schematics/remove/lib/update-angular-json.ts
@@ -0,0 +1,17 @@
+import { NxJson, updateJsonInTreeIfExists } from '@nrwl/workspace';
+import { Schema } from '../schema';
+
+/**
+ * Updates the angular.json file to remove the project as defaultProject
+ *
+ * @param schema The options provided to the schematic
+ */
+export function updateAngularJson(schema: Schema) {
+  return updateJsonInTreeIfExists<NxJson>('angular.json', (json) => {
+    if (json.defaultProject && json.defaultProject === schema.projectName) {
+      delete json.defaultProject;
+    }
+
+    return json;
+  });
+}
diff --git a/packages/workspace/src/schematics/remove/remove.ts b/packages/workspace/src/schematics/remove/remove.ts
index b409917c..9e241323 100644
--- a/packages/workspace/src/schematics/remove/remove.ts
+++ b/packages/workspace/src/schematics/remove/remove.ts
@@ -5,6 +5,7 @@ import { checkDependencies } from './lib/check-dependencies';
 import { checkTargets } from './lib/check-targets';
 import { removeProject } from './lib/remove-project';
 import { updateNxJson } from './lib/update-nx-json';
+import { updateAngularJson } from './lib/update-angular-json';
 import { updateTsconfig } from './lib/update-tsconfig';
 import { updateWorkspace } from './lib/update-workspace';
 import { Schema } from './schema';
@@ -16,6 +17,7 @@ export default function (schema: Schema): Rule {
     checkTargets(schema),
     removeProject(schema),
     updateNxJson(schema),
+    updateAngularJson(schema),
     updateTsconfig(schema),
     updateWorkspace(schema),
     formatFiles(schema),
diff --git a/packages/workspace/src/utils/ast-utils.ts b/packages/workspace/src/utils/ast-utils.ts
index 99874dcb..1db34cfc 100644
--- a/packages/workspace/src/utils/ast-utils.ts
+++ b/packages/workspace/src/utils/ast-utils.ts
@@ -493,6 +493,29 @@ export function updateJsonInTree<T = any, O = T>(
   };
 }
 
+/**
+ * This method is specifically for updating JSON in a Tree, but only
+ * if the file already exists
+ * @param path Path of JSON file in the Tree
+ * @param callback Manipulation of the JSON data
+ * @returns A rule which updates a JSON file file in a Tree
+ */
+export function updateJsonInTreeIfExists<T = any, O = T>(
+  path: string,
+  callback: (json: T, context: SchematicContext) => O
+): Rule {
+  return (host: Tree, context: SchematicContext): Tree => {
+    if (!host.exists(path)) {
+      return host;
+    }
+    host.overwrite(
+      path,
+      serializeJson(callback(readJsonInTree(host, path), context))
+    );
+    return host;
+  };
+}
+
 export function updateWorkspaceInTree<T = any, O = T>(
   callback: (json: T, context: SchematicContext, host: Tree) => O
 ): Rule {
jdforsythe

comment created time in 2 months

issue openednrwl/nx

Deleting the only app in a workspace makes CLI unusable

<!-- Please do your best to fill out all of the sections below! -->

Current Behavior

Deleting all apps in the workspace leaves the CLI unusable. It fails with Project 'testapp' could not be found in workspace due to the app still being listed in the defaultProject property in angular.json

Expected Behavior

<!-- What is the behavior that you expect to happen? --> <!-- Is this a regression? .i.e Did this used to be the behavior at one point? -->

Deleting the app should not make the CLI fail.

Steps to Reproduce

<!-- Help us help you by making it easy for us to reproduce your issue! -->

<!-- Can you reproduce this on https://github.com/nrwl/nx-examples? --> <!-- If so, open a PR with your changes and link it below. --> <!-- If not, please provide a minimal Github repo --> <!-- At the very least, provide as much detail as possible to help us reproduce the issue -->

  • npx create-nx-workspace@latest
    • name: testtorg
    • application: angular
    • app name: testapp
    • styles: CSS
    • cloud: no
  • cd testorg
  • code .
  • open nx Console tab in VSCode
  • click Generate
  • choose @nrwl/workspace - remove
    • enter projectName testapp-e2e and click "Run" (e2e app is deleted)
    • enter projectName testapp and click "Run" (app is deleted)
  • close the Generate tab
  • click Generate again
  • choose @nrwl/angular - application
  • terminal begins showing Project 'testapp' could not be found in workspace errors on all the dry run commands and any command you try to run (e.g. entering a name and clicking "Run" results in the same error
  • CLI commands give the same error, e.g. nx g @nrwl/angular:app -> Project 'testapp' could not be found in workspace.

Failure Logs

<!-- Please include any relevant log snippets or files here. -->

Environment

<!-- It's important for us to know the context in which you experience this behavior! --> <!-- Please paste the result of nx report below! -->

created time in 2 months

issue openedangular/universal

HttpClient URLs not fixed in prerender

🐞 Bug report

What modules are related to this issue?

<!-- ✍️edit: -->

  • [ ] aspnetcore-engine
  • [x] builders
  • [ ] common
  • [ ] express-engine
  • [ ] hapi-engine

Is this a regression?

<!-- Did this behavior used to work in the previous version? --> <!-- ✍️--> Yes, the previous version in which this bug was not present was: .... Unsure

Description

I am attempting to load JSON from the assets directory with HttpClient and use that to populate a component. This works fine when serving the application normally, however it errors when I use prerender.

I am guessing this has something to do with the translation of relative to absolute URLs in the prerenderer. Again, this works fine serving with npm start and if I change the URLs to start with http://localhost:4300 and run the app with npm start in a separate terminal, the prerendering works as expected. I just can't get it to load the file from it's own copy of the application during prerender.

🔬 Minimal Reproduction

Service:

import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';

import { Observable } from 'rxjs';
import { shareReplay } from 'rxjs/operators';

import { Article } from './article.interface';

@Injectable({
  providedIn: 'root'
})
export class ArticleService {

  articles$: Observable<Article[]>;

  constructor(private readonly http: HttpClient) {
    this.articles$ = this.http.get<Article[]>(`/assets/blog/articles.json`)
      .pipe(shareReplay(1));
  }
}

Component:

import { Component, OnInit } from '@angular/core';

import { Observable } from 'rxjs';
import { take } from 'rxjs/operators';

import { Article } from '../shared/article.interface';
import { ArticleService } from '../shared/article.service';

@Component({
  selector: 'app-blog',
  templateUrl: './blog.page.html',
  styleUrls: ['./blog.page.scss'],
})
export class BlogPage implements OnInit {

  articles$: Observable<Article[]>;

  constructor(private readonly articleService: ArticleService) {}

  ngOnInit() {
    this.articles$ = this.articleService.articles$.pipe(take(1));
  }
}

🔥 Exception or Error

<pre><code> <!-- If the issue is accompanied by an exception or an error, please share it below: --> <!-- ✍️--> CREATE /Users/username/dev/testapp/dist/app/browser/news/blog/index.html (2769 bytes) ERROR Error at XMLHttpRequest.send (/Users/username/dev/testapp/dist/app/server/main.js:1:1687903) at Observable_Observable.rxjs__WEBPACK_IMPORTED_MODULE_2__.a.observer [as _subscribe] (/Users/username/dev/testapp/dist/app/server/main.js:1:3152655) at Observable_Observable._trySubscribe (/Users/username/dev/testapp/dist/app/server/main.js:1:1279674) at Observable_Observable.subscribe (/Users/username/dev/testapp/dist/app/server/main.js:1:1279456) at _task (/Users/username/dev/testapp/dist/app/server/main.js:1:1229830) at Observable_Observable.Observable.a.observer [as _subscribe] (/Users/username/dev/testapp/dist/app/server/main.js:1:1230175) at Observable_Observable._trySubscribe (/Users/username/dev/testapp/dist/app/server/main.js:1:1279674) at Observable_Observable.subscribe (/Users/username/dev/testapp/dist/app/server/main.js:1:1279456) at subscribeToResult (/Users/username/dev/testapp/dist/app/server/main.js:1:1740059) at MergeMapSubscriber._innerSub (/Users/username/dev/testapp/dist/app/server/main.js:1:832282) </code></pre>

🌍 Your Environment

<pre><code> <!-- run ng version and paste output below --> <!-- ✍️--> Angular CLI: 9.1.12 Node: 10.15.3 OS: darwin x64

Angular: 9.1.12 ... cli, common, compiler, compiler-cli, core, forms ... language-service, platform-browser, platform-browser-dynamic ... platform-server, router Ivy Workspace: Yes

Package Version

@angular-devkit/architect 0.901.12 @angular-devkit/build-angular 0.901.12 @angular-devkit/build-optimizer 0.901.12 @angular-devkit/build-webpack 0.901.12 @angular-devkit/core 9.1.12 @angular-devkit/schematics 9.1.12 @angular/animations 10.0.7 @ngtools/webpack 9.1.12 @nguniversal/builders 9.1.1 @nguniversal/common 9.1.1 @nguniversal/express-engine 9.1.1 @schematics/angular 9.1.12 @schematics/update 0.901.12 rxjs 6.5.5 typescript 3.8.3 webpack 4.42.0 </code></pre>

created time in 3 months

issue closedangular/universal

ERROR ReferenceError: atob is not defined

<-- Please follow the below issue template. Issues not following the issue template will be closed. Please provide as much detail as possible in as minimal a reproduction as possible. This means no/only one third-party libraries, no application-specific code, etc. Essentially, we're looking for an ng new project with maybe one additional file/change. If this is not possible, please look deeper into your issue or post it to StackOverflow for support. This is a bug/feature tracker, meaning that something is actively missing or broken in Angular Universal. Anything else does not belong on this forum.

For very common issues when using Angular Universal, please see this doc. This includes issues for window is not defined and other hiccups when adopting Angular Universal for the first time. -->

🐞 Bug report

What modules are related to this issue?

<!-- ✍️edit: -->

  • [ ] aspnetcore-engine
  • [x] builders
  • [ ] common
  • [ ] express-engine
  • [ ] hapi-engine

Is this a regression?

<!-- Did this behavior used to work in the previous version? --> <!-- ✍️--> Yes, the previous version in which this bug was not present was: .... Unknown

Description

<!-- ✍️--> A clear and concise description of the problem... I'm trying to use the pre-render feature as a sort of static site generator for articles in Markdown format. I have the list of articles pre-rendering properly. Due to troubles I had trying to get the pre-renderer to make calls to import .json and .md files, I am generating a TypeScript file with the article metadata using a CLI script ahead of time that gets imported into the application.

The article list pre-renders correctly, with the imported metadata ending up in the final HTML file as expected. In order to inject the markdown content into the metadata file, I base64-encoded it. In the article component, I was attempting to decode it with atob, which works in the browser but throws the ReferenceError: atob is not defined error during pre-rendering.

🔬 Minimal Reproduction

<!-- Simple steps to reproduce this bug.

Please include: commands run (including args), packages added, related code changes.

If reproduction steps are not enough for reproduction of your issue, please create a minimal GitHub repository with the reproduction of the issue. A good way to make a minimal reproduction is to create a new app via ng new repro-app and add the minimum possible code to show the problem. Share the link to the repo below along with step-by-step instructions to reproduce the problem, as well as expected and actual behavior.

Issues that don't have enough info and can't be reproduced will be closed.

You can read more about issue submission guidelines here: https://github.com/angular/universal/blob/master/CONTRIBUTING.md#-submitting-an-issue -->

Markdown article sample:

# This is a test

Metadata import sample:

export const articles = [{"name": "hello-world","ts":"2020-08-03 11:39:00-04","title":"Hello World","thumb":"/assets/blog/hello.jpg","markdown":"IyBUaGlzIGlzIGEgdGVzdA=="}];

Component (matches route param to article name property:

  ngOnInit() {
    this.route.params.pipe(
      // get the full article from the route param
      map((params) => this.articleService.getArticleByName(params.id)),
      take(1),
      ).subscribe((article: Article) => {
        // replace the base64-encoded markdown with decoded markdown and parse
        this.rendered = marked(atob(article.markdown));
    });
  }

Markup:

<div [innerHTML]="rendered"></div>

🔥 Exception or Error

<pre><code> <!-- If the issue is accompanied by an exception or an error, please share it below: --> <!-- ✍️--> CREATE /Users/username/testapp/dist/app/browser/news/article/thread/index.html (2907 bytes) ERROR ReferenceError: atob is not defined at SafeSubscriber.route.params.pipe.subscribe.article [as _next] (/Users/username/testapp/dist/app/server/main.js:1:3295208) at SafeSubscriber.__tryOrUnsub (/Users/username/testapp/dist/app/server/main.js:1:1078100) at SafeSubscriber.next (/Users/username/testapp/dist/app/server/main.js:1:1076799) at Subscriber._next (/Users/username/testapp/dist/app/server/main.js:1:1075458) at Subscriber.next (/Users/username/testapp/dist/app/server/main.js:1:1075220) at TakeSubscriber._next (/Users/username/testapp/dist/app/server/main.js:1:1309268) at TakeSubscriber.next (/Users/username/testapp/dist/app/server/main.js:1:1075220) at MapSubscriber._next (/Users/username/testapp/dist/app/server/main.js:1:2800907) at MapSubscriber.next (/Users/username/testapp/dist/app/server/main.js:1:1075220) at SwitchMapSubscriber.notifyNext (/Users/username/testapp/dist/app/server/main.js:1:1884561) </code></pre>

🌍 Your Environment

<pre><code> <!-- run ng version and paste output below --> <!-- ✍️--> Angular CLI: 9.1.12 Node: 10.15.3 OS: darwin x64

Angular: 9.1.12 ... cli, common, compiler, compiler-cli, core, forms ... language-service, platform-browser, platform-browser-dynamic ... platform-server, router Ivy Workspace: Yes

Package Version

@angular-devkit/architect 0.901.12 @angular-devkit/build-angular 0.901.12 @angular-devkit/build-optimizer 0.901.12 @angular-devkit/build-webpack 0.901.12 @angular-devkit/core 9.1.12 @angular-devkit/schematics 9.1.12 @angular/animations 10.0.7 @ngtools/webpack 9.1.12 @nguniversal/builders 9.1.1 @nguniversal/common 9.1.1 @nguniversal/express-engine 9.1.1 @schematics/angular 9.1.12 @schematics/update 0.901.12 rxjs 6.5.5 typescript 3.8.3 webpack 4.42.0 </code></pre>

closed time in 3 months

jdforsythe

issue commentangular/universal

ERROR ReferenceError: atob is not defined

I realize now this is part of the window missing globals issue. BTW the link to "this doc" in the issue template is broken. It points to /issues/docs instead of /docs

jdforsythe

comment created time in 3 months

issue openedangular/universal

ERROR ReferenceError: atob is not defined

<-- Please follow the below issue template. Issues not following the issue template will be closed. Please provide as much detail as possible in as minimal a reproduction as possible. This means no/only one third-party libraries, no application-specific code, etc. Essentially, we're looking for an ng new project with maybe one additional file/change. If this is not possible, please look deeper into your issue or post it to StackOverflow for support. This is a bug/feature tracker, meaning that something is actively missing or broken in Angular Universal. Anything else does not belong on this forum.

For very common issues when using Angular Universal, please see this doc. This includes issues for window is not defined and other hiccups when adopting Angular Universal for the first time. -->

🐞 Bug report

What modules are related to this issue?

<!-- ✍️edit: -->

  • [ ] aspnetcore-engine
  • [x] builders
  • [ ] common
  • [ ] express-engine
  • [ ] hapi-engine

Is this a regression?

<!-- Did this behavior used to work in the previous version? --> <!-- ✍️--> Yes, the previous version in which this bug was not present was: .... Unknown

Description

<!-- ✍️--> A clear and concise description of the problem... I'm trying to use the pre-render feature as a sort of static site generator for articles in Markdown format. I have the list of articles pre-rendering properly. Due to troubles I had trying to get the pre-renderer to make calls to import .json and .md files, I am generating a TypeScript file with the article metadata using a CLI script ahead of time that gets imported into the application.

The article list pre-renders correctly, with the imported metadata ending up in the final HTML file as expected. In order to inject the markdown content into the metadata file, I base64-encoded it. In the article component, I was attempting to decode it with atob, which works in the browser but throws the ReferenceError: atob is not defined error during pre-rendering.

🔬 Minimal Reproduction

<!-- Simple steps to reproduce this bug.

Please include: commands run (including args), packages added, related code changes.

If reproduction steps are not enough for reproduction of your issue, please create a minimal GitHub repository with the reproduction of the issue. A good way to make a minimal reproduction is to create a new app via ng new repro-app and add the minimum possible code to show the problem. Share the link to the repo below along with step-by-step instructions to reproduce the problem, as well as expected and actual behavior.

Issues that don't have enough info and can't be reproduced will be closed.

You can read more about issue submission guidelines here: https://github.com/angular/universal/blob/master/CONTRIBUTING.md#-submitting-an-issue -->

Markdown article sample:

# This is a test

Metadata import sample:

export const articles = [{"name": "hello-world","ts":"2020-08-03 11:39:00-04","title":"Hello World","thumb":"/assets/blog/hello.jpg","markdown":"IyBUaGlzIGlzIGEgdGVzdA=="}];

Component (matches route param to article name property:

  ngOnInit() {
    this.route.params.pipe(
      // get the full article from the route param
      map((params) => this.articleService.getArticleByName(params.id)),
      take(1),
      ).subscribe((article: Article) => {
        // replace the base64-encoded markdown with decoded markdown and parse
        this.rendered = marked(atob(article.markdown));
    });
  }

Markup:

<div [innerHTML]="rendered"></div>

🔥 Exception or Error

<pre><code> <!-- If the issue is accompanied by an exception or an error, please share it below: --> <!-- ✍️--> CREATE /Users/username/testapp/dist/app/browser/news/article/thread/index.html (2907 bytes) ERROR ReferenceError: atob is not defined at SafeSubscriber.route.params.pipe.subscribe.article [as _next] (/Users/username/testapp/dist/app/server/main.js:1:3295208) at SafeSubscriber.__tryOrUnsub (/Users/username/testapp/dist/app/server/main.js:1:1078100) at SafeSubscriber.next (/Users/username/testapp/dist/app/server/main.js:1:1076799) at Subscriber._next (/Users/username/testapp/dist/app/server/main.js:1:1075458) at Subscriber.next (/Users/username/testapp/dist/app/server/main.js:1:1075220) at TakeSubscriber._next (/Users/username/testapp/dist/app/server/main.js:1:1309268) at TakeSubscriber.next (/Users/username/testapp/dist/app/server/main.js:1:1075220) at MapSubscriber._next (/Users/username/testapp/dist/app/server/main.js:1:2800907) at MapSubscriber.next (/Users/username/testapp/dist/app/server/main.js:1:1075220) at SwitchMapSubscriber.notifyNext (/Users/username/testapp/dist/app/server/main.js:1:1884561) </code></pre>

🌍 Your Environment

<pre><code> <!-- run ng version and paste output below --> <!-- ✍️--> Angular CLI: 9.1.12 Node: 10.15.3 OS: darwin x64

Angular: 9.1.12 ... cli, common, compiler, compiler-cli, core, forms ... language-service, platform-browser, platform-browser-dynamic ... platform-server, router Ivy Workspace: Yes

Package Version

@angular-devkit/architect 0.901.12 @angular-devkit/build-angular 0.901.12 @angular-devkit/build-optimizer 0.901.12 @angular-devkit/build-webpack 0.901.12 @angular-devkit/core 9.1.12 @angular-devkit/schematics 9.1.12 @angular/animations 10.0.7 @ngtools/webpack 9.1.12 @nguniversal/builders 9.1.1 @nguniversal/common 9.1.1 @nguniversal/express-engine 9.1.1 @schematics/angular 9.1.12 @schematics/update 0.901.12 rxjs 6.5.5 typescript 3.8.3 webpack 4.42.0 </code></pre>

created time in 3 months

issue commentianramzy/decentralized-video-chat

Passcode to join zipcall

Is it simpler to just have the user who created the chat approve new users who are trying to join, no password needed?

harsha20599

comment created time in 3 months

more