rfellows commented on a change in pull request #14: [WIP] NIFI-6212 introduce 
webpack, ES6, TS, linting, dev build watch
URL: https://github.com/apache/nifi-fds/pull/14#discussion_r281735283
 
 

 ##########
 File path: webpack.alias.js
 ##########
 @@ -0,0 +1,64 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+const path = require('path');
+
+module.exports = {
+    // Flow Design System
+    '@flow-design-system/core': path.resolve(__dirname, 
'platform/core/flow-design-system.module.js'),
 
 Review comment:
   Aliasing internal components in a re-usable module makes consuming a bit 
more challenging.
   
   consumers will also need to define aliases for these things for webpack to 
locate them properly:
   ```
    // Flow Design System
   '@flow-design-system/core': path.resolve(__dirname, 
'node_modules/@nifi-fds/core/flow-design-system.module.js'),
   '@flow-design-system/dialogs': path.resolve(__dirname, 
'node_modules/@nifi-fds/core/dialogs/fds-dialogs.module.js'),
   ...
   ```
   
   It is also confusing to alias it with the `@flow-design-system` when 
consumers know it as `@nifi-fds`.
   
   Maybe the better approach is to include add `platform/core/index.js` that 
imports everything defined in FDS and exports them all at that level.
   
   ```
   import FdsStorageService from './common/services/fds-storage.service';
   import { FdsConfirmDialogComponent } from 
'./dialogs/confirm-dialog/confirm-dialog-component';
   import { FdsCoasterComponent } from './snackbars/coaster/coaster.component';
   // more imports for the rest ...
   
   export {
     FdsStorageService,
     FdsConfirmDialogComponent,
     FdsCoasterComponent,
     // more exports here
   }
   ```
   
   
   Then consumers could just:
   ```
   import { FdsStorageService, FdsConfirmDialogComponent, FdsCoasterComponent } 
from '@nifi-fds/core'
   ```
   
   What do you think?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to