<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Brian Hanna</title>
    <description>The latest articles on DEV Community by Brian Hanna (@thehanna).</description>
    <link>https://dev.to/thehanna</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2632%2F255997.jpeg</url>
      <title>DEV Community: Brian Hanna</title>
      <link>https://dev.to/thehanna</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/thehanna"/>
    <language>en</language>
    <item>
      <title>Import dependencies with Svelte and Rollup?</title>
      <dc:creator>Brian Hanna</dc:creator>
      <pubDate>Thu, 12 Sep 2019 16:56:27 +0000</pubDate>
      <link>https://dev.to/thehanna/import-dependencies-with-svelte-and-rollup-21aa</link>
      <guid>https://dev.to/thehanna/import-dependencies-with-svelte-and-rollup-21aa</guid>
      <description>&lt;p&gt;I'm trying out Svelte. I've followed the instructions on &lt;a href="https://svelte.dev/blog/the-easiest-way-to-get-started#2_Use_degit"&gt;getting a starter project going&lt;/a&gt;. I've made some minor customizations, and added one library to help with making fetch requests (&lt;a href="https://www.npmjs.com/package/build-url"&gt;build-url&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;Everything works great! I'm able to import build-url using this syntax in my &lt;code&gt;Home.svelte&lt;/code&gt; file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;buildUrl&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;../node_modules/build-url&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;However, I'm coming from Angular; I'm very, very used to omitting the path the &lt;code&gt;node_modules&lt;/code&gt; from my code entirely; Angular just finds what it needs. My ideal end state would be the following:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;buildUrl&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;build-url&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Is there a Rollup configuration I can use to mimic this behavior? I'm not against using a path to the &lt;code&gt;node_modules&lt;/code&gt; folder, but I can't help but feel like I'm doing it wrong. If I can't do it with Rollup, is it possible with another bundler like webpack or Parcel?&lt;/p&gt;

</description>
      <category>help</category>
      <category>svelte</category>
      <category>rollup</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Connect to OracleDB from NodeJS?</title>
      <dc:creator>Brian Hanna</dc:creator>
      <pubDate>Tue, 02 Jul 2019 01:30:09 +0000</pubDate>
      <link>https://dev.to/thehanna/connect-to-oracledb-from-nodejs-37om</link>
      <guid>https://dev.to/thehanna/connect-to-oracledb-from-nodejs-37om</guid>
      <description>&lt;p&gt;I currently use Java ADF REST web services to access the data in a bunch of legacy Oracle databases. It's slow, static, one dimensional, and a huge pain point. I use NodeJS for the application servers, so I was hoping to implement some cleaner, more dynamic APIs to interface with the Oracle databases there.&lt;/p&gt;

&lt;p&gt;However, I cannot, for the life of me, figure out how to connect to this database from NodeJS. I can get to the database via SQL Developer. I have a Data Source set up in the integrated WebLogic Server that ships with JDeveloper for the current web services that (seemingly) uses all the same information. I have all the information: the hostname, the username, the password, the port, and the SID. I've gotten the InstantClient installed and added to my PATH on my Mac. No configuration of this information seems to work properly in NodeJS. I'm using &lt;a href="https://www.npmjs.com/package/oracledb"&gt;node-oracledb&lt;/a&gt; version 3.1.2 on NodeJS v10.15.3. My connection object looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;user&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;my_username&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;password&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;my_password&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;connectString&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;app.company.com:port:database_name&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;The above configuration results in the error:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Error: ORA-12545: Connect failed because target host or object does not exist&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;So something is clearly wrong with my connection string. I have tried multiple permutations on the &lt;code&gt;connectString&lt;/code&gt; as well, including:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;app.company.com:port/database_name&lt;/code&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;Error: ORA-12514: TNS:listener does not currently know of service requested in connect descriptor&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;jdbc:oracle:thin:@app.company.com:port:database_name&lt;/code&gt;

&lt;ul&gt;
&lt;li&gt;Works with SQL Developer and WebLogic Server Data Source, but produces error &lt;code&gt;ORA-12514&lt;/code&gt; when used in NodeJS&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I'm grasping at straws. All of the information I've found has been so dense as to be basically useless. I'm not a Java developer. I've never worked heavily with Oracle databases before. I'm sure there is some strange, arcane configuration &lt;em&gt;thing&lt;/em&gt; that I'm missing, but I don't even know what questions to ask. Literally &lt;em&gt;any&lt;/em&gt; additional information would be incredibly useful.&lt;/p&gt;

