Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@mauritslamers
Copy link
Member

@mauritslamers mauritslamers commented Apr 2, 2022

This PR contains the changes required to move SproutCore onto webpack, allowing it to be used much more easily in combination with other tools and frameworks, such as NPM and React.

The use of webpack does bring in a few structural changes:

  • the use of sc_static and static_url is discouraged and will be deprecated. The support within the webpack environment is already more limited (such as that file extensions can no longer be omitted) and a change might require a webpack server restart.
  • the use of sc_super() is discouraged. sc_super() was a macro the build tools replaced with arguments.callee.base.apply(this, arguments). Under ES5 strict and ES6 arguments.callee is no longer available. The alternative for this behavior is using named functions as methods. The more recent versions of the NodeJS buildtools have been attempting to detect this and converting anonymous methods to named methods. The introduction of the method shorthand in ES6 however has made this detecting difficult and error prone. It is therefore suggested to convert any sc_super() calls to their ES5 strict safe counterpart.
  • Webpack treats every script file as a module, very similar to NodeJS / CJS or ES6 modules. This differs from the previous build tools where all files were automatically loaded in the global namespace in the browser. The webpack configuration provided with SproutCore will wrap every file in a function which will run with the window as global this, which will expose most of what happens in a file to the global namespace. There are some subtle differences though, such as that a top level var foo = 'bar'; in a file will no longer automatically be part of the global object (window). Exposing these values now require direct assignment to the window object.

TODO: removal of old config files, but unlikely that is going to happen, as it would be better to leave that to the user.
The fixing of the CI tests will be done in a separate PR, as this one is already big enough as it is.

mauritslamers and others added 27 commits April 2, 2022 23:46
but  0.00009999999999999999. Also make the rounding much more reliable with high negative decimalPlaces
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants