Coder Social home page Coder Social logo

Comments (19)

jourdain avatar jourdain commented on July 20, 2024 1

yes should be remove... I'm also removing the dependency on module-css.

from vtk-js.

zachmullen avatar zachmullen commented on July 20, 2024 1

Just verified that everything is working with 2.24.1. Thanks!

from vtk-js.

jourdain avatar jourdain commented on July 20, 2024

That loader is not required when you are using vtk.js as a dependency.

The file in vtk-js/Utilities/config/webpack.loaders.js is given as a convenient but based on the webpack logic. The application bundling the package is responsible of defining its rules.
And mostly for those who use kw-web-suite.

Maybe we can provide a webpack1.loader-dep.js and webpack2.loader-dep.js for your use case along with a dependency list so users know what to add in their devDependencies.

from vtk-js.

jourdain avatar jourdain commented on July 20, 2024

Moreover, if you use the prebuilt version of vtk.js, you don't need any of those loaders.

from vtk-js.

zachmullen avatar zachmullen commented on July 20, 2024

Moreover, if you use the prebuilt version of vtk.js, you don't need any of those loaders.

What about all the libraries that are listed inside dependencies? In the prebuilt case, wouldn't they be statically bundled, and hence also not required as dependencies?

from vtk-js.

jourdain avatar jourdain commented on July 20, 2024

yes they would, which mean that nothing should be in dependencies. ;-)

In my mind I put dev tools in devDependencies and the libraries that I'm using in my code in dependencies.

from vtk-js.

zachmullen avatar zachmullen commented on July 20, 2024

One possibility would be to have a vtk.js package that is a source dist and includes build-time deps in dependencies, and a second npm package vtk.js-prebuilt for those who just want the prebuilt version. That would cleanly separate the two use cases with the least burden on downstreams.

from vtk-js.

jourdain avatar jourdain commented on July 20, 2024

I think it is better to have a single name. After that the build tools needed could be better documented.

from vtk-js.

zachmullen avatar zachmullen commented on July 20, 2024

So downstreams using the source distribution would have to duplicate all the build-time dependencies? Would those be expected to remain stable?

from vtk-js.

jourdain avatar jourdain commented on July 20, 2024

yes they should. The requirements are very low here (es6 loader/shader loader).
Nothing else. No JSX or any CSS for the core lib.

from vtk-js.

jourdain avatar jourdain commented on July 20, 2024

kw-web-suite is a superset but it is overkilling for vtk.js.

from vtk-js.

zachmullen avatar zachmullen commented on July 20, 2024

Ok, cool, that's not too much, and if it remains stable within a major version, that's good.

from vtk-js.

jourdain avatar jourdain commented on July 20, 2024

Most likely the project importing VTK.js is already picking its build tools and should reuse them.

from vtk-js.

jourdain avatar jourdain commented on July 20, 2024

I'll try to document that usage (without kw-web-suite) when I get a chance.

from vtk-js.

jourdain avatar jourdain commented on July 20, 2024

Probably something along those lines but without kw-web-suite.

from vtk-js.

zachmullen avatar zachmullen commented on July 20, 2024

Great, I'm trying it now in some girder plugins and will post here with results.

from vtk-js.

zachmullen avatar zachmullen commented on July 20, 2024

Reopening because I ran into one more issue that might actually be a bug. When building I'm still seeing:

ERROR in ./~/vtk.js/Sources/Rendering/Core/Actor/index.js
Module build failed: Error: Couldn't find preset "react" relative to directory "/Users/zach/dev/girder/node_modules/vtk.js"

Even though my loaders do not mention react preset at all. I believe this is due to react being listed in the .babelrc file within the vtk.js package. Should we remove that?

from vtk-js.

jourdain avatar jourdain commented on July 20, 2024

You might be able to use https://github.com/Kitware/vtk-js/blob/master/Utilities/config/dependency.js with the next release (once travis is done)

from vtk-js.

jourdain avatar jourdain commented on July 20, 2024
var entry = require.resolve('./src/index.js');

var path = require('path');
var webpack = require('webpack');
var vtkLoaders = require('vtk.js/Utilities/config/dependency.js').webpack.v1.loaders;
var pluginList = [];

if (process.env.NODE_ENV === 'production') {
  console.log('==> Production build');
  pluginList.push(new webpack.DefinePlugin({
    'process.env': {
      NODE_ENV: JSON.stringify('production'),
    },
  }));
}

module.exports = {
  plugins: pluginList,
  entry: entry,
  output: {
    path: './dist',
    filename: 'itkVtkImageViewer.js',
  },
  module: {
    preLoaders: [{
      test: /\.js$/,
      loader: 'eslint-loader',
      exclude: /node_modules/,
    }],
    loaders: [
      { test: entry, loader: 'expose?itkVtkImageViewer' },
    ].concat(vtkLoaders),
  },
  postcss: [
    require('autoprefixer')({ browsers: ['last 2 versions'] }),
  ],
  eslint: {
    configFile: '.eslintrc.js',
  },
};

from vtk-js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.