</description>
      <category>help</category>
      <category>oracle</category>
      <category>node</category>
    </item>
    <item>
      <title>Oracle ADF REST Batch GET with query parameters?</title>
      <dc:creator>Brian Hanna</dc:creator>
      <pubDate>Tue, 04 Jun 2019 18:31:51 +0000</pubDate>
      <link>https://dev.to/thehanna/oracle-adf-rest-batch-get-with-query-parameters-2j7l</link>
      <guid>https://dev.to/thehanna/oracle-adf-rest-batch-get-with-query-parameters-2j7l</guid>
      <description>&lt;p&gt;I'm working with the Oracle ADF REST API for an app. I want to be able to batch some requests, but I'm not seeing a way to do so while also passing URL parameters. I asked this same question on SO back in September and have gotten nowhere since then: &lt;a href="https://stackoverflow.com/questions/52320613/oracle-adf-bc-rest-api-batch-get-requests-with-url-parameters"&gt;https://stackoverflow.com/questions/52320613/oracle-adf-bc-rest-api-batch-get-requests-with-url-parameters&lt;/a&gt;&lt;/p&gt;

</description>
      <category>help</category>
      <category>oracle</category>
      <category>java</category>
      <category>adf</category>
    </item>
    <item>
      <title>AngularJS, IE11, and the Importance of Research</title>
      <dc:creator>Brian Hanna</dc:creator>
      <pubDate>Tue, 04 Jun 2019 13:48:57 +0000</pubDate>
      <link>https://dev.to/thehanna/angularjs-ie11-and-the-importance-of-research-9ee</link>
      <guid>https://dev.to/thehanna/angularjs-ie11-and-the-importance-of-research-9ee</guid>
      <description>&lt;p&gt;Yesterday, a bug was discovered in an app I maintain: a single text input was disabled in IE11 when it shouldn't be. I immediately jumped in, believing it to be a mis-fire with an &lt;code&gt;ng-disabled&lt;/code&gt; statement. Nearly two hours later, zero progress was made. This seemed like such a simple fix on first blush!&lt;/p&gt;

&lt;p&gt;It made no sense. The &lt;code&gt;placeholder&lt;/code&gt; text was set as the &lt;code&gt;value&lt;/code&gt;. The &lt;code&gt;ng-model&lt;/code&gt; binding didn't update in the controller on text entry. The &lt;code&gt;submit&lt;/code&gt; action did nothing when I hit enter, but worked on clicking the submit button for the form. The input fired a test function from an &lt;code&gt;ng-click&lt;/code&gt;, but didn't from &lt;code&gt;ng-focus&lt;/code&gt; or &lt;code&gt;ng-blur&lt;/code&gt;. I decided to cut my losses and leave it for the morning.&lt;/p&gt;

&lt;p&gt;Today, after (not really) sleeping on it, I took another look. I broadened my search terms, hoping to get hint of a solution. A number of searches later, the secret words ended up being: &lt;strong&gt;&lt;code&gt;angularjs strange form behavior ie11&lt;/code&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Embarassingly, that (in hindsight) obvious phrase led me to the official AngularJS Developer Guide, which describes &lt;em&gt;exactly&lt;/em&gt; what I was seeing in my app:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Using the &lt;code&gt;disabled&lt;/code&gt; attribute on an element that has descendant form controls can result in unexpected behavior in Internet Explorer 11. For example, the value of descendant input elements with &lt;code&gt;ng-model&lt;/code&gt; will not reflect the model (or changes to the model), and the value of the &lt;code&gt;placeholder&lt;/code&gt; attribute will be inserted as the input's value. Descendant select elements will also be inoperable, as if they had the &lt;code&gt;disabled&lt;/code&gt; attribute applied to them, which may not be the intended effect. To work around this unexpected behavior, 1) avoid using the identifier &lt;code&gt;disabled&lt;/code&gt; for custom attribute directives that are on elements with descendant form controls, and 2) avoid using &lt;code&gt;disabled&lt;/code&gt; as an identifier for an attribute passed to a custom directive that has descendant form controls.&lt;/p&gt;

&lt;p&gt;&lt;cite&gt;—&lt;a href="https://docs.angularjs.org/guide/ie"&gt;AngularJS: Developer Guide: Internet Explorer Compatibility&lt;/a&gt;&lt;/cite&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Upon examining the parent components, I found the source of my pain. &lt;em&gt;Somebody&lt;/em&gt; on my team (of one) had used &lt;code&gt;disabled&lt;/code&gt; as an identifier for a binding on the parent component, which falls into the category of custom directives that have descendant form controls! By simply renaming the binding to &lt;code&gt;isDisabled&lt;/code&gt; and using the attribute &lt;code&gt;is-disabled&lt;/code&gt;, the entire issue disappeared.&lt;/p&gt;

&lt;p&gt;Let my over-confidence be a warning to others: &lt;strong&gt;&lt;em&gt;Read. The. F***ing. Manual.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>angular</category>
      <category>internetexplorer</category>
      <category>documentation</category>
    </item>
  </channel>
</rss>
