Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Philippe
    @elsassph
    Ah I think I know: that's because with the custom name the modules are still considered as "libs" and libs must get all their common dependencies from the main bundle.
    Dmitry
    @dmitry-kuzovatkin
    Is it fixable?)
    And what will happen if i will do Bundle.load for two different classes with same custom name? Based on generated code and dependencies it looks ok, but is it supported functionality?) @elsassph
    Cause in this case it start looks very similar with Bundle.loadLib
    Philippe
    @elsassph
    Haha yes I'm on it
    Er 2 bundles with the same custom name will break - it will be your fault :D
    Dmitry
    @dmitry-kuzovatkin
    Damn. I'm using it right now to group some classes
    Dmitry
    @dmitry-kuzovatkin
    But based on code library doing job correctly when i bundle feature1 and feature2 in same module file
    Philippe
    @elsassph
    Wait a sec, are you looking to use the custom name to regroup these classes into the same bundle?
    I thought you just wanted to rename the bundle file.
    Because right now for you it's working because it's using under the hood the loadLib feature, which means it has the lib limitation of having to be loaded from the main bundle.
    I'm fixing it by having a different mechanism to alias a bundle
    Dmitry
    @dmitry-kuzovatkin
    No. it's not about regrouping.
    But i'm trying also to solve another logic which i want to have. And it's mostly related to how we do on-demand features
    Axel Huizinga
    @axelhuizinga
    after tweaking my webpack config loading any bundles fails with:ReferenceError: "HxOverrides is not defined" ./node_modules/haxe-loader/index.js?build/view_DashBoard!.//< https://domain.de/js/view_DashBoard.js:1268 ./node_modules/haxe-loader/index.js?build/view_DashBoard!./ https://domain.de/js/view_DashBoard.js:1342 __webpack_require__ https://domain.de/js/app.js:791 fn https://domain.de/js/app.js:151 t https://domain.de/js/app.js:195 app.js:13340:21 loadBundle https://domain.de/js/app.js:13340
    Philippe
    @elsassph
    Sounds like the error due to Haxe 4 changes @axelhuizinga
    What version of Haxe do you use?
    Axel Huizinga
    @axelhuizinga
    4.1.1 - for now switching off the splitting solves the issue but I like to understand how I can enable it again since the app is likely to grow
    Philippe
    @elsassph
    Hmmm turns out I didn't release the 4.1 compatibility fixes for modular/haxe-loader
    Maksim-Zhuravlev
    @Maksim-Zhuravlev
    @elsassph First of all I'd like to say thanks for you effort for making this project.
    We have adopted haxe-modular more than a year ago for splitting our js code.
    And it has worked perfectly until we updated to Haxe 4.1.3 from Haxe 4.0.5.
    Now we are getting Uncaught ReferenceError: HxOverrides is not defined in the app.
    Disabling of splitting with -D modular_stub is a working workaround.
    haxe-modular version is 0.12.0
    Philippe
    @elsassph
    @Maksim-Zhuravlev yes sorry, I need to push an update for Haxe 4.1
    Maksim-Zhuravlev
    @Maksim-Zhuravlev
    Thanks in advance!
    Philippe
    @elsassph
    @Maksim-Zhuravlev @axelhuizinga can you try my upgrade branch: jasononeil/webpack-haxe-loader#69 which points to haxe-modular 0.12.0 which was actually released a little while ago.
    Maksim-Zhuravlev
    @Maksim-Zhuravlev
    @elsassph I'd like to help but I do not have any idea how to test it.
    What I have on my dev machine is:
    haxelib install modular
    0.12.0 is instaleed
    and hxml config:
    -lib modular
    -D haxe_split=../node_modules/.bin/haxe-split
    Webpack isn't involved in the building process.
    Philippe
    @elsassph
    The part that changed is on the npm side. You need to install haxe-loader from my branch.
    Oh
    No yeah thats the haxe-modular npm module you need to update as well to 0.12. Is that what you have already?
    Maksim-Zhuravlev
    @Maksim-Zhuravlev
    npm one is 0.10.15
    Updated to 0.12.0
    The error is still there
    Philippe
    @elsassph
    Ugh ok can you locate the Haxe code corresponding to the error?
    Maksim-Zhuravlev
    @Maksim-Zhuravlev
    I'll try tomorrow.
    What I see in the generated code.
    Main bundle contains
    var HxOverrides = function() { };
    $hxClasses["HxOverrides"] = HxOverrides;
    HxOverrides.name = "HxOverrides";
    And a bunch of
    HxOverrides.fn_name = function(args) {body}
    including
    HxOverrides.now = function() {
    return Date.now();
    };
    The extracted bundle contains
    if(typeof(performance) != "undefined" ? typeof(performance.now) == "function" : false) {
    HxOverrides.now = performance.now.bind(performance);
    }
    And deletion of this piece makes it work
    Philippe
    @elsassph
    Thanks, that's clear. I'll add a test case.
    Philippe
    @elsassph
    @Maksim-Zhuravlev can you please try this modular PR? You need to install haxe-modular npm from this git branch: elsassph/haxe-modular#106
    Maksim-Zhuravlev
    @Maksim-Zhuravlev
    @elsassph I'll do this evening or tomorrow morning.
    Thanks for quick fix!
    Maksim-Zhuravlev
    @Maksim-Zhuravlev
    @elsassph Just tested it.
    Works fine!
    Philippe
    @elsassph
    yay!
    Philippe
    @elsassph
    I published to npm haxe-modular 0.12.1
    @axelhuizinga FYI
    This should fix Haxe 4.1.3 support
    Axel Huizinga
    @axelhuizinga
    Any plans to add webpack5 compatibility?
    gives me:
    WARNING in ./build.hxml
    Invalid dependencies have been reported by plugins or loaders for this module. All reported dependencies need to be absolute paths.
    Invalid dependencies may lead to broken watching and caching.
    As best effort we try to convert all invalid values to absolute paths and converting globs into context dependencies, but this is deprecated behavior.
    Loaders: Pass absolute paths to this.addDependency (existing files), this.addMissingDependency (not existing files), and this.addContextDependency (directories).
    Plugins: Pass absolute paths to fileDependencies (existing files), missingDependencies (not existing files), and contextDependencies (directories).
    Globs: They are not supported. Pass absolute path to the directory as context dependencies.
    The following invalid values have been reported:
    * "."
    Philippe
    @elsassph
    Sorry I missed your message @axelhuizinga. Can you raise it on Github as an issue?
    Clark Jones
    @clarkjones
    Hey, so I’ve been trying to use the updated version of haxe-modular to avoid the HxOverrides issue, but now acorn throws an error when I try to build. SyntaxError: 'import' and 'export' may only appear at the top level
    using Haxe 4.2.4
    Clark Jones
    @clarkjones
    looks like making it use the latest version of acorn works
    Philippe
    @elsassph
    @clarkjones thanks for reporting. It looks like webpack-haxe-loader hasn't been updated in a while wrt haxe-modular dependency.
    16 replies