Releases: metal/metal.js
Releases · metal/metal.js
v2.2.1
v2.2.0
New Features
- metal-dom's
addElementClasses
andremoveElementClasses
functions now also accept NodeList besides Element. This allows handling classes from multiple elements in a single call.
Bug Fixes
- Fixed bug involving usage of
elementClasses
- #143 - Fixed some child components not being disposed as expected after the parent was disposed
v2.1.3
New Features
-
All validators from metal-state now accept null/undefined values by default - #140
-
The shapeOf validator can now also receive objects built via
Config
, enabling you to not just use validators, but also the required flag. For example:Config.shapeOf({ myOptionalProp: Config.number(), myRequiredProp: Config.number().required() });
v2.1.2
v2.1.1
v2.1.0
New Features
- You can now use some special validators when configuring your state (or props). These were merged from metal-state-validators, which shouldn't be used separately anymore. You can import it via
import { validators } from 'metal-state'
. - You can now use a sugar api for configuring your state (or props). You can import it via
import { Config } from 'metal-state'
. - Both Config and validators can also be imported directly via metal-jsx, like:
import { validators, Config } from 'metal-jsx'
.
v2.0.0
Breaking Changes
- Component doesn't extend from State anymore. This shouldn't affect anyone unless some inherited functions from State were being used. Component still has the main
getState
andsetState
functions though, so those can still be used. - Components that inherit from JSXComponent won't have their state properties set directly on the component instance anymore. They will be accessible via
this.props
andthis.state
instead, following react's standards. Note that this doesn't affect components extending directly from Component. - The approach for reusing components was changed to happen according to each component's position within their parent elements, instead of the position within parent components as before. See more details in the related issue.
- There's no
config
property anymore. Components inheriting from JSXComponent can useprops
instead.
JSX Features
- JSXComponent now automatically splits state into
this.state
andthis.props
, where state holds internal data while props holds external. - JSXComponent can now define properties using both
STATE
andPROPS
static variables, according to if they should show up instate
orprops
.
General Features
- A new
required
option was added to State, which warns if a certain property wasn't given.
v1.0.0-rc
- Moves event classes to metal-events project
- Moves dom classes to metal-dom project
- Moves html class to metal-html project
- Moves EventEmitterProxy to metal-events project
- Moves globalEval to metal-dom project
- Moves Attribute class to metal-attribute project
- Moves component classes to metal-component project
- Moves soy classes to metal-soy project
- Fixes karma configs
- Leaves only existing modules in index.js
- Moves tests from test/src to test/
- Exports core as the default module
- Fixes node tests
- Renamed "index.js" file to "metal.js"
- Adds back missing file
- Updates version of gulp-metal to 0.13.0
- Updates version of gulp-metal to 0.14.0
- Changes "install" script to be "prepublish"
v1.0.0-alpha.5
- Adds core.getFunctionName
- Removes references to the NAME static variable in Component
- Changes Component to cache render attrs when surfaces are updated as well
- Makes Component's generateSurfaceElementId_ function public
- Makes Component's getSurfaceElementId_ function public
- Removes buildElementSurfaceData_
- Replaces some duplicate lines of code in Component with a call to getElementExtendedContent
- Makes Component's getSurfaceId_ function public
- Changes getSurfaceId to only receive the surface config
- Adds the ComponentRenderer class
- Starts using ComponentRenderer inside Component
- Changes ComponentRegistry.register to not require the component name
- Renames SoyComponentAop to SoyAop
- Replaces SoyComponent with SoyRenderer
- Removes unused code inside Component
- Moves template storage from ComponentRegistry to SoyTemplates
- Removes SoyAop.registerAll function since compiled soy files already register templates automatically
- Updates version of gulp-metal to 0.5.0
- Adds function for evaluating scripts in global scope
- Fixes source formatting issues
- Finds script tags when rendering Component and makes sure they're evaluated
- Fixes coverage tests config
- Fixes global evaluation of scripts for Safari
- Creates eval module with functions for evaluating js code in global scope
- Allows newest versions of karma-source-map-support to be used
- Adds function to component for getting sub components with a given prefix
- Updates dependencies
- Changes ComponentRegistry.register to stop considering NAME value of super classes
- Adds a helper function to Component for registering components
- Sets option for skipping auto component registration to true
- Uses babel-preset-metal on tests
- Accepts passing component name through registerMetalComponent
- Updates gulp-metal to version 0.6.0
- Updates version of gulp-metal to 0.7.0
- Adds object.map function
- Adds automatic html sanitizing to SoyRenderer
- Stops trying to sanitize non string values
- Makes the async module Node compatible
- Adds comment about why typeof is being used directly
- Fixes lint error
- Improves core.UID_PROPERTY uniqueness
- Adds dom function to get the next sibling of an element that matches a selector
- Refactors some logic from Component to a separate function in globalEval
- Changes globalEval to run scripts in the right order
- Updates version of gulp-metal to 0.8.x
- Fixes problem with running scripts on element without any script tags
- Reverts "Improving core.UID_PROPERTY uniqueness"
- Renames the main template for soy components from "content" to "render"
- Adds missing "use strict" statements to karma config files
- Fixes bug with rendering content that should not be rendered
- Fixes lint warning
- Removes duplicate call to
addElementSurface_
from Component - Removes useless
decorateAsSubComponent
method - Adds core.isPromise
- Replaces all bower deps with npm
- Removes bower.json file
- Adds index.js file for easy usage through node
- Makes compile dev dependencies regular dependencies
- Adds function for generating random strings
- Exports dom from index.js
- Exports globalEval from index.js
- Removes bower reference from README.md
v1.0.0-alpha.4
- Removes disposed subcomponent completely from the components variable
- Stops removing surfaces from other components
- Caches content automatically when getElementExtendedContent is called
- Moves decorate logic outside of defaultRenderSurfaceFn_
- Adds logic for automatically removing unused surfaces and disposing their components
- Adds information about each surface's children and parent on Component
- Changes some optional params to be required inside Component methods
- Renders only the main content surface directly on "render"
- Stops supporting dom elements as return values of getSurfaceContent and getElementContent
- Allows passing surfaceElementId to soy templates
- Creates method for getting surface from its element id and uses it whenever possible in Component
- Changes createPlaceholderSurface_ to return the created surface
- Changes getSurfaceHtml from Component to be protected and receive surface object instead of just its id
- Stores the surface config with the info about collected placeholder surfaces in Component
- Passes surface config to Component's cacheSurfaceRenderAttrs_ method
- Disposes of the EventsCollector instance on Component
- Uses array.slice instead of Array.prototype.slice inside "emit"
- Adds array.slice function
- Moves clearing of firstSurfaceFound_ var to getElementContent inside SoyComponent
- Fixes placeholder surfaces being rerendered even when content doesn't change
- Fixes test for IE9/IE10 due to missing static property
- Stops throwing error when soy template depends on array attr defined only on template
- Changes Component to always pass renderAttrs on 'renderSurface' event
- Adds support for static surfaces
- Passes same data object from attrsChanged to attrsSynced
- Adds "attrsSynced" event that is emitted after the component is updated on attr changes
- Removes unnecessary rendering of child surfaces on cache hit while decorating
- Prevents rendering surfaces twice on decorate after cache miss
- Fixes use case of removing dom listener attached on capture phase
- Fixes dom test for Safari
- Allows listening to events on capture phase with dom.on
- Fixes calls to SoyComponent.decorateFromTemplate that don't pass the element's id with the data
- Fixes bug with calling SoyComponent.decorateFromTemplate on template that defines its own element
- Updates dev dependencies
- Removes unused closure-templates dependency
- Adds a public function to Component for clearing a surface's cache
- Changes call to
attachListeners
from Component to pass missing surface id - Changes SoyComponent to use template names as surface ids again when the content is rerendered
- Fixes bug that renders Components wrongly when they define the element inside getElementContent
- Emits "render" event during render lifecycle
- Adds a preventable event to Component for indicating that a surface will be rendered
- Adds "dom.contains" function to help with use case on IE9
- Adds missing "dom" test cases to improve coverage
- Removes direct calls to private functions on the "dom" test
- Adds missing test case of getting surface element of component that isn't registered
- Removes unused code
- Adds test case for adding surface that already exists to SurfaceCollector
- Passes the list of params from the "content" soy template to the main surface's data
- Makes the component's main content a surface
- Gets element tag from template when "element" attr is accessed for the first time
- Adds test cases to improve coverage of EventEmitter
- Allows defining and preventing default actions for custom events
- Removes unnecessary call to remove()
- Adds shortcut to attach delegate listeners to document through dom.on
- Removes "delegateTarget" key from event after listeners finish running
- Changes karma-source-map-support module's version to be fixed
- Removes console.log calls
- Moves next component data from ComponentCollector to the surface object
- Adds tests for SurfaceCollector
- Fixes broken test on IE9 by disposing used components when tests end
- Creates SurfaceCollector and changes Component placeholder surface logic to use it
- Allows nested surfaces to be passed to sub components through attr values
- Adds test coverage for should only create surfaces on nested components either from non private template calls or calls with surface id
- Fixes bubbling of events from sub components
- Enables attaching delegate listeners through Component's "events" attr
- Overwrites soydata.SanitizedHtml.from to be able to handle SanitizedHtml instances that come from the server
- Adds the component name to the error message for changing the element's tag
- Passes original data together with attributes to main component soy template
- Stops creating surfaces for private template calls without surface id
- Uses "private" generated var to define if a template is private in SoyComponent
- Fixes bug with using EventEmitterProxy with document as the origin event emitter
- Fixes SoyComponent class name test for IE9