-
Notifications
You must be signed in to change notification settings - Fork 25
Not compatible with native node require and webpack #141
Copy link
Copy link
Open
Description
mr supports some features that a native node require or webpack do not. In order to eventually drop mr from montage, these features should be phased out.
- Fix module-resolution spec with bug #118 Should not expose dependencies package's require #15
mrresolves modules differently from node. It allows loading modules relative to the package, without a relative path, e.g.require("core/foo")instead ofrequire("../core/foo"). In Node, requires to local modules must start with./or../. This difference also allows loading transitive dependencies, e.g.require("montage/collections"), which is poor practice. To minimize the impact on montage applications, we could enhance the montage deserializer to automatically convertprototype/objectpaths that start withui/core/data/logicto be relative, possibly with a deprecation warning. -
mr'sReelLoader, which silently loadsrequire("ui/foo.reel")atui/foo.reel/foo.js, is non-standard.ReelLoadershould be moved to montage proper and should log a deprecation warning, eventually requiring that components are required with the correct standard path. To avoid impacting montage serialization templates too much, the deserializer can be enhanced to interpret aprototype/objectofui/foo.reelasui/foo.reel/foo.js. -
mappingson package.json is non-standard. This is primarily used in.infodirectories to avoid having many duplicate copies of montage or the parent package. This kind of thing is exactly what npm 3+'s de-duping accomplishes. -
overlayon package.json is non-standard. I don't currently know of any projects where we actually need to useoverlay. The alternative is to have a single entry script that discovers the environment itself, which doesn't feel like a huge tradeoff in order to remain standard-compliant. -
browseron package.json is non-standard. It's a browserify-specific feature andmrautomatically converts it to an overlay. -
directorieson package.json is non-standard.It allows the user to override whereIt was actually removed frommrlooks for modules and unknown packages.mrandmontagea long time ago, butmopkept handling it. Removed handling frommop, and removedmrdoc references. -
productionon package.json is non-standard, butpackage-lock.jsondoes have adevproperty which seems to have the same purpose. I think this is only necessary due to a flaw inmop, which includes all node_modules to the final build.mopshould not includedevDependenciesof a package in the build. -
redirectson package.json is non-standard. The only use of this I know of is montage itself, which redirects the main package's exports tomontage/core/core, so that we can do<script src="./node_modules/montage/montage.js">to bootstrap andrequire("montage")==require("montage/core/core"). -
useScriptInjectionon package.json is non-standard. Not sure about this one, when is loading via script preferable to loading via XHR? -
extraDependencies
If any of these are inaccurate, let me know or make an edit.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels