Comments (15)
No problem!
@humphd shall we proceed with PR #793 so we can close this issue?
EDIT: I have seen the other issue about the shims not being present in the version distributed through npm - don't have time to address that until this evening or tomorrow but we should probably ship any fix for that with the fix for this issue imo
from filer.
cc @bcheidemann, who might have thoughts.
from filer.
Thanks for raising this issue @thomas-jakemeyn.
The problem seems to be that we import the whole of filer when we only need the FilerWebpackPlugin
class. In hindsight, this is obviously not the best idea! I will put up a PR to deprecate accessing the plugin through the "normal" filer import and add a specific import path for the plugin. @humphd what do you think about:
const { FilerWebackPlugin } = require('filer/webpack');
@thomas-jakemeyn Until the fix is released, you should be able to import the class directly:
// Direct import
const FilerWebpackPlugin = require('filer/src/webpack-plugin');
Let me know if this works for you! :)
from filer.
Hello @bcheidemann,
I confirm that using a direct import as you suggested works. Thank you for that!
However, don't you think that the real problem is the side-effect on process.cwd
?
from filer.
Hello @bcheidemann,
I confirm that using a direct import as you suggested works. Thank you for that! However, don't you think that the real problem is the side-effect on
process.cwd
?
@thomas-jakemeyn The process.cwd
side effect is, as I understand it, required for filer to work properly in the browser. Maybe @humphd can clarify the exact purpose? Regardless, the Webpack config only needs to load the FilerWebpackPlugin
class which does not import any part of the main filer library (nor should it). As such, if imported correctly, there should be no side-effects.
Are you having trouble with the process.cwd
side effect other than in the context of the Webpack config (i.e. at runtime)?
from filer.
The problem that I was personally facing is solved with your suggestion.
from filer.
re: the process.cwd
override, that can probably be removed. It's used very rarely, and likely could be dealt with through documentation alone. Unlike fs
running in the OS, we have no concept of a process
on which the current working directory can be managed. We could probably move this to the shell instead. I'd take a PR that did this, but am unlikely to have time to do it any time soon.
from filer.
Thanks for the clarification @humphd.
@thomas-jakemeyn do you anticipate other issues that wouldn't be solved by PR #793? Happy to rethink our approach if there's reason to do so :)
from filer.
Since filer
is intended to be used in a browser, I guess that it should be fine indeed. Thank you for the clarification and for the quick reaction!
from filer.
Landed #793, I'll ship v1.4.0 in a min.
from filer.
https://github.com/filerjs/filer/releases/tag/v1.4.0
https://www.npmjs.com/package/filer is now at v1.4.0
from filer.
https://github.com/filerjs/filer/releases/tag/v1.4.0
https://www.npmjs.com/package/filer is now at v1.4.0
Thanks!
from filer.
@humphd I think this issue needs to be reopened. I just checked the latest NPM release (v1.4.0) and the new import is not working. This is because I added a root folder called "webpack" which wasn't released to NPM. Could you advise on what I need to change so that this is included in the release to NPM? This is also the case for the "shims" directory which is the reason for issue #791
from filer.
Should be fixed by v1.4.1
from filer.
Should be fixed by v1.4.1
Confirmed, the correct files have been pushed to NPM
from filer.
Related Issues (20)
- Support fs.open() flags being a number vs. string HOT 5
- Add find_symlink_node() to allow l* methods (lstat, lchown, etc) to use find_node like functionality HOT 4
- Export FS type to the user HOT 2
- Shell.mkdirp does not support relative paths HOT 4
- Use case HOT 1
- npm test only running shim tests HOT 10
- Incorrect documentation for Buffer shim HOT 2
- path module not shimmed correctly
- BUG: unexpected failures when calling fs functions (e.g. writeFile) with empty options object HOT 4
- BUG: fs.readdir fails when passing options HOT 4
- BUG: fs.mkdir does not recursively create parent directories when called with { recursive: true } HOT 2
- Add tests for new code paths from PR #774 HOT 1
- fs.opendir not implemented
- Typescript Support HOT 2
- web ide: Support for File System Access APIs as a Storage Provider? HOT 7
- GitHub Actions Workflow failing
- Shims are not available in NPM package HOT 8
- Critical dependency: the request of a dependency is an expression HOT 3
- Maintenance of Filer
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from filer